Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanoSQLite-0.1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanoSQLite-0.1.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file nanoSQLite-0.1.2.tar.gz.

File metadata

  • Download URL: nanoSQLite-0.1.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for nanoSQLite-0.1.2.tar.gz
Algorithm Hash digest
SHA256 289a9b1dc4446665c5e6e558d90457f8e6b928dbb3a3a437de5a100b99189408
MD5 c09210319a4c706b1b15b280c6220628
BLAKE2b-256 adfbda47fdd6e21cb36a92ae4bc759beb7b4e9ca24ebc97adb295781986658d7

See more details on using hashes here.

File details

Details for the file nanoSQLite-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: nanoSQLite-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for nanoSQLite-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f8c5e81eaf86d82d3333fa51a6f0d718b4c1b79219673f74cdc2dd866c795995
MD5 1e316c86c5b082039aded54353eb53bf
BLAKE2b-256 1fb545706e551cb5c30ab8e9187529dd1eac8886e331c6cf1cf22cda2307c973

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page