Skip to main content

FastAPI Global variable

Project description

FastAPI Global Variable

How to use

  1. Set a variable
# user_service.py
from fastapi import FastAPI
from fastapi_global_variable import GlobalVariable

app = FastAPI(title="Application")

GlobalVariable.set('app', app)
  1. Use variable
from fastapi_global_variable import GlobalVariable

print(GlobalVariable.get_or_fail('app'))
print(GlobalVariable.get('app'))

How to test in testpypi

  1. Increase the version in pyproject.toml
  2. Run command
$ . ./build_and_test.sh

How to publish new version

  1. Increase the version in pyproject.toml
  2. Run command
$ . ./build_and_publish.sh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_global_variable-0.0.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_global_variable-0.0.4-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_global_variable-0.0.4.tar.gz.

File metadata

  • Download URL: fastapi_global_variable-0.0.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for fastapi_global_variable-0.0.4.tar.gz
Algorithm Hash digest
SHA256 733638e0bf29de1efb2b3a0d7835a4e23044100e5af078d235511fde3348bc88
MD5 76ca3fda6405e416c6791fa54e67d69f
BLAKE2b-256 97519061a84743820af8ef18fe991de7c113c01388dc557319a3e029b22313b3

See more details on using hashes here.

File details

Details for the file fastapi_global_variable-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_global_variable-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 adf25fe03c5fccaae9590e2a1c2e628e18e95033e07ef00871bb82ae764ad215
MD5 d40ebff764f9358ffa56764fdc5be54c
BLAKE2b-256 bedc6cd330a24e129b27b6d389a300d73fc9af135003cb7c40e2e9149e5ec727

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page