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-0.0.1.tar.gz (6.8 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-0.0.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: core_apis-0.0.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for core_apis-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9045bae2d1ec2b8ce808626f4402216e035c219e5bdba9b82cb3e47c58a35fbb
MD5 805611b42da264d0353b4dd618956027
BLAKE2b-256 5992a86c66f63330727cb86adb8a8bf72693e579567f585fa34ca839eb766b40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: core_apis-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for core_apis-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe630b586ce298ed6f3826205367867c397ada4a036cb4525d5a28e234d46a8b
MD5 d226945b8630a291f6d81b30830a8473
BLAKE2b-256 21bbadec81448f9f1332542eeb1a7eca7b8428eb5e3d0bd984bc828ef16fd1ca

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