Welcome to ORMStorm
ORMStorm is a small library for easy work with databases.
The key features are:
- Simplicity: The library is very simple, and it won't take long to learn it.
- Coding speed: Integrating the library into your projects won't take long.
- Dynamic: Unlike others, this library will allow you to very quickly create new tables and add databases to them.
Installing
pip install ormstorm
Usage
Using standard tables
from ormstorm import Table, Types, Column, create_session
class ExampleTable(Table):
__tablename__ = "example"
id = Column(Types.INTEGER, primary_key=True, autoincrement=True)
text = Column(Types.STRING)
LocalSession = create_session("example.sqlite3", [ExampleTable])
with LocalSession() as session:
session.insert(ExampleTable(text="Hello, world!"))
Using a dynamic table
from ormstorm import DynamicTable, Types, Column, create_session
LocalSession = create_session("example.sqlite3", [])
with LocalSession() as session:
NewTable = DynamicTable(
"new_table", {"id": Column(Types.INTEGER, primary_key=True, autoincrement=True), "text": Column(Types.STRING)}
)
session.create(NewTable)
session.insert(NewTable(text="Easy use of dynamic tables!"))
Magic filters
Magic filters is a special system that allows you to quickly write conditions for sql queries in the usual python style!
Magic filters currently support the following operators: =, !=, >=, >, <=, <, &, |, ~
Simple use of magic filters:
from ormstorm import Table, Types, Column, create_session
class ExampleTable(Table):
__tablename__ = "example"
id = Column(Types.INTEGER, primary_key=True, autoincrement=True)
text = Column(Types.STRING)
LocalSession = create_session("example.sqlite3", [ExampleTable])
with LocalSession() as session:
result = session.select(
(ExampleTable.text == "Hello") | ((ExampleTable.id > 5) & (ExampleTable.id < 15))
)
Instead of the usual and and or, & and | are used, respectively. Also, ~ is used instead of the or keyword.
It is also worth noting that some expressions should be wrapped in parentheses to avoid unexpected errors.
To select all data from a table, simply specify its class.
result = session.select(ExampleTable)
Documentation
At the moment, all documentation is located in the library itself. Each function and class has good documentation to understand what the function is for.
Note
This library is strictly not recommended for use in large projects because of the small functionality!
Metadata
Release files for ormstorm 0.0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ormstorm-0.0.3.0.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ormstorm-0.0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.9 kB
Release files / ormstorm-0.0.3.0.tar.gz
| Download URL | ormstorm-0.0.3.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79f94cc916b97c2e2400baec021b9faa30e2e542a8d80c864be7cb29c1d24246
|
|
BLAKE2b-256 checksum How to use checksums |
0faee4b297ed30b2f213b34da8fb7d4b662b767aacc58ae5706687f5d55acbfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.0
|
Release files / ormstorm-0.0.3.0-py3-none-any.whl
| Download URL | ormstorm-0.0.3.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b95d2faf99b3a4dccbca7b048271ab64c37a149bb09aee7da854632eb11163a3
|
|
BLAKE2b-256 checksum How to use checksums |
68f1bf5b781449fca0835032d5fcf3441399f8fd56cb5024648f82dbbe98123a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.0
|