Skip to main content

Minumtium FastAPI

A FastAPI application layer for the minumtium library.

How it works

This library will provide you REST endpoints for authentication, user management and posts. It will use by default the Simple JWT Auth Adapter for authentication and the SQLite Adapter for data access/storage, but you can provide your own adapters if needed. Also, exposing the user management endpoints is optional, for the cases where you have your own user management and/or authentication systems and don't want to use the built-in ones.

This library is meant to be integrated into a bigger FastAPI application, so you can extend your application adding very simple blogging functionality to it.

Usage

Install it using your favorite package manager:

pip install minumtium-fastapi
pipenv install minumtium-fastapi
poetry install minumtium-fastapi

Then, get the FastAPI router to connect it as a subapp into your main FastAPI app:

from fastapi import FastAPI

import minumtium_fastapi

# Create the minumtium subapp
minumtium = minumtium_fastapi.get_minumtium_fastapi()

# Mount minumtium into your main application, with whatever prefix you would like
main_application = FastAPI()
main_application.mount('/minumtium', main_application)

You will get an instance that will use an in-memory sqlite and the standard JWT authentication when you call minumtium_fastapi.get_minumtium_fastapi() without passing any arguments.

Providing Custom Adapters

You can also provide your own adapters for data and authentication and disable the user management endpoints.

from fastapi import FastAPI

import minumtium_fastapi

from my_cool_app import MyCoolDatabaseAdapter, MyCoolAuthenticationAdapter

# Create your adapters
database_adapter_posts = MyCoolDatabaseAdapter('posts')
database_adapter_users = MyCoolDatabaseAdapter('users')
authentication_adapter = MyCoolAuthenticationAdapter()

# Create the minumtium subapp
minumtium = minumtium_fastapi.get_minumtium_fastapi(database_adapter_posts,
                                                    database_adapter_users,
                                                    include_user_endpoints=False)

# Mount minumtium into your main application, with whatever prefix you would like
main_application = FastAPI()
main_application.mount('/minumtium', main_application)

Running Standalone

You can also run it standalone, but this is probably useless. Create a file named main.py with the following contents:

from fastapi import FastAPI

import minumtium_fastapi

app = FastAPI()
app.mount('/minumtium', minumtium_fastapi.get_minumtium_fastapi())

Then execute it in the terminal:

uvicorn main:app --reload

API Docs

You will be able to see the API docs going to /<minumtium mount path>/docs in a running instance of minumtium.

Metadata

Release files for minumtium-fastapi 1.1.0

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

Source distribution (sdist)

Source distribution for minumtium-fastapi 1.1.0
File Size Uploaded Provenance Actions
minumtium_fastapi-1.1.0.tar.gz 6.5 kB Without provenance Details for minumtium_fastapi-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for minumtium-fastapi 1.1.0
File Interpreter ABI Platform Actions
minumtium_fastapi-1.1.0-py3-none-any.whl Python 3 none any Details for minumtium_fastapi-1.1.0-py3-none-any.whl

Total release size: 14.1 kB

Release files / minumtium_fastapi-1.1.0.tar.gz

Download URL minumtium_fastapi-1.1.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
21d6e2bb33162736e77b3e8b4bea7a06baec472e28aa82a3e5114a3b94e87c55
BLAKE2b-256 checksum
How to use checksums
1ca0adda51e37b94e5c64fb8f1ecac80b038e58a0267796d645774a943bba16d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / minumtium_fastapi-1.1.0-py3-none-any.whl

Download URL minumtium_fastapi-1.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bafde47392a0aba50fd48c7ad417321b12ae1a3365eec41425c0239ad5f12257
BLAKE2b-256 checksum
How to use checksums
c3e4407f1179500e4b421fb49c9cada87133de5c5bcc154427d5f69b210f2c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for minumtium-fastapi 1.1.0

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