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
Qobjects to combine complex filters withAND/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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c34e6863482bfb1e4f015ae6b105c614bf9a2d29821f3fee71fd1c10aa8de2a
|
|
| MD5 |
f0d7a6c433129b13a8e977d2113ad3a8
|
|
| BLAKE2b-256 |
84eaf429787151497082d52508d18aa9e1fcbabc1257b40483d86c76a896a5a5
|
File details
Details for the file sqlitesimpleorm-0.2.4-py3-none-any.whl.
File metadata
- Download URL: sqlitesimpleorm-0.2.4-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0433cbcfb514fce6e09ddb2517830b182c5b78885d2e4dbcaca0d6fb8bd0f86
|
|
| MD5 |
0f0ced4c9832d42c9fed5fce6e34a081
|
|
| BLAKE2b-256 |
2bfe28698c7233b94f445189a344bd0fb53e5bb939eaa339ee03263c502c3815
|