Skip to main content

an ORM library

Project description

sillyORM

License: LGPL v3 CI: Python test CI: Python mypy PyPI

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.

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.3.0.tar.gz (19.4 kB view hashes)

Uploaded Source

Built Distribution

sillyORM-0.3.0-py3-none-any.whl (22.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page