No project description provided
Project description
nanoSQLite
nanoSQLite is a lightweight Python wrapper for SQLite.
With around 200 lines of Python code, it provides an uncomplicated interface for managing SQLite databases.
Despite its simplicity, nanoSQLite offers a robust set of functionalities that enable you to interact with SQLite databases seamlessly, without having to worry about managing cursors and connections manually.
It's designed to make working with SQLite in Python as straightforward and Pythonic as possible.
Features
- Easy Setup: Create connections to SQLite databases with a single function call.
- Simple Query Execution: Execute your SQL commands easily, without having to manage cursors and connections manually.
- Transaction Management: Handle transactions effectively with commit and rollback operations.
- Pythonic Interface: The nanoSQLite API is designed to be as Pythonic as possible, which makes it intuitive and easy to use.
Examples
Create a new SQLite database with a table:
from nanoSQLite import NanoSQLite
db = NanoSQLite("people")
db.create_table(
"friends",
{
"id": "INTEGER PRIMARY KEY AUTOINCREMENT",
"name": "TEXT",
"age": "INTEGER",
"height": "REAL",
"is_cool": "BOOLEAN",
},
)
Insert data:
db.insert("friends", {"name": "John", "age": 20, "height": 1.8, "is_cool": True})
db.insert("friends", {"name": "Jane", "height": 1.7, "is_cool": False})
db.insert("friends", {"name": "Bob"})
Update data:
db.update("friends", {"age": 21, "height": 1.9}, {"name": "John"})
db.update("friends", {"age": 5}, {"name": "Bob"})
Delete data:
db.delete("friends", {"name": "Jane"})
Select data:
db.select("friends", ["name", "age", "height", "is_cool"], {"name": "Bob"})
db.select_first("friends", ["name", "age", "height", "is_cool"], {"name": "Bob"})
db.select_all("friends")
Installation
You can install nanoSQLite from PyPI:
pip install nanoSQLite
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
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 nanoSQLite-0.1.1.tar.gz.
File metadata
- Download URL: nanoSQLite-0.1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2c2fc2574a19eaca97f46f13cabdc7233526acc87a89fa1893a3812340b03a1
|
|
| MD5 |
ba1a13bd84b4485bc4e91868edb124e4
|
|
| BLAKE2b-256 |
5fe3226a8960e97956683cc435f9b2dc84a031d8adbd69d29f4784083259543d
|
File details
Details for the file nanoSQLite-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nanoSQLite-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fc9c4716520c5412c347ac8433cae6752bfe187ccc60a571d69c243ccaf0dd9
|
|
| MD5 |
c89c1369aa3c47ab33a43ed4cb4ecaf6
|
|
| BLAKE2b-256 |
c137e63a1abc4c51d3b9fdf1d00277a1b8b23c2dd6261001f41fb9e367d4b8b8
|