-
I have worked on this little project in my free time, around quite a busy work schedule.
-
I have deliberately tried to focus on code readability, as opposed to optimisation ("premature optimisation is the root of all evil").
I have chosen to use poetry
and pyenv
. To setup and use the environment:
poetry install
poetry shell
This will automatically create a virtual environment and install the required dependencies.
python main.py
The script will connect to Binance and periodically print the top bid/ask prices for BTCUSDT
.
To run them manually:
pre-commit run --all-files
This will run a series of linting and type-checking (flake8
, black
, mypy
) and tell you what needs to be fixed. You may need to run it more than once. It will be automatically run when attempting to commit a change.
To run tests:
pytest
For test coverage:
pytest --cov=keypad tests/