FastAPI Global variable
Project description
FastAPI Global Variable
How to use
- Set a variable
# user_service.py
from fastapi import FastAPI
from fastapi_global_variable import GlobalVariable
app = FastAPI(title="Application")
GlobalVariable.set('app', app)
- Use variable
from fastapi_global_variable import GlobalVariable
print(GlobalVariable.get_or_fail('app'))
print(GlobalVariable.get('app'))
How to test in testpypi
- Increase the version in
pyproject.toml
- Run command
$ . ./build_and_test.sh
How to publish new version
- Increase the version in
pyproject.toml
- Run command
$ . ./build_and_publish.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fastapi_global_variable-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 733638e0bf29de1efb2b3a0d7835a4e23044100e5af078d235511fde3348bc88 |
|
MD5 | 76ca3fda6405e416c6791fa54e67d69f |
|
BLAKE2b-256 | 97519061a84743820af8ef18fe991de7c113c01388dc557319a3e029b22313b3 |
Close
Hashes for fastapi_global_variable-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adf25fe03c5fccaae9590e2a1c2e628e18e95033e07ef00871bb82ae764ad215 |
|
MD5 | d40ebff764f9358ffa56764fdc5be54c |
|
BLAKE2b-256 | bedc6cd330a24e129b27b6d389a300d73fc9af135003cb7c40e2e9149e5ec727 |