Skip to main content

This project/library contains useful elements related to APIs...

Project description

core-apis


This project/library contains useful elements related to APIs and provides basic structures to speed up the implementation of an API service using the FastApi framework as base...

How to use it

Create the virtual environment

virtualenv .venv
source .venv/bin/activate
pip install core-apis

The simple way to spin up the FastAPI server and running it locally using uvicorn...

# -*- coding: utf-8 -*-
from core_apis.api import server
server.run()

Adding custom routers...

# -*- coding: utf-8 -*-

from fastapi import APIRouter

from core_apis.api import server
from core_apis.api.routers import add_router

router = APIRouter()
add_router(router)

@router.get(path="/server_status")
def new_router():
    return {"status": "OK"}

server.run()

For an example of the structure of a production-ready project check: https://gitlab.com/bytecode-solutions/examples/fastapi-project

Execution Environment

Install libraries

pip install --upgrade pip
pip install virtualenv

Create the Python Virtual Environment.

virtualenv --python=python3.11 .venv

Activate the Virtual Environment.

source .venv/bin/activate

Install required libraries.

pip install .
pip install .[test]

Check tests and coverage...

python manager.py run-tests
python manager.py run-coverage

Run FastAPI server...

python manager.py run-api

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

core_apis-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

core_apis-1.0.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file core_apis-1.0.0.tar.gz.

File metadata

  • Download URL: core_apis-1.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for core_apis-1.0.0.tar.gz
Algorithm Hash digest
SHA256 be6c647c36638783a53d8753d655057ed0a0d17e69aeebafdb398fd8ee9d1478
MD5 6c08c4d8b92bd6fc57aabd6f3e908142
BLAKE2b-256 2a8ea986c02c25f21ae9cc098439275c7fabe929e6d5909d9637121d5b5c1cdc

See more details on using hashes here.

File details

Details for the file core_apis-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: core_apis-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for core_apis-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c3169d277f32038a4f194eda4e94876b1354cd735a3a1319fc491c0ce7f6085
MD5 968164d8e1645d3cab6c5ec1bc077075
BLAKE2b-256 6f9e4d1f8084a56529a0505a87b1c23e79bef10c540b3cc094558f0184cd0243

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