Inspira is a lightweight framework for building asynchronous web applications.
Project description
Inspira
Inspira is a lightweight framework for building asynchronous web applications.
Quick Start
Prerequisites
Make sure you have Python and pip
installed on your system.
Create a Python Virtual Environment
# Create a new directory for your project
mkdir myproject
cd myproject
Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
Install Inspira
pip install inspira
Generating an App
To generate a new app for your project, run the following command:
inspira init
Generate Database file
Use the following command to generate a database file:
inspira new database --name mydb --type sqlite
This command will create a new database file named mydb
with SQLite
as the database type.
The generated database file (database.py
) will typically contain initial configurations and may look like this:
from sqlalchemy import create_engine
from sqlalchemy.orm import declarative_base, scoped_session, sessionmaker
engine = create_engine("sqlite:///mydb.db")
db_session = scoped_session(
sessionmaker(autocommit=False, autoflush=False, bind=engine)
)
Base = declarative_base()
Base.query = db_session.query_property()
def init_db():
Base.metadata.create_all(bind=engine)
Generating Modules
To generate necessary resources for your project, run the following command:
inspira new module orders
Generated Directory Structure
After running the command to generate a new module (inspira new module orders
), the directory structure of your project should look like the following:
├── main.py
├── database.py
└── src
└── orders
├── __init__.py
├── order.py
├── order_controller.py
└── order_repository.py
└── order_service.py
Starting the Server
After generating your app and setting up the necessary resources, start the server with the following command:
uvicorn main:app --reload
Links
Documentation: https://www.inspiraframework.com/
License
This project is licensed under the terms of the 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
Built Distribution
File details
Details for the file inspira-0.11.0.tar.gz
.
File metadata
- Download URL: inspira-0.11.0.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c650ba70759ce23990e91e8a599b381680e2c49faba593a21365d60853a457 |
|
MD5 | f2aa7e38e7dfd209243cffd75da81803 |
|
BLAKE2b-256 | 531ff98e847246aa7e9ea97017fa941816ee7bf0f3ee69820b89ce144fc8f26e |
File details
Details for the file inspira-0.11.0-py3-none-any.whl
.
File metadata
- Download URL: inspira-0.11.0-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 843c93fff0f3c7c6a3959239d9971acafe5ee29477fdae3920679280c22ba1c6 |
|
MD5 | 2b970d6f61f12b839d0185938ea99938 |
|
BLAKE2b-256 | 1a8d07fb95c3d610cb84dec98fb9f16fae0d27f18369daa7cb31e4ae0a2991c2 |