# hillairet/ciftt architecture

> Architecture diagram of the GitHub repository hillairet/ciftt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hillairet/ciftt
- Repository: https://github.com/hillairet/ciftt

## Overview

##### Project type and purpose
- CIFTT is a Python-based command-line application (an open-source tool) that automates the conversion between CSV spreadsheets and GitHub issues/projects.
- Its main use cases are:
- Importing issues: read a CSV and create or update GitHub issues.
- Exporting issues: read issues from GitHub and produce a CSV.

##### File structure
- Top level:
- ciftt.py – the CLI entry point.
- csv_data.py – CSV parsing and serialization.
- transform.py – core logic orchestrating CSV ↔ GitHub transformations.
- settings.py – configuration handling.
- utils.py – common utilities.
- github/ – package containing GitHub API integration:
– client.py (HTTP wrapper for GitHub REST API)
– data.py (data models/DTOs for issues)
– rate_limit.py (handles GitHub rate limits)
– utils.py (GitHub-specific helpers)
- tests/ – unit tests.
- Build/deploy:
- pyproject.toml – project metadata and dependencies.
- .gitignore, LICENSE, CONVENTIONS.md.

##### README for additional insights
- Describes two main commands: import-issues and export-issues.
- Workflow:
CSV file → CIFTT → GitHub API → repository issues or GitHub API → CSV output.
- Mentions CSV schema and validation in roadmap (labels, assignees, project fields).

##### Detail
– Break down github/ into subcomponents so readers see rate limiting as its own module.
– Show utils.py separately to underscore shared helper responsibilities.
– If space allows, indicate error handling or retry loops in the GitHub Client component.

Putting it all together:
[User CLI] → [Settings Loader]
→ [CSV Parser] ↔ [Transform Layer] ↔ [GitHub Client] → [GitHub REST API]
← [GitHub REST API] ← [GitHub Client] ← [Transform Layer] ← [CSV Serializer]
- Surround the CLI, Parser, Transform, Client in one container named “ciftt application”.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% ciftt Application Components
    subgraph "ciftt application"
        CLI["CLI Interface\n(ciftt.py)"]:::cli
        Settings["Configuration Manager\n(settings.py)"]:::config
        CSV["CSV Module\n(csv_data.py)"]:::csv
        Transform["Transformation Orchestrator\n(transform.py)"]:::transform
        Client["GitHub Client Layer\n(github/client.py)"]:::client
        Models["GitHub Data Models\n(github/data.py)"]:::models
        RateLimit["Rate Limiter\n(github/rate_limit.py)"]:::rate
        GHUtils["GitHub-specific Utilities\n(github/utils.py)"]:::utils
        Utils["Common Utilities\n(utils.py)"]:::utils
    end

    %% External Service
    GitHubAPI["GitHub REST API"]:::external

    %% Data Flows
    CLI -->|loads| Settings
    CLI -->|invokes import/export| Transform
    Settings --> Transform
    Transform -->|reads/writes| CSV
    Transform -->|uses| Models
    Transform -->|calls| Client
    Client -->|applies| RateLimit
    Client -->|calls| GitHubAPI
    GitHubAPI -->|responses| Client
    Client -->|returns data| Transform
    Transform -->|serializes| CSV

    %% Tests Suite
    subgraph "tests (unit tests)"
        Tests["Tests Suite\n(tests/)"]:::tests
    end
    Tests --> CSV
    Tests --> Transform
    Tests --> Client
    Tests --> Utils

    %% Documentation and Metadata
    Docs["README & CONVENTIONS\n(README.md, CONVENTIONS.md)"]:::docs
    License["LICENSE"]:::docs
    Meta["pyproject.toml"]:::docs

    %% Click Events
    click CLI "https://github.com/hillairet/ciftt/blob/main/ciftt.py"
    click Settings "https://github.com/hillairet/ciftt/blob/main/settings.py"
    click CSV "https://github.com/hillairet/ciftt/blob/main/csv_data.py"
    click Transform "https://github.com/hillairet/ciftt/blob/main/transform.py"
    click Client "https://github.com/hillairet/ciftt/blob/main/github/client.py"
    click Models "https://github.com/hillairet/ciftt/blob/main/github/data.py"
    click RateLimit "https://github.com/hillairet/ciftt/blob/main/github/rate_limit.py"
    click GHUtils "https://github.com/hillairet/ciftt/blob/main/github/utils.py"
    click Utils "https://github.com/hillairet/ciftt/blob/main/utils.py"
    click Tests "https://github.com/hillairet/ciftt/tree/main/tests/"
    click Meta "https://github.com/hillairet/ciftt/blob/main/pyproject.toml"
    click Docs "https://github.com/hillairet/ciftt/blob/main/README.md"
    click Docs "https://github.com/hillairet/ciftt/blob/main/CONVENTIONS.md"
    click License "https://github.com/hillairet/ciftt/tree/main/LICENSE"

    %% Styles
    classDef cli fill:#FFD700,stroke:#333,stroke-width:1px
    classDef config fill:#FFFA9E,stroke:#333,stroke-width:1px
    classDef csv fill:#AED6F1,stroke:#333,stroke-width:1px
    classDef transform fill:#ABEBC6,stroke:#333,stroke-width:1px
    classDef client fill:#F5B7B1,stroke:#333,stroke-width:1px
    classDef models fill:#D2B4DE,stroke:#333,stroke-width:1px
    classDef rate fill:#F9E79F,stroke:#333,stroke-width:1px
    classDef utils fill:#D5DBDB,stroke:#333,stroke-width:1px
    classDef external fill:#85C1E9,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef tests fill:#FADBD8,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef docs fill:#AED6F1,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
```
