
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
MiniSLite is a secure and mini SQLite ORM module.
The script is available on PyPI. To install with pip:
pip install minislite
git clone https://github.com/ahmetkotan/minislite
cd minislite
python setup.py build
python setup.py install
from minislite import MiniSLiteModel
from minislite import DatabaseField
class Person(MiniSLiteModel):
# Only field_type is required
name = DatabaseField(field_type=str, unique=False, not_null=True, auto_increment=False)
last_name = DatabaseField(field_type=str, default="mini")
age = DatabaseField(field_type=int, not_null=False)
# Optionals
table_name = "person"
unique_together = ["name", "last_name"]
from minislite import MiniSLiteDb
database = MiniSLiteDb("minis.db")
database.add_model(Person)
person1 = Person(name="mini", last_name="slite") # not created
person1.age = 1
person1.save() # created
person2 = Person.objects.create(name="mini2", last_name="slite") # created
person2.age = 2
person2.save() # updated
person3 = Person.objects.create(name="mini3", last_name="slite", age=10) # created
person4 = Person.objects.create(name="mini4", last_name="slite", age=20) # created
Person.objects.update(last_name="slite-updated")
first_person = Person.objects.first()
last_person = Person.objects.last()
person_objects = Person.objects.filter(last_name="slite-updated")
# or
# person_objects = Person.objects.all()
for person in person_objects:
print(person.name)
person_obj = Person.objects.get(name="mini")
person_obj.delete()
Special Filters
gt
, gte
, lt
, lte
for integer, bool and float fieldscontains
, startswith
, endswith
for string fieldsolder_than_10 = Person.objects.filter(age__gt=10)[0]
print(older_than_10.name) # mini4
Person.objects.delete(i_am_sure=True)
database.clean_tables()
database.drop_model(Person)
from minislite.exceptions import RecordNotFoundError, AlreadyExistsError, DatabaseNotFoundError, \
AreYouSureError, WhereOperatorError
objects.get()
and that is not found in databaseunique=True
fields and unique_together
fields.MiniSLiteDb()
objects.delete()
) in model. Add i_am_sure=True
arguments.See; CONTRIBUTING.md
FAQs
Mini and Secure SQLite ORM
We found that minislite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.