Skip to content

About

Crypto price ETL pipeline in Python — fetches prices, stores history in SQLite, reports variation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

CryptoPulse

A small, complete ETL pipeline in Python: it fetches live cryptocurrency prices from a public API, stores the history in SQLite, and reports price variation over time.

Why this project

A lot of portfolio projects stop at "call an API and print the response." This one goes one step further and builds the full loop a real data pipeline needs: fetch → persist → derive metrics → run on a schedule.

Architecture

src/cryptopulse/
├── client.py       CoinGeckoClient — the only module that knows about HTTP
├── models.py        PricePoint — the shared data shape
├── storage.py         PriceStorage — SQLite persistence
├── pipeline.py          PricePipeline — orchestrates fetch + persist
├── report.py              percent_change / build_summary / print_summary
├── scheduler.py             run_forever — repeats the pipeline on an interval
└── cli.py                    argparse entrypoint

Every class depends on the layer below through a narrow interface (e.g. PricePipeline only needs something with a fetch_prices method and something with a save method), so each piece can be tested and replaced independently — swapping SQLite for Postgres only means writing a new PriceStorage.

Running locally

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# the package lives under src/, so point Python at it
export PYTHONPATH=src

# fetch prices once and store them
python -m cryptopulse run-once

# fetch prices every 60 seconds, forever
python -m cryptopulse run --interval 60

# print the latest prices and their variation
python -m cryptopulse report

By default it tracks bitcoin, ethereum and solana — override with --coins bitcoin dogecoin.

Tests

pytest

12 tests cover the HTTP client (mocked, no real network calls), the SQLite storage layer (temporary databases), the pipeline orchestration, and the report calculations.

Tech stack

Python, standard library sqlite3 and argparse, plus requests for HTTP. No ORM, no scheduler framework — kept intentionally small.

About

Crypto price ETL pipeline in Python — fetches prices, stores history in SQLite, reports variation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages