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.2.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.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: core_apis-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 12e528bbf88ba16886e0ccf6f5506848808f48d4990395c9d0fc8adf959c78b0
MD5 40bedc6e3e89114c2585a85bf18d2a04
BLAKE2b-256 18ca8c83997afb119a5f58c6c5ca42cb763eacfe680b8f0621914cf49fdad67c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: core_apis-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed9d12bdf7fbd2dcb9584c7d18b6c4362242867f08b6e6b01826ee32c00bb728
MD5 100ae8c290dc6e101da73ae907560ee7
BLAKE2b-256 9c431712184db14bea28f6b9b7473966273473fc949dde39acbf8c82675da216

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