Ezstorge
A python ORM (Object-Relational Mapping) that allow to use a simple class syntax to interact with a database.
Why Ezstorge?
I needed to use a simple ORM to interact with a database, but I found that most of the existing ORMs are either too complex for a simple use case, and the migration tools are not always easy to setup and use.
-
Simple:
- The type of the field is defined by the type hint
- Has a simple query syntax similar to PonyORM
-
Flexible:
- Automatic table creation
- Automatic table update (add and remove fields)
- No need to use extra migration tools
-
Beautiful:
- Designed to be beautiful and easy to read.
- Fully typed, for better IDE support
Example
import pandas as pd
import ezstorge as ez
db = ez.Sqlite("example.db")
@db.useTable("cars")
class Car(ez.Table):
model: str # Required string field
price: float # Required float field
miles: int = 0 # Default value if not provided
# Create, update, delete table
db.createTable(Car)
db.createTables()
db.updateTable(Car)
db.updateTables()
db.deleteTable(Car)
db.deleteTables()
car = Car(model="Tesla", price=100)
car.save() # Save the car
db.commit() # Commit the change
cars = Car.where() # Get all cars
print(cars)
# Use lambda to filter
cars = Car.where(lambda: Car.price > 20)
print(cars)
# Create a dataframe from the table
df = pd.DataFrame(users)
print(df)
Types
- int
- float
- str
- bool
- datetime
- date
- time
- timedelta
- list
- dict
- set
- tuple
- enum
- json
- bytes
- bytearray
- uuid
- Decimal
- Any
- Union
Providers
- Excel
- Sqlite
- Microsoft Access
- MySQL
- PostgreSQL
Metadata
Release files for ezstorages 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ezstorages-0.0.12.tar.gz | 10.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ezstorages-0.0.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / ezstorages-0.0.12.tar.gz
| Download URL | ezstorages-0.0.12.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10812b603a3fcb887223057f594973bbce0b0e92b591ab71c5ad497b675a5432
|
|
BLAKE2b-256 checksum How to use checksums |
b5dce1bf2697e963caf1f45bf54a3f60526e9cc3869d413e611b65f4ab96d8b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / ezstorages-0.0.12-py3-none-any.whl
| Download URL | ezstorages-0.0.12-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6364e74573356da961aa0bf65fd8b2e7b88781cbd553331da12baf7b9d4dbe60
|
|
BLAKE2b-256 checksum How to use checksums |
1271d1cd3e03cd67199cbff6cf09fa3c9f3ea9f761e9d2a80ed5f60da6ef731a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for ezstorages 0.0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.