A simple MVC library for Hero management with in-memory database support
Project description
Hero MVC Library
A simple, clean MVC (Model-View-Controller) library for Hero management with in-memory database support.
Features
- Clean MVC architecture
- Generic CRUD operations
- In-memory SQLite database support
- FastAPI integration
- Type-safe with Pydantic models
- Extensible hooks system
Installation
pip install hero-mvc-lib
Quick Start
from hero_mvc_lib import HeroService, init_hero_db
from hero_mvc_lib.models import HeroCreate
# Initialize the database
init_hero_db()
# Create a hero service
hero_service = HeroService()
# Create a new hero
hero_data = HeroCreate(name="Superman", secret_name="Clark Kent", age=30)
hero = hero_service.create_hero(hero_data)
print(f"Created hero: {hero.name}")
Usage with FastAPI
from fastapi import FastAPI
from hero_mvc_lib import get_hero_router, init_hero_db
app = FastAPI()
# Initialize database
init_hero_db()
# Include hero routes
app.include_router(get_hero_router(), prefix="/api")
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hero_mvc_lib-0.1.0.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hero_mvc_lib-0.1.0.tar.gz.
File metadata
- Download URL: hero_mvc_lib-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f355d5b92d51b07b91132c59a2a877d07f6085c71ada5f5ce6978c529b0e0422
|
|
| MD5 |
42e38cc7e9658d0f8e92c970bde86483
|
|
| BLAKE2b-256 |
6bda7f8f49d2ba25679c7044e011bfa3682be03bdcb7d332d5f462bdbf8a7b88
|
File details
Details for the file hero_mvc_lib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hero_mvc_lib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eeca0ee6f0a82f1c4d5fbdf64d321e141d6644dbb5e7772c5b99678750ba86e
|
|
| MD5 |
86272b4972db255ac699cc6e930d8c4e
|
|
| BLAKE2b-256 |
bf902db20427339d4b0ebd3f8d783fc8c80317a52debb173aafdc51a49fbd330
|