Metadata-Version: 2.1
Name: inspira
Version: 0.7.2
Summary: Inspira is a lightweight framework for building asynchronous web applications.
Author-email: Hayri Cicek <hayri@inspiraframework.com>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development
Requires-Dist: Jinja2>=3.1.2
Requires-Dist: click>=8.1.7
Requires-Dist: uvicorn
Requires-Dist: httpx
Requires-Dist: sqlalchemy
Requires-Dist: bcrypt
Requires-Dist: inflect
Requires-Dist: sqlalchemy-utils
Requires-Dist: websockets
Requires-Dist: PyJWT
Project-URL: Homepage, https://inspiraframework.com
Project-URL: Repository, https://github.com/cicekhayri/inspira

# Inspira

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](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

```bash
# Create a new directory for your project
mkdir myproject
cd myproject
```

**Create and activate a virtual environment**

```bash
python -m venv venv
source venv/bin/activate   # On Windows, use `venv\Scripts\activate`
```

**Install Inspira**

```bash
pip install inspira
```

## Generating an App

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

```bash
inspira init
```

## Generate Database file

Use the following command to generate a database file:

```bash
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:

```python
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:

```bash
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:

```bash
├── 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:

```bash
uvicorn main:app --reload
```

## Links
Documentation: https://www.inspiraframework.com/


## License

This project is licensed under the terms of the MIT license.
