Metadata-Version: 2.4
Name: sqlitesimpleorm
Version: 0.2.4
Summary: SQLite3 simple ORM
Author-email: MistakeTZ <mistaketz@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Browser Use Inc.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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
```bash
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](LICENSE) for details.
