ardilla
Ardilla (pronounced ahr-dee-yah) means "SQuirreL" in spanish.
This library aims to be a simple way to add an SQLite database and basic C.R.U.D. methods to python applications. It uses pydantic for data validation and supports a sync engine as well as an async (aiosqlite) version.
Links
Find Ardilla's source code here
Documentation can be accessed here
Who and what is this for
This library is well suited for developers seeking to incorporate SQLite into their python applications to use simple C.R.U.D. methods. It excels in its simplicity and ease of implementation while it may not be suitable for those who require more complex querying, intricate relationships or top performance.
For developers who desire more advanced features, there are other libraries available, such as tortoise-orm, sqlalchemy, pony or peewee.
Supported CRUD methods
crud.insertInserts a record, rises errors if there's a conflictcrud.insert_or_ignoreInserts a record or silently ignores if it already existscrud.save_oneupserts an objectcrud.save_manyupserts many objectscrud.get_allequivalent toSELECT * FROM tablenamecrud.get_manyreturns all the objects that meet criteriacrud.get_or_createreturns an tuple of the object and a bool, True if the object was newly createdcrud.get_or_noneReturns the first object meeting criteria if anycrud.delete_oneDeletes an objectcrud.delete_manyDeletes many objects
Examples
- A simple FastAPI application
- A reputation based discord bot
- basic usage
- basic usage with foreign keys