Skip to main content

René's minimal wrapper around Python's sqlite3 module

Project description

RenesSQLiteHelper

René's minimal wrapper around Python's built-in sqlite3 module.

Installation

pip install RenesSQLiteHelper

Usage

Create a database

The database file (Here: some-data) is stored by default under ~/.local/share/sqlite-dbs.

from RenesSQLiteHelper import open_db, bulk_load
con = open_db('some-data', deleteIfExists = True)

con.execute('''
create table tab (
   id  integer primary key,
   val text
)
''')

Use the database

Bulk load

con = open_db('some-data')

with bulk_load(con) as cur:
    cur.execute('insert into tab values (?, ?)', (42, 'hello world'))

Selecting etc

for rec in con.execute('select * from tab'):
    print(f'{rec['id']}: {rec['val']}')

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

renessqlitehelper-0.2.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

renessqlitehelper-0.2.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file renessqlitehelper-0.2.0.tar.gz.

File metadata

  • Download URL: renessqlitehelper-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for renessqlitehelper-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6ea970548811ae8b5368afafd2031f1d802215be4817d628b738fc246598268f
MD5 a921d10749f51d1be4076767ea87dbd9
BLAKE2b-256 68b4b5c07a68fc177f154d6db637eed567a7700997a3913764861ef61490a3d9

See more details on using hashes here.

File details

Details for the file renessqlitehelper-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for renessqlitehelper-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcbe92b06f5e9c90ca5a08c2fbc26e74c2bc0e79840e58d3578b5ee2d553cac1
MD5 0dc4183b9d5d467f948c55bdcc2cf889
BLAKE2b-256 f7ce52a36104d65d41f01c8ead53b4523de7a167bdbfcc4176ea70a11c47580c

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