- Ubuntu 22.04
- Make 4.3
- Python 3.10
- Docker 26.1.4
- Docker Compose 2.25.1
Take trades
microservice as an example in Usage section.
uv: an extremely fast Python package and project manager.
curl -LsSf https://astral.sh/uv/install.sh | sh
Create a project with uv.
cd services
uv init [project-name]
# e.g. uv init trades
Then the folder structure will be created automatically.
services
├── trades
│ ├── .python-version // the Python version used in the project
│ ├── hello.py // a simple hello world program (the entry point of the project)
│ ├── pyproject.toml // the configuration file for uv
│ └── README.md // the README file
Usually change hello.py
to run.py
and write the main logic in run.py
.
Make: a build automation tool.
sudo apt install make
Write a Makefile in the project.
cd services/trades
make [target]
# e.g. make run
Redpanda: a fast, reliable, and cost-effective Kafka®-compatible event streaming platform.
Use the docker compose file in docker-compose/redpanda.yml
.
And run the following command.
cd docker-compose
docker compose -f redpanda.yml up -d
Pre-commit: a framework for managing and maintaining multi-language pre-commit hooks.
uv tool install ruff # use ruff as the linter and formatter in pre-commit
uv tool install pre-commit
Install the git hooks scripts.
pre-commit install
# Ouput:
# pre-commit installed at .git/hooks/pre-commit
Then every time you commit, the hooks will be run automatically.
Or you can run against all the files manually, run the following command.
pre-commit run --all-files
- Ingest trades from external API
- Transform trades into technical indicators
- Save these technical indicators to a feature store