Jackson Easy API
Easy API is a simple library for building APIs using FastAPI and SQLAlchemy. It provides an easy-to-use framework to help you create and manage APIs with minimal effort.
Installation
To install Easy API, run the following command:
pip install jackson_easy_api
After installation, run the start command to initialize your project and generate the manage.py file in the root of your project:
start
Available Commands
Commands:
createproject <name> Create a new project with the given name
createapp <name> Create a new app within your project
makemigrations Generate a new migration with a message
migrate Apply migrations to the database
test <app_name> Run tests for the specified app (or all apps if no app_name is provided)
format <app_name> Format a specified app using isort and blue
--help, -h Show this help message
Example Usage
- Create a new project:
python manage.py createproject my_project
- Create a new app within the project:
python manage.py createapp my_app
Important: After creating a new app, you must add the app name to the
appslist insettings.py. This ensures the app's routes are included in the FastAPI application.
Here's an example of how to modify settings.py:
import importlib
from typing import List
from fastapi import FastAPI
class Settings:
app_title: str = "API School"
app_version: str = "1.0.0"
apps: List[str] = ["my_app"] # Add your app here
@staticmethod
def create_app() -> FastAPI:
application: FastAPI = FastAPI(
title=settings.app_title,
version=settings.app_version,
)
# Loop through the apps and include their routes
for app_name in settings.apps:
app_module = importlib.import_module(f"{app_name}.routes")
application.include_router(app_module.router, prefix=f"{app_name}", tags=[app_name])
return application
settings = Settings()
This configuration will ensure that the routes for your app (my_app in this case) are included in the FastAPI application with a URL prefix of /my_app.
- Make migrations for your app:
python manage.py makemigrations
- Apply migrations to the database:
python manage.py migrate
- Run tests for a specific app:
python manage.py test my_app
Documentation
For detailed documentation and usage examples, please visit the GitHub repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Release files for jackson_easy_api 0.3.308
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jackson_easy_api-0.3.308.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jackson_easy_api-0.3.308-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / jackson_easy_api-0.3.308.tar.gz
| Download URL | jackson_easy_api-0.3.308.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b71670d2906ed7e2ce60390ff11125b6eedb6b2118bae5f7c96ace608d04e82a
|
|
BLAKE2b-256 checksum How to use checksums |
d25d87c8e3df233564b4de497086e97575142595a211563d5780b98c7d12ce0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.11.10 Linux/6.5.0-1025-azure
|
Release files / jackson_easy_api-0.3.308-py3-none-any.whl
| Download URL | jackson_easy_api-0.3.308-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f7c914748a5d2d63f841ce6a6a6e3350575c21e4a007b1759eff36306a507cf
|
|
BLAKE2b-256 checksum How to use checksums |
f5994c5ef6b4fc5c70228bb882a4cc4ccc25117fb19986d5f007c9b9951a3f4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.11.10 Linux/6.5.0-1025-azure
|