Skip to main content

FastApp

HTTP Apps Made Easier with FastApp

Installation

pip install fastapp

Using Out the Example Server

pip install fastapp[example]
fastapp serve-debug fastapp.app.example:app

Using FastApp to build an app

Create a Python File with Endpoints, we'll call this main.py:

from datetime import datetime

from fastapp.app import app


@app.get("/hello")
def custom_endpoint() -> dict:
    """"
    This is a Custom API Endpoint
    """
    return dict(timestamp=datetime.now(),
                hello="world")

Then, using the FastApp CLI we can serve this App:

fastapp serve-debug main:app

...or via docker:

docker run --rm -it \
    --publish 8080:8080 \
    --volume ${PWD}/main.py:/root/fastapp/main.py \
    juftin/fastapp:latest \
    serve-debug main:app

Test out our new endpoint:

curl \
  --request GET \
  --header "Content-Type: application/json" \
  http://localhost:8080/hello

Alternatively, if we want to serve this app using Gunicorn, Nginx, and the UvicornWorker we can use the serve command:

fastapp serve main:app

I prefer doing this within a docker container so you don't have to run Nginx on the host machine:

docker run --rm -it \
    --publish 8080:8080 \
    --volume ${PWD}/main.py:/root/fastapp/main.py \
    juftin/fastapp:latest \
    serve main:app

Metadata

Release files for fastapp 0.1.7

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

Source distribution (sdist)

Source distribution for fastapp 0.1.7
File Size Uploaded Provenance
fastapp-0.1.7.tar.gz 12.1 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 28.1 kB

Release files / fastapp-0.1.7.tar.gz

Download URL fastapp-0.1.7.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bb7ed3818c7be485287f42e45e00ba3467f79c2e9b3f978f12f2dd6cf54d5043
BLAKE2b-256 checksum
How to use checksums
b4f8309fe11a80f7695af7410b24dbc5ef95a31faadf8cfa5d9bd15146ce05cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / fastapp-0.1.7-py3-none-any.whl

Download URL fastapp-0.1.7-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2c93a8f499def8c50ed3ee0404fdd94b24d0e0e5b2f097bb38f143e229ef8a0
BLAKE2b-256 checksum
How to use checksums
04ce9086c03d3886996fcbe493c05c9b7a3d5234a46ba0ce5f24cbd703fa29c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for fastapp 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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