an ORM library
Project description
sillyORM
simple ORM library written in Python
Currently supports
- SQLite
- PostgreSQL
[!CAUTION] :warning: sillyORM is not ready for use in production environments. It is still alpha software and under development. The API is unstable, and each release may introduce breaking changes. There may even be security vulnerabilities present. If you use it anyway, make sure to pin the version!
Projects using sillyORM
- theverygaming/silly
- iLollek/Figuyo-Public - An app for keeping track of Anime Figures
Installation
pip install sillyorm
Usage
import sillyorm
from sillyorm.dbms import sqlite
# define a model, a model abstracts a table in the database
class Example(sillyorm.model.Model):
_name = "example" # database table name & name in environment
# fields
name = sillyorm.fields.String(length=255)
# Create the environment
env = sillyorm.Environment(
sqlite.SQLiteConnection("test.db").cursor()
)
# register the model in the environment
env.register_model(Example)
# start using the model
record = env["example"].create({"name": "Hello world!"})
print(record.name)
Documentation
Read the docs here
[!NOTE] The docs are always for the newest version. If you need docs for another version you must build them yourself
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sillyorm-0.5.0.tar.gz
(19.6 kB
view hashes)
Built Distribution
sillyORM-0.5.0-py3-none-any.whl
(22.7 kB
view hashes)