# 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
```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
```
**Install Inspira**
```bash
$ pip install inspira
```
## Generating an App
To generate a new app for your project, run the following command:
```bash
$ inspira init
```
## Generated Directory Structure
After running the `init` command, the directory structure of your project should look like the following:
```bash
├── 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:
```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()
```
## Generating Controller
To generate necessary controller for your project, run the following command:
```bash
$ inspira new controller orders
```
## Generating Repository
To generate repository file, run the following command:
```bash
$ inspira new repository orders
```
## Generating Service
To generate service file, run the following command:
```bash
$ inspira new service orders
```
## Generating Model
To generate model file, run the following command:
```bash
$ inspira new model order
```
## 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.
Raw data
{
"_id": null,
"home_page": "",
"name": "inspira",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "",
"author_email": "Hayri Cicek <hayri@inspiraframework.com>",
"download_url": "https://files.pythonhosted.org/packages/11/95/f17e25e37dd295a681928187894e7c0d7abba1977b947eea0e95ca90f3a7/inspira-0.16.0.tar.gz",
"platform": null,
"description": "# Inspira\n\n[](LICENSE)\n\nInspira is a lightweight framework for building asynchronous web applications.\n\n## Quick Start\n\n### Prerequisites\n\nMake sure you have Python and `pip` installed on your system.\n\n### Create a Python Virtual Environment\n\n```bash\n# Create a new directory for your project\n$ mkdir myproject\n$ cd myproject\n```\n\n**Create and activate a virtual environment**\n\n```bash\n$ python -m venv venv\n$ source venv/bin/activate\n```\n\n**Install Inspira**\n\n```bash\n$ pip install inspira\n```\n\n## Generating an App\n\nTo generate a new app for your project, run the following command:\n\n```bash\n$ inspira init\n```\n\n## Generated Directory Structure\n\nAfter running the `init` command, the directory structure of your project should look like the following:\n\n```bash\n\u251c\u2500\u2500 main.py\n\u251c\u2500\u2500 src\n\u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 controller\n\u2502 \u2502 \u2514\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 model\n\u2502 \u2502 \u2514\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 repository\n\u2502 \u2502 \u2514\u2500\u2500 __init__.py\n\u2502 \u2514\u2500\u2500 service\n\u2502 \u2514\u2500\u2500 __init__.py\n\u2514\u2500\u2500 tests\n \u2514\u2500\u2500 __init__.py\n```\n\n## Generate Database file\n\nUse the following command to generate a database file:\n\n```bash\n$ inspira new database --name mydb --type sqlite\n```\n\nThis command will create a new database file named `mydb` with `SQLite` as the database type.\n\nThe generated database file (`database.py`) will typically contain initial configurations and may look like this:\n\n```python\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import declarative_base, scoped_session, sessionmaker\n\nengine = create_engine(\"sqlite:///mydb.db\")\ndb_session = scoped_session(\n sessionmaker(autocommit=False, autoflush=False, bind=engine)\n)\nBase = declarative_base()\nBase.query = db_session.query_property()\n```\n\n## Generating Controller\n\nTo generate necessary controller for your project, run the following command:\n\n```bash\n$ inspira new controller orders\n```\n\n## Generating Repository\n\nTo generate repository file, run the following command:\n\n```bash\n$ inspira new repository orders\n```\n\n## Generating Service\n\nTo generate service file, run the following command:\n\n```bash\n$ inspira new service orders\n```\n\n## Generating Model\n\nTo generate model file, run the following command:\n\n```bash\n$ inspira new model order\n```\n\n## Starting the Server\n\nAfter generating your app and setting up the necessary resources, start the server with the following command:\n\n```bash\n$ uvicorn main:app --reload\n```\n\n## Links\nDocumentation: https://www.inspiraframework.com/\n\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n",
"bugtrack_url": null,
"license": "",
"summary": "Inspira is a lightweight framework for building asynchronous web applications.",
"version": "0.16.0",
"project_urls": {
"Homepage": "https://inspiraframework.com",
"Repository": "https://github.com/cicekhayri/inspira"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "09de76e52d7b9caac3d5ece7ef704796a778c8000abb5a2747dcaaa871db3390",
"md5": "ec9dac8d67283bea8c4635445035ae60",
"sha256": "3fecfa7305b9b5a8c13b2f7ee6e4637fb9f769a66fe7f3b82243139a754ecaad"
},
"downloads": -1,
"filename": "inspira-0.16.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ec9dac8d67283bea8c4635445035ae60",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 37023,
"upload_time": "2024-01-19T13:33:02",
"upload_time_iso_8601": "2024-01-19T13:33:02.097400Z",
"url": "https://files.pythonhosted.org/packages/09/de/76e52d7b9caac3d5ece7ef704796a778c8000abb5a2747dcaaa871db3390/inspira-0.16.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1195f17e25e37dd295a681928187894e7c0d7abba1977b947eea0e95ca90f3a7",
"md5": "e6227dbc586a2d5fb450258f21d14b1d",
"sha256": "f7c8460104601b58e56f61128a8e90c22055fa5cf91c7403740799bbfe5b1ed1"
},
"downloads": -1,
"filename": "inspira-0.16.0.tar.gz",
"has_sig": false,
"md5_digest": "e6227dbc586a2d5fb450258f21d14b1d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 22240,
"upload_time": "2024-01-19T13:33:03",
"upload_time_iso_8601": "2024-01-19T13:33:03.877763Z",
"url": "https://files.pythonhosted.org/packages/11/95/f17e25e37dd295a681928187894e7c0d7abba1977b947eea0e95ca90f3a7/inspira-0.16.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-19 13:33:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cicekhayri",
"github_project": "inspira",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "annotated-types",
"specs": [
[
"==",
"0.6.0"
]
]
},
{
"name": "anyio",
"specs": [
[
"==",
"4.1.0"
]
]
},
{
"name": "bcrypt",
"specs": [
[
"==",
"4.1.1"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2023.11.17"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.7"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.14.0"
]
]
},
{
"name": "httpcore",
"specs": [
[
"==",
"1.0.2"
]
]
},
{
"name": "httpx",
"specs": [
[
"==",
"0.25.2"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.6"
]
]
},
{
"name": "inflect",
"specs": [
[
"==",
"7.0.0"
]
]
},
{
"name": "iniconfig",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "itsdangerous",
"specs": [
[
"==",
"2.1.2"
]
]
},
{
"name": "Jinja2",
"specs": [
[
"==",
"3.1.3"
]
]
},
{
"name": "MarkupSafe",
"specs": [
[
"==",
"2.1.3"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"23.2"
]
]
},
{
"name": "pluggy",
"specs": [
[
"==",
"1.3.0"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.5.2"
]
]
},
{
"name": "pydantic_core",
"specs": [
[
"==",
"2.14.5"
]
]
},
{
"name": "PyJWT",
"specs": [
[
"==",
"2.8.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"7.4.3"
]
]
},
{
"name": "pytest-asyncio",
"specs": [
[
"==",
"0.23.2"
]
]
},
{
"name": "pytest-mock",
"specs": [
[
"==",
"3.12.0"
]
]
},
{
"name": "sniffio",
"specs": [
[
"==",
"1.3.0"
]
]
},
{
"name": "SQLAlchemy",
"specs": [
[
"==",
"2.0.25"
]
]
},
{
"name": "SQLAlchemy-Utils",
"specs": [
[
"==",
"0.41.1"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.9.0"
]
]
}
],
"lcname": "inspira"
}