This is a personal project to create a python library for easy access to scryfall.
Features I want to ship with v1.0.0
- Potentially treat API errors the same as other data, as the API does?
- Potentially deal with images?
- Download Bulk Data and Switch automatically between
- Cache
- Downloaded Bulk Data
- Potentially download the Bulk Data
- Finally API
- 100% Code Coverage
- Tests (Mocked)
- Tests (Integration)
- 100% Typed
- MyPy
- Pylint
- Black
- Documentation
- To fill this list
- Install Poetry
- Optional: Set poetry to make an in project venv with
poetry config virtualenvs.in-project true
- Run
poetry install
- Run
poetry run pre-commit install
- Edit files
- Run
poetry run python <file>
- Run
poetry run pre-commit
to lint, format, generate requirements.txt, and more. - On commit: see committing section
This repo uses pre-commit to run Mypy, Pylint, Black, build requirements.txt, check pyproject.toml vs poetry, and isort at time of commit.
Commit will run black on all files, sort imports, and generate requirements.txt. Make sure requirements.txt is added and re-commit
This can be avoided by running poetry run pre-commit
poetry add/remove <library> [--dev]
to add or remove dev dependency.
poetry run pytest
to run pytest with coverage and generate HTML report in htmlcov/
poetry run black .
to black format code.
poetry run pre-commit
to run all of the pre-commit checks. Will modify files and generate some.
poetry run python <script>
to use the environment to run code.
Some words are reserved by python, so they are translated.
Data:
"id" = "api_id"
"object" = "obj"
"format" = "format_response"
"dir" = "direction"
"set" = "set_code"
"type" = "api_type"
"q" = "query" # One letter variables are not ideal
Objects:
"list" = "APIList"