# sebasops/bank-marketing architecture

> Architecture diagram of the GitHub repository sebasops/bank-marketing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sebasops/bank-marketing
- Repository: https://github.com/sebasops/bank-marketing

## Overview

#### Purpose and Entry Point

This is a small data-ingestion repository for the UCI Bank Marketing dataset (UCI repository id 222). Its primary executable entry point is `src/ingestion/ingest.py`, run as:

`python src/ingestion/ingest.py`

The repository currently centers on acquiring and persisting the raw source dataset; no training, API, or web application layer is represented.

#### Ingestion Stage

`src/ingestion/ingest.py` is the core pipeline stage. It retrieves the Bank Marketing dataset directly from UCI through the `ucimlrepo` Python library, making acquisition reproducible without pre-downloaded input files.

Source boundary:
- External UCI Machine Learning Repository
- Python client dependency declared in `requirements.txt`

#### Raw Data Persistence Boundary

The ingestion flow writes the retrieved dataset to `data/raw/bank_marketing.csv` as documented in `README.md`. This creates a clear raw-data boundary: downstream processing should consume the persisted CSV rather than independently contacting UCI.

The target `data/` directory is not present in the supplied tree, so it is expected to be created at runtime or is omitted from version control.

#### Local Database Artifact

`bank.db` is a repository-root database artifact. Its presence suggests a possible local persistence or analysis boundary, but no code path in the supplied tree establishes how it is created or consumed. The demonstrated ingestion path writes CSV output, not necessarily this database.

Relevant path:
- `bank.db`

#### Runtime and Dependencies

The runtime is Python, with dependencies installed from `requirements.txt`. The material external service is UCI, accessed programmatically via `ucimlrepo`; network access is therefore required when ingestion runs.

Relevant paths:
- `requirements.txt`
- `src/ingestion/ingest.py`

#### Primary Control and Data Flow

1. A user invokes `src/ingestion/ingest.py`.
2. The script requests dataset id 222 from UCI using `ucimlrepo`.
3. Retrieved Bank Marketing records are serialized as CSV.
4. The raw dataset is persisted at `data/raw/bank_marketing.csv`.
5. Future downstream stages can treat that file as the stable local input contract.

#### Architectural Boundaries

The repository separates external acquisition from later analytics or modeling by placing ingestion under `src/ingestion/` and emitting a raw file under `data/raw/`. There are no represented transformation, validation, feature-engineering, model-training, serving, orchestration, or cloud-infrastructure components.

Relevant paths:
- `src/ingestion/ingest.py`
- `README.md`

Main entry points: [`src/ingestion/ingest.py`](https://github.com/sebasops/bank-marketing/blob/main/src/ingestion/ingest.py) (Ingestion script), [`requirements.txt`](https://github.com/sebasops/bank-marketing/blob/main/requirements.txt) (Python dependencies), [`README.md`](https://github.com/sebasops/bank-marketing/blob/main/README.md) (Repository documentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Ingestion"]
  node_ingest_script["Ingestion script<br/>Python entry point<br/>[ingest.py]"]
  node_raw_csv["Raw Bank Marketing CSV<br/>raw data contract"]
end

node_user(("User<br/>actor"))
node_requirements["Python dependencies<br/>dependency manifest<br/>[requirements.txt]"]
node_uci{{"UCI Repository<br/>external dataset service"}}
node_bank_db[("Local database artifact<br/>[bank.db]")]
node_readme["Repository documentation<br/>[README.md]"]

node_user -->|"runs"| node_ingest_script
node_requirements -.->|"provides ucimlrepo"| node_ingest_script
node_ingest_script -->|"requests dataset 222"| node_uci
node_uci -->|"returns records"| node_ingest_script
node_ingest_script -->|"serializes CSV"| node_raw_csv
node_readme -.->|"documents output"| node_raw_csv

click node_ingest_script "https://github.com/sebasops/bank-marketing/blob/main/src/ingestion/ingest.py"
click node_requirements "https://github.com/sebasops/bank-marketing/blob/main/requirements.txt"
click node_bank_db "https://github.com/sebasops/bank-marketing/blob/main/bank.db"
click node_readme "https://github.com/sebasops/bank-marketing/blob/main/README.md"

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_ingest_script,node_raw_csv toneBlue
class node_user,node_requirements,node_uci,node_bank_db,node_readme toneNeutral
```

## Components

### Ingestion

Acquires and persists the raw dataset.

- [Ingestion script](https://github.com/sebasops/bank-marketing/blob/main/src/ingestion/ingest.py): Python entry point · Primary executable pipeline stage. · `src/ingestion/ingest.py`
- **Raw Bank Marketing CSV**: raw data contract · Stable local input for future downstream stages.

### Other components

- **User**: actor
- [Python dependencies](https://github.com/sebasops/bank-marketing/blob/main/requirements.txt): dependency manifest · Declares ucimlrepo for dataset retrieval. · `requirements.txt`
- **UCI Repository**: external dataset service · Bank Marketing dataset, id 222.
- [Local database artifact](https://github.com/sebasops/bank-marketing/blob/main/bank.db): database artifact · Present at the repository root; no demonstrated ingestion connection. · `bank.db`
- [Repository documentation](https://github.com/sebasops/bank-marketing/blob/main/README.md): documentation · Documents the raw CSV output path. · `README.md`

## Connections

- User → Ingestion script: runs · python src/ingestion/ingest.py
- Python dependencies → Ingestion script: provides ucimlrepo
- Ingestion script → UCI Repository: requests dataset 222 · Requires network access.
- UCI Repository → Ingestion script: returns records
- Ingestion script → Raw Bank Marketing CSV: serializes CSV
- Repository documentation → Raw Bank Marketing CSV: documents output
