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.
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.
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.
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 reportBy default it tracks bitcoin, ethereum and solana — override with
--coins bitcoin dogecoin.
pytest12 tests cover the HTTP client (mocked, no real network calls), the SQLite storage layer (temporary databases), the pipeline orchestration, and the report calculations.
Python, standard library sqlite3 and argparse, plus requests for
HTTP. No ORM, no scheduler framework — kept intentionally small.