Skip to main content

SQLite3 simple ORM

Project description

sqlitesimpleorm

A lightweight SQLite ORM for Python.
Provides a simple interface to define tables, columns, relationships, and perform queries with filtering and joins.

Features

  • Define tables with different column types (Integer, Text, Boolean, DateTime, ForeignKey).
  • Automatic table creation and migration.
  • Basic ORM-style query API (all, one, insert, delete).
  • Filtering with lookups (exact, contains, startswith, endswith, icontains, null, notnull).
  • Support for Q objects to combine complex filters with AND / OR.
  • Support for table joins.

Installation

pip install sqlitesimpleorm

Quick Example

from sqliteorm import SQLiteORM
from sqliteorm.models.table import Table
from sqliteorm.models.fields import IntegerColumn, TextColumn

# Initialize DB
db = SQLiteORM("example.db")

# Define a model
class User(Table):
    id = IntegerColumn("id")
    name = TextColumn("name")

    def __init__(self, db):
        super().__init__(db, "users")

# Register table
users = User(db)
db.add_table(users)

# Insert row
users.insert(name="Alice")

# Query rows
print(users.all())

License

MIT License. See LICENSE for details.

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

sqlitesimpleorm-0.2.4.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlitesimpleorm-0.2.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file sqlitesimpleorm-0.2.4.tar.gz.

File metadata

  • Download URL: sqlitesimpleorm-0.2.4.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sqlitesimpleorm-0.2.4.tar.gz
Algorithm Hash digest
SHA256 9c34e6863482bfb1e4f015ae6b105c614bf9a2d29821f3fee71fd1c10aa8de2a
MD5 f0d7a6c433129b13a8e977d2113ad3a8
BLAKE2b-256 84eaf429787151497082d52508d18aa9e1fcbabc1257b40483d86c76a896a5a5

See more details on using hashes here.

File details

Details for the file sqlitesimpleorm-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlitesimpleorm-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f0433cbcfb514fce6e09ddb2517830b182c5b78885d2e4dbcaca0d6fb8bd0f86
MD5 0f0ced4c9832d42c9fed5fce6e34a081
BLAKE2b-256 2bfe28698c7233b94f445189a344bd0fb53e5bb939eaa339ee03263c502c3815

See more details on using hashes here.

Supported by

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