# medseddik1999/etl-from-sql-to-neo4j architecture

> Architecture diagram of the GitHub repository medseddik1999/etl-from-sql-to-neo4j, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/medseddik1999/etl-from-sql-to-neo4j
- Repository: https://github.com/medseddik1999/etl-from-sql-to-neo4j

## Overview

This is a Python ETL application that migrates API data into Neo4j. Its main workflow fetches and cleans users, fetches courts and facilities, writes entity nodes, then builds and writes graph relationships; optional routines add booking and business-intelligence summaries. The driver owns these calls. The README also claims scheduling and error-handling/logging capabilities, but the excerpts do not show their implementation, so they are not mapped as runtime components.

Main entry points: [`__main__.py`](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/__main__.py) (Migration driver), [`mange_func.py`](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/mange_func.py) (HTTP data fetch), [`mN.py`](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/mN.py) (Entity node migration), [`migration_edges.py`](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/migration_edges.py) (Relationship migration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["API ingestion"]
  node_api{{"Source API"}}
  node_config["API and graph config<br/>[urls_passwords.py]"]
  node_fetch["HTTP data fetch<br/>[mange_func.py]"]
end

subgraph group_transform["Data preparation"]
  node_clean["Clean and date transforms<br/>[Clean_df.py]"]
  node_booking_aggregate["Booking aggregation<br/>[edges_maker.py]"]
end

subgraph group_graph["Neo4j migration"]
  node_driver["Migration driver<br/>[__main__.py]"]
  node_user_nodes["Entity node migration<br/>[mN.py]"]
  node_graph_db[("Neo4j graph")]
  node_edge_migration["Relationship migration<br/>[migration_edges.py]"]
  node_database_cleanup["Database cleanup<br/>[mange_func.py]"]
end

subgraph group_analytics["Analytics enrichment"]
  node_bi_nodes["BI node aggregation<br/>[Nodes_maker.py]"]
  node_bi_migration["BI property migration"]
end

node_operator(("Operator"))

node_operator -->|"runs"| node_driver
node_driver -->|"loads settings"| node_config
node_driver -->|"connects"| node_graph_db
node_driver -->|"clears database"| node_database_cleanup
node_driver -->|"requests data"| node_fetch
node_fetch -->|"HTTP GET"| node_api
node_driver -->|"cleans data"| node_clean
node_driver -->|"writes entities"| node_user_nodes
node_user_nodes -->|"writes nodes"| node_graph_db
node_driver -->|"aggregates bookings"| node_booking_aggregate
node_driver -->|"writes relationships"| node_edge_migration
node_edge_migration -->|"merges relationships"| node_graph_db
node_driver -->|"summarizes users"| node_bi_nodes
node_driver -->|"adds BI properties"| node_bi_migration
node_bi_migration -->|"updates properties"| node_graph_db
node_driver -->|"formats BI data"| node_clean

click node_driver "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/__main__.py"
click node_config "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/urls_passwords.py"
click node_fetch "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/mange_func.py"
click node_clean "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/Clean_df.py"
click node_booking_aggregate "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/edges_maker.py"
click node_user_nodes "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/mN.py"
click node_edge_migration "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/migration_edges.py"
click node_bi_nodes "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/Nodes_maker.py"
click node_bi_migration "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/BI_Migration_func.py"
click node_database_cleanup "https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/mange_func.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_config,node_fetch toneBlue
class node_clean,node_booking_aggregate toneAmber
class node_driver,node_user_nodes,node_graph_db,node_edge_migration,node_database_cleanup toneMint
class node_bi_nodes,node_bi_migration toneRose
class node_operator toneIndigo
```

## Components

### API ingestion

- **Source API**
- [API and graph config](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/urls_passwords.py): `urls_passwords.py`
- [HTTP data fetch](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/mange_func.py): `mange_func.py`

### Data preparation

- [Clean and date transforms](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/Clean_df.py): `Clean_df.py`
- [Booking aggregation](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/edges_maker.py): `edges_maker.py`

### Neo4j migration

- [Migration driver](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/__main__.py): `__main__.py`
- [Entity node migration](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/mN.py): `mN.py`
- **Neo4j graph**
- [Relationship migration](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/migration_edges.py): `migration_edges.py`
- [Database cleanup](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/mange_func.py): `mange_func.py`

### Analytics enrichment

- [BI node aggregation](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/Nodes_maker.py): `Nodes_maker.py`
- [BI property migration](https://github.com/medseddik1999/etl-from-sql-to-neo4j/blob/main/BI_Migration_func.py): `BI_Migration_func.py`

### Other components

- **Operator**

## Connections

- Operator → Migration driver: runs (evidence: `README.md`)
- Migration driver → API and graph config: loads settings (evidence: `__main__.py`)
- Migration driver → Neo4j graph: connects (evidence: `__main__.py`)
- Migration driver → Database cleanup: clears database (evidence: `__main__.py`)
- Migration driver → HTTP data fetch: requests data (evidence: `__main__.py`)
- HTTP data fetch → Source API: HTTP GET (evidence: `mange_func.py`)
- Migration driver → Clean and date transforms: cleans data (evidence: `__main__.py`)
- Migration driver → Entity node migration: writes entities (evidence: `__main__.py`)
- Entity node migration → Neo4j graph: writes nodes (evidence: `mN.py`)
- Migration driver → Booking aggregation: aggregates bookings (evidence: `__main__.py`)
- Migration driver → Relationship migration: writes relationships (evidence: `__main__.py`)
- Relationship migration → Neo4j graph: merges relationships (evidence: `migration_edges.py`)
- Migration driver → BI node aggregation: summarizes users (evidence: `__main__.py`)
- Migration driver → BI property migration: adds BI properties (evidence: `__main__.py`)
- BI property migration → Neo4j graph: updates properties (evidence: `BI_Migration_func.py`)
- Migration driver → Clean and date transforms: formats BI data (evidence: `__main__.py`)
