Skip to main content

Paquetage Python pour gérer les configurations, l'internationalisation et les routes dans les applications FastAPI

Project description

README

pyarccore est un paquetage Python pour gérer les configurations, l'internationalisation et les routes dans les applications FastAPI.

Builder le projet

Installations préalables

  • windows : python -m pip install sdist bdist_wheel
  • linux : sudo -H pip3 install sdist bdist_wheel

Builder le projet

  • windows : python setup.py sdist bdist_wheel
  • linux : sudo py setup.py sdist bdist_wheel

Deployer le projet sur pip

  • windows : python -m twine upload dist/*
  • linux : sudo twine upload dist/*

Git

Cloner le projet

git init && git remote add origin https://[username]@bitbucket.org/[username]/pypyarc.git && git config user.email [email] && git checkout -b [branche] && git pull origin [branche]

Pousser le projet

git checkout [branche] && git add -A && git fetch && git merge [branche] && git commit -am "[le message commit]" && git push -u origin [branche]

Tests

  • windows : cls && python test.py
  • linux : clear && python test.py

Docstring

Installations préalables

  • windows : python -m pip install pdoc3
  • linux : sudo -H pip3 install pdoc3

Au préalable

Documenter aux préalables son code.

Generer une documentation

  • windows : python -m pdoc [projet]
  • linux : sudo pdoc [projet]

Exemple d'utilisation

from fastapi import FastAPI
from pyarccore import init_app, t, cfg, register_routes

app = FastAPI()
init_app()

# Use translations
print(t("hello.world"))  # Returns translation for "hello.world"

# Use configurations
print(cfg("database.url"))  # Returns configuration value for "database.url"

# Register routes
router = APIRouter()
register_routes(router, "path/to/routes")
app.include_router(router)

Structure recommandée pour l'application utilisant ce package

arc_project/
├── config.xml
├── locales/
│   └── fr.json
├── modules/
│   └── votre_module/
│       ├── config.xml
│       └── locales/
│           └── fr.json
└── routes/
    └── vos_routes/
        └── *.py

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

pyarccore-0.0.1211112.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

pyarccore-0.0.1211112-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file pyarccore-0.0.1211112.tar.gz.

File metadata

  • Download URL: pyarccore-0.0.1211112.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for pyarccore-0.0.1211112.tar.gz
Algorithm Hash digest
SHA256 fb6237f3bfb1f22fdf8da870a69642f34243dd31e93e54cfd86b2b3c84134867
MD5 9e3f8aefd71c530616368801fdf4e07c
BLAKE2b-256 a8a7a41e5cdaebf34fe747c459bc021c5f48653cdb18ecde5d6a4032f3ee8426

See more details on using hashes here.

File details

Details for the file pyarccore-0.0.1211112-py3-none-any.whl.

File metadata

File hashes

Hashes for pyarccore-0.0.1211112-py3-none-any.whl
Algorithm Hash digest
SHA256 f9512c2d6b61ff712b6232a71bfced54ef84c9491c97931b48c94415938746aa
MD5 988ab2690ec1f587a6930973a893dd05
BLAKE2b-256 c744b0baf60e8ebdd02cab1b2286f6123011b1fced050ee8c91616433522d227

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