{"id":18438665,"url":"https://github.com/seapagan/sqliter-py","last_synced_at":"2026-03-11T22:03:46.117Z","repository":{"id":256794192,"uuid":"853553633","full_name":"seapagan/sqliter-py","owner":"seapagan","description":"A lightweight, easy to use and SQL-free, Non-Async Object-Relational Mapping (ORM) library for SQLite databases in Python. Designed to be used for local application storage rather than a Webapp","archived":false,"fork":false,"pushed_at":"2026-02-21T07:41:18.000Z","size":5649,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-21T14:14:11.280Z","etag":null,"topics":["mini-orm","orm","orm-library","pydantic","python","sqlite3"],"latest_commit_sha":null,"homepage":"http://sqliter.grantramsay.dev/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seapagan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-06T22:33:04.000Z","updated_at":"2026-02-21T07:41:20.000Z","dependencies_parsed_at":"2024-11-06T06:24:09.113Z","dependency_job_id":"1dac9299-4491-4d56-9592-4fb2e4b44c24","html_url":"https://github.com/seapagan/sqliter-py","commit_stats":null,"previous_names":["seapagan/sqliter-py"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/seapagan/sqliter-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Fsqliter-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Fsqliter-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Fsqliter-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Fsqliter-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seapagan","download_url":"https://codeload.github.com/seapagan/sqliter-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Fsqliter-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30404118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T21:51:19.558Z","status":"ssl_error","status_checked_at":"2026-03-11T21:50:57.892Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mini-orm","orm","orm-library","pydantic","python","sqlite3"],"created_at":"2024-11-06T06:21:03.944Z","updated_at":"2026-03-11T22:03:46.106Z","avatar_url":"https://github.com/seapagan.png","language":"Python","readme":"# SQLiter \u003c!-- omit in toc --\u003e\n\n[![PyPI version](https://badge.fury.io/py/sqliter-py.svg)](https://badge.fury.io/py/sqliter-py)\n[![Test Suite](https://github.com/seapagan/sqliter-py/actions/workflows/testing.yml/badge.svg)](https://github.com/seapagan/sqliter-py/actions/workflows/testing.yml)\n[![Linting](https://github.com/seapagan/sqliter-py/actions/workflows/linting.yml/badge.svg)](https://github.com/seapagan/sqliter-py/actions/workflows/linting.yml)\n[![Type Checking](https://github.com/seapagan/sqliter-py/actions/workflows/mypy.yml/badge.svg)](https://github.com/seapagan/sqliter-py/actions/workflows/mypy.yml)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sqliter-py)\n\nSQLiter is a lightweight Object-Relational Mapping (ORM) library for SQLite\ndatabases in Python. It provides a simplified interface for interacting with\nSQLite databases using Pydantic models. The only external run-time dependency\nis Pydantic itself.\n\nIt does not aim to be a full-fledged ORM like SQLAlchemy, but rather a simple\nand easy-to-use library for basic database operations, especially for small\nprojects. It is NOT asynchronous (at this time, though that is planned).\n\nThe ideal use case is more for Python CLI tools that need to store data in a\ndatabase-like format without needing to learn SQL or use a full ORM.\n\nFull documentation is available on the [Website](https://sqliter.grantramsay.dev)\n\n\u003e [!CAUTION]\n\u003e\n\u003e This project is still in development and is lacking some planned\n\u003e functionality. Please use with caution - Classes and methods may change until\n\u003e a stable release is made. I'll try to keep this to an absolute minimum and the\n\u003e releases and documentation will be very clear about any breaking changes.\n\u003e\n\u003e See the [TODO](TODO.md) for planned features and improvements.\n\n- [Features](#features)\n- [Installation](#installation)\n  - [Optional Dependencies](#optional-dependencies)\n- [Quick Start](#quick-start)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- Table creation based on Pydantic models\n- Supports `date` and `datetime` fields\n- Support for complex data types (`list`, `dict`, `set`, `tuple`) stored as\n  BLOBs\n- Automatic primary key generation\n- User defined indexes on any field\n- Set any field as UNIQUE\n- CRUD operations (Create, Read, Update, Delete)\n- Bulk Create and Update methods to reduce the number of queries required for\n  multiple operations.\n- Foreign key relationships with referential integrity and CASCADE actions\n- ORM mode with lazy loading, reverse relationships, many-to-many support, and\n  eager loading\n- Chained Query building with filtering, ordering, and pagination\n- Projection and aggregation queries with grouping, aggregate helpers, and\n  dictionary-based results\n- Transaction support\n- Optional query result caching with LRU eviction, TTL, and memory limits\n- Optional raw SQL debug logging\n- Custom exceptions for better error handling\n- Full type hinting and type checking\n- Detailed documentation and examples\n- Interactive TUI demo for exploring features\n- No external dependencies other than Pydantic\n- Full test coverage\n\n## Installation\n\nYou can install SQLiter using whichever method you prefer or is compatible with\nyour project setup.\n\nWith `uv` which is rapidly becoming my favorite tool for managing projects and\nvirtual environments (`uv` is used for developing this project and in the CI):\n\n```bash\nuv add sqliter-py\n```\n\nWith `Poetry`:\n\n```bash\npoetry add sqliter-py\n```\n\nOr with `pip`:\n\n```bash\npip install sqliter-py\n```\n\n### Optional Dependencies\n\nCurrently by default, the only external dependency is Pydantic. However, there\nare some optional dependencies that can be installed to enable additional\nfeatures:\n\n- `demo`: Installs the Textual TUI framework for the interactive demo\n- `extras`: Installs Inflect for better pluralization of table names\n- `full`: Installs all optional dependencies (Textual and Inflect)\n\nSee [Installing Optional\nDependencies](https://sqliter.grantramsay.dev/installation#optional-dependencies)\nfor more information.\n\n## Quick Start\n\nHere's a quick example of how to use SQLiter:\n\n```python\nfrom sqliter import SqliterDB\nfrom sqliter.model import BaseDBModel\n\n# Define your model\nclass User(BaseDBModel):\n    name: str\n    age: int\n\n# Create a database connection\ndb = SqliterDB(\"example.db\")\n\n# Create the table\ndb.create_table(User)\n\n# Insert a record\nuser = User(name=\"John Doe\", age=30)\nnew_user = db.insert(user)\n\n# Query records\nresults = db.select(User).filter(name=\"John Doe\").fetch_all()\nfor user in results:\n    print(f\"User: {user.name}, Age: {user.age}\")\n\n# Update a record\nnew_user.age = 31\ndb.update(new_user)\n\n# Delete a record by primary key\ndb.delete(User, new_user.pk)\n\n# Delete all records returned from a query:\ndelete_count = db.select(User).filter(age__gt=30).delete()\n```\n\nSee the [Guide](https://sqliter.grantramsay.dev/guide/guide/) section of the\ndocumentation for more detailed information on how to use SQLiter, and advanced\nfeatures.\n\nYou can also run the interactive TUI demo to explore SQLiter features hands-on:\n\n```bash\n# Install the demo\nuv add sqliter-py[demo]\n\n# Run the demo\nsqliter-demo\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\nSee the [CONTRIBUTING](CONTRIBUTING.md) guide for more information.\n\nPlease note that this project is released with a Contributor Code of Conduct,\nwhich you can read in the [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) file.\n\n## License\n\nThis project is licensed under the MIT License.\n\n```pre\nCopyright (c) 2024-2026 Grant Ramsay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE\nOR OTHER DEALINGS IN THE SOFTWARE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseapagan%2Fsqliter-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseapagan%2Fsqliter-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseapagan%2Fsqliter-py/lists"}