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.3.tar.gz (7.1 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.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: core_apis-0.0.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for core_apis-0.0.3.tar.gz
Algorithm Hash digest
SHA256 17138b4c716b2f186434fa218980e3d60daadde7345cdc108ca3c40786937305
MD5 651d20facf7032a1d02e79a98857dca4
BLAKE2b-256 d2ca06a00eedd10e9377d5b44e20502b1d3610e006a4d22eaa5557a0c43f1a97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: core_apis-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for core_apis-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b269a773fc0b5f056b40f4f5fbb7e5c08ae0206af92fb6e637fd8f43811d07b9
MD5 1ca38e9f04ee05443e77894657506e28
BLAKE2b-256 5fb1a60352c8f03624371211c04955a48e340a29191b73bcad42a1910b2fb585

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