Skip to main content

Inspira is a lightweight framework for building asynchronous web applications.

Project description

Inspira

License

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

Install Inspira

$ pip install inspira

Generating an App

To generate a new app for your project, run the following command:

$ inspira init

Generated Directory Structure

After running the init command, the directory structure of your project should look like the following:

├── main.py
├── src
│   ├── __init__.py
│   ├── controller
│      └── __init__.py
│   ├── model
│      └── __init__.py
│   ├── repository
│      └── __init__.py
│   └── service
│       └── __init__.py
└── tests
    └── __init__.py

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()

Generating Controller

To generate necessary controller for your project, run the following command:

$ inspira new controller order

Generating Repository

To generate repository file, run the following command:

$ inspira new repository order

Generating Service

To generate service file, run the following command:

$ inspira new service order

Generating Model

To generate model file, run the following command:

$ inspira new model order

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inspira-0.17.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

inspira-0.17.0-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

Details for the file inspira-0.17.0.tar.gz.

File metadata

  • Download URL: inspira-0.17.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for inspira-0.17.0.tar.gz
Algorithm Hash digest
SHA256 9f593b87d5ec4bebecf59326f04dc4c1c1d36ef1a223b4addfdd205db8b53866
MD5 10a760e5fbc8ded30212401a1b80c66e
BLAKE2b-256 3e68792b2f3155c4af4978b7d4eabe9649d8b1ae11e23ffff5145057048b97ba

See more details on using hashes here.

File details

Details for the file inspira-0.17.0-py3-none-any.whl.

File metadata

  • Download URL: inspira-0.17.0-py3-none-any.whl
  • Upload date:
  • Size: 36.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for inspira-0.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a874e12774c8398e0b26f610b8abcd68012011c912341ebd05733b8b140cfc68
MD5 92069c1a016f978e9e433d2ebdf9ca29
BLAKE2b-256 c6c4321c39233ecb32c1ae4fd32cb6716f949e797fc5f75fc71d80b58d514c2f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page