Metadata-Version: 2.1
Name: core-apis
Version: 0.0.2
Summary: This project/library contains useful elements related to APIs...
Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
Maintainer: Alejandro Cora González
License: MIT
Project-URL: Homepage, https://gitlab.com/bytecode-solutions/core/core-apis
Project-URL: Repository, https://gitlab.com/bytecode-solutions/core/core-apis
Project-URL: Issues, https://gitlab.com/bytecode-solutions/core/core-apis/-/issues
Project-URL: Changelog, https://gitlab.com/bytecode-solutions/core/core-apis/-/blob/master/CHANGELOG.md
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: core-https>=1.1.0
Requires-Dist: core-tests>=1.1.0
Requires-Dist: fastapi>=0.115.6; python_version >= "3.8"
Requires-Dist: fastapi>=0.100.1; python_version >= "3.7" and python_version < "3.8"
Requires-Dist: uvicorn>=0.34.0; python_version >= "3.9"
Requires-Dist: uvicorn>=0.30.0; python_version >= "3.8"
Requires-Dist: uvicorn>=0.20.0; python_version >= "3.7"
Provides-Extra: test
Requires-Dist: httpx>=0.28.1; python_version >= "3.8" and extra == "test"
Requires-Dist: httpx>=0.24.1; python_version >= "3.7" and extra == "test"

# 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
```shell
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`...
```python
# -*- coding: utf-8 -*-
from core_apis.api import server
server.run()
```

Adding custom routers...
```python
# -*- 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
```shell
pip install --upgrade pip
pip install virtualenv
```

### Create the Python Virtual Environment.
```shell
virtualenv --python=python3.11 .venv
```

### Activate the Virtual Environment.
```shell
source .venv/bin/activate
```

### Install required libraries.
```shell
pip install .
pip install .[test]
```

### Check tests and coverage...
```shell
python manager.py run-tests
python manager.py run-coverage
```

### Run FastAPI server...
```shell
python manager.py run-api
```
