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.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-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nanoSQLite-0.1.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.tar.gz
Algorithm Hash digest
SHA256 7c1c54bd638869126bcb2a5e8e1bbf967cb8dea140a82db7b88ac85183daa7e8
MD5 efadaea4ab0af8faa4ed1106da6289df
BLAKE2b-256 49c6d7ce1fb4621c0b84349542230a421a270da0650cbf2d67b387f6d51bded3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nanoSQLite-0.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

Hashes for nanoSQLite-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c80c651c2943f1913714c4abc297e5bf2300287a77e4269e42d83f2313d6ee65
MD5 f2f0b08e6376f777acf5e54d69568146
BLAKE2b-256 28eeccfb3c0377235dc720fb45249c4d914f2b24c6dc29021f8153bc8f32b1bc

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