Skip to content
This repository was archived by the owner on Feb 9, 2025. It is now read-only.

esoadamo/Python-SQLiteDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLiteDB

⚠️⚠️ Project was moved to sqlidictature repo. This repo is kept for old projects with hardcoded path. ⚠️⚠️

A wrapper for Python's inbuilt SQLite with multithreading support.

Installation

pip install git+https://github.com/esoadamo/Python-SQLiteDB.git

Database usage

from sqlitedb import SQLiteDB
db = SQLiteDB('my.sqlitedb')
for record in db.execute("SELECT * FROM table"):
    print(record)

IndexedDB usage

This package also includes a class that allows you to use your SQLite db as a Python dictionary:

from sqlitedb import IndexedDBManager

# will use/create the db file
dictionary = IndexedDBManager('my.sqlitedb')

# will create a table db_test and there a row called foo with value bar
dictionary['test']['foo'] = 'bar'

# also support anything that can be jsonized
dictionary['test']['list'] = ['1', 2, True]
print(dictionary['test']['list'])  # prints ['1', 2, True]

# or anything, really (that can be serialized with pickle)
from threading import Thread
dictionary['test']['thread'] = Thread
print(dictionary['test']['thread'])  # prints <class 'threading.Thread'>

# and deleting
del dictionary['test']['list']  # deletes the record
del dictionary['test']  # drops whole table

About

A wrapper for Python's inbuilt SQLite with multithreading support.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages