This release is a pre-release and may not be stable for production use.
Pathify ⭐
Pathify is a lightweight and flexible framework for building backend APIs with FastAPI. Inspired by Next.js routing, it allows you to easily organize and dynamically load routes by creating Python files in a directory structure. With Pathify, creating API routes is as simple as adding new Python files in corresponding folders.
⚠️ Disclaimer ⚠️
This project is an educational toy and is intended for basic concepts and experiments. It is not intended for use in a production environment and does not meet the necessary level of security, performance, or fault tolerance.
Use this code at your own risk. For your projects, it is recommended to rely on proven frameworks and libraries.
Features
- Dynamic Route Loading: Automatically loads routes from the directory structure.
- Easy URL Parameterization: Supports dynamic URL parameters for building RESTful APIs easily.
- Simple HTTP Method Support: Easily define HTTP methods (
GET,POST) in Python files.
Installation
You can install Pathify from PyPI via pip:
pip install pathifyapi
Usage
Create a GET / route:
# routers/get.py
def get():
return {"message": "Hello, World!"}
After starting the server, the route GET / will be available at http://localhost:8000/ and will return {"message": "Hello, World!"}.
Create a GET /hello/{name} route:
# routers/hello/{name}.py
def get(name: str):
return {"message": f"Hello, {name}!"}
Example project structure
project/
├── app.py
└── routers/
├── get.py
├── hello/
│ ├── {name}.py
└── users/
├── {id}.py
└── {id}/
└── post.py
Example FastAPI application
from pathify import Pathify
pathify = Pathify(routers_dir="routers")
app = pathify.get_app()
To get started use uvicorn:
uvicorn app:app --reload
Russian README.md here
Release files for PathifyAPI 0.0.2b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pathifyapi-0.0.2b0.tar.gz | 2.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pathifyapi-0.0.2b0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / pathifyapi-0.0.2b0.tar.gz
| Download URL | pathifyapi-0.0.2b0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6d547b4e5d74ebb33a815b2223f4a5ff3c48a98b8960a09f806dde9c0ce6e04
|
|
BLAKE2b-256 checksum How to use checksums |
3e9c65b437ad4c35242ece8a8a25701d518af674de801b96b87d9af7c57ee716
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.0 CPython/3.12.6
|
Release files / pathifyapi-0.0.2b0-py3-none-any.whl
| Download URL | pathifyapi-0.0.2b0-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3194e3d6931a024ddd677b20c9d036d6b6f96025fd9967d32b23ce88ab37a86
|
|
BLAKE2b-256 checksum How to use checksums |
dd3cd9e362374fe956587fe5773fb689c24b306bd7e42a197e60b163b1f4f6d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.0 CPython/3.12.6
|