Skip to main content

General

Maintenance - intended Semantic Versioning - 2.0.0 License

CI

Test status Read the Docs Pre-Commit Code Style Black CodeCov

PyPI

PyPI - Package latest release PyPI - Supported Python Versions PyPI - Status PyPI - Format PyPI - Monthly downloads

Github

GitHub - Issue Counter GitHub - Top Language GitHub - Last Commit GitHub - PiPy Deployment

This project provides a sandbox to experiment with FastAPI. This idea is to build an example sequentially in steps to give new users the idea on where to start and how to progress.

Along the way some principles will be exhibited. The code should be self-explanatory.

The source code in src by itself does not do much, it basically only defines the tables and some setup code. The “examples” are in the pytest's since we are experimenting to see howe it works and if it was successful.

References:

Installation

  1. Since this is intended for experimental purposes, it is recommended to create a virtual environment to experiment for installation.

  2. Set the following environment variables in the virtual environment. Set these in your IDE as well.

  3. Start Docker. The docker-rebuild.bat script will git docker up and running.

  4. The setup and installation is for Windows. Feel free to add contribute to get it running on Linux as well.

python -m venv ./FastAPIexample_venv
pip install FastAPIexample
pre-commit install
SET MYSQL_HOST=localhost
SET MYSQL_ROOT_PWD=N0tS0S3curePassw0rd
SET MYSQL_TCP_PORT_EXAMPLES=50002
SET SQLALCHEMY_SILENCE_UBER_WARNING=1
docker-rebuild.bat

Tests

  1. This project uses pytest to run tests.

  2. There are various settings combinations in the [tool.pytest.ini_options] section of the pyproject.toml file that can used by commenting it out.

  3. This project uses black to format code and flake8 for linting. We also support pre-commit to ensure these have been run. To configure your local environment please install these development dependencies and set up the commit hooks.

pytest

Contributing

Naming Conventions

  1. File names
    1. Not knowing what’s to come and what will be added, it is difficult to determine a naming convention for source, test and other file names. The owner will therefore be a “benevolent dictator” to rename and change names.

    2. Link the file name of the source code and the test so that it is easily linked.

  2. Branch names

    “enhancement” | “bug” | “hotfix”/< ticket_nr>_<description>

    where

    enhancement - Planned improvement or addition to functionality; non-urgent.

    bug - An error or defect causing incorrect or unexpected behavior; typically fixed in regular development cycles.

    hotfix - An urgent, critical fix applied directly to the live environment, often bypassing regular development cycles.

    ticket_nr: Ticket number assigned to the issue in GitHub. Once an issue is registered, the owner will assign a ticket.

    description: GitHub issue title or combination of titles is more than one issue is addressed.

Releasing

For the purpose of push and release of code two script files are included. Use there two files to files to make life a bit easier. The scripts make use of the gitit module to simplify tasks.

  1. push.bat - Use this script to push branches to GitHub repository. In principle it does the following:

    usage: push message

    e.g. push “Changed the Infinite Improbability Drive”

    1. .rst syntax check

    2. git add -A

    3. git commit -m message (with pre-commit including black and flake8)

    4. git push –all

  2. release.bat - Use this script to push a new tag and release to the GitHub repository. Remember to change the version number in the setup.cfg else the workflow will fail.

    usage: release version The version will match the release and the tag. Only issue a release once a push.bat was successful. In principle it does the following:

    e.g. release 1.2.3

    1. Commit the changes

    2. Create and push the release tag with the correct naming conventions.

    3. Checkout master since it assumes that the branch is now merged with master and will be deleted.

    4. display a list of all the current branches as a reminder to delete the branch on completion.

Metadata

Release files for FastAPIExample 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FastAPIExample 0.0.6
File Size Uploaded
FastAPIExample-0.0.6.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for FastAPIExample 0.0.6
File Interpreter ABI Platform
FastAPIExample-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / FastAPIExample-0.0.6.tar.gz

Download URL FastAPIExample-0.0.6.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4a6cbb7d0433b509936bd7b417ff96204e5a6b3bb51b0fec562bfa4d19743a15
BLAKE2b-256 checksum
How to use checksums
aa0c423880b9bb01986267eb3f8315bced4df37ab6fe25f41a86c3afb47f4762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / FastAPIExample-0.0.6-py3-none-any.whl

Download URL FastAPIExample-0.0.6-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0371c48c8319a2bb8d27ebdaf8f2277ce68e4b4d02022c10b98f748103642ea
BLAKE2b-256 checksum
How to use checksums
264397d9ef0cd3694b6e81dd8c90c14a5591639befc84836881fb125f293ca8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page