Python Wrapper For sqlite3 and aiosqlite

Overview

dblite

GitHub issues GitHub forks GitHub stars GitHub license PyPI - Python Version

Python wrapper for sqlite3 & aiosql

Table of Contents

Installation

To install dblite, simply:

$ python3 -m pip install -U git+https://github.com/anbuhckr/dblite.git

Getting Started

#! /usr/bin/env python3

import asyncio
from dblite import dbLite, aioDbLite

def main():
    db = dbLite('db1.db')
    db.create('users', id='int', name='text', age='int', pos='text')
    print(db.data('users'))
    db.add('users', id=1, name='Jhon', age=32, pos='Developer')
    db.add('users', id=2, name='Doe', age=30, pos='Manager')
    db.add('users', id=3, name='Rio', age=29, pos='Marketing')
    print(db.data('users'))
    db.remove('users', id=3)
    print(db.data('users'))
    db.update('users', age=31, pos='CEO', id=1)
    print(db.data('users'))
    print(db.select('users', '*', id=1))
    db.close()

async def amain():
    aiodb = await aioDbLite('db2.db')
    await aiodb.create('users', id='int', name='text', age='int', pos='text')
    print(await aiodb.data('users'))
    await aiodb.add('users', id=1, name='Jhon', age=32, pos='Developer')
    await aiodb.add('users', id=2, name='Doe', age=30, pos='Manager')
    await aiodb.add('users', id=3, name='Rio', age=29, pos='Marketing')
    print(await aiodb.data('users'))
    await aiodb.remove('users', id=3)
    print(await aiodb.data('users'))
    await aiodb.update('users', age=31, pos='CEO', id=1)
    print(await aiodb.data('users'))
    print(await aiodb.select('users', '*', id=1))
    await aiodb.close()

main()
asyncio.run(amain())

Result:

# sync
# create table
[]
# add data
[(1, 'Jhon', 32, 'Developer'), (2, 'Doe', 30, 'Manager'), (3, 'Rio', 29, 'Marketing')]
# remove Rio
[(1, 'Jhon', 32, 'Developer'), (2, 'Doe', 30, 'Manager')]
# update Jhone age
[(1, 'Jhon', 31, 'CEO'), (2, 'Doe', 30, 'Manager')]
# show user with id 1
[(1, 'Jhon', 31, 'CEO')]


# async
# create table
[]
# add data
[(1, 'Jhon', 32, 'Developer'), (2, 'Doe', 30, 'Manager'), (3, 'Rio', 29, 'Marketing')]
# remove Rio
[(1, 'Jhon', 32, 'Developer'), (2, 'Doe', 30, 'Manager')]
# update Jhone age
[(1, 'Jhon', 31, 'CEO'), (2, 'Doe', 30, 'Manager')]
# show user with id 1
[(1, 'Jhon', 31, 'CEO')]
You might also like...
python-beryl, a Python driver for BerylDB.
python-beryl, a Python driver for BerylDB.

python-beryl, a Python driver for BerylDB.

Motor - the async Python driver for MongoDB and Tornado or asyncio
Motor - the async Python driver for MongoDB and Tornado or asyncio

Motor Info: Motor is a full-featured, non-blocking MongoDB driver for Python Tornado and asyncio applications. Documentation: Available at motor.readt

Motor - the async Python driver for MongoDB and Tornado or asyncio
Motor - the async Python driver for MongoDB and Tornado or asyncio

Motor Info: Motor is a full-featured, non-blocking MongoDB driver for Python Tornado and asyncio applications. Documentation: Available at motor.readt

A Python library for Cloudant and CouchDB

Cloudant Python Client This is the official Cloudant library for Python. Installation and Usage Getting Started API Reference Related Documentation De

Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc.

Simple DDL Parser Build with ply (lex & yacc in python). A lot of samples in 'tests/. Is it Stable? Yes, library already has about 5000+ usage per day

A simple python package that perform SQL Server Source Control and Auto Deployment.

deploydb Deploy your database objects automatically when the git branch is updated. Production-ready! ⚙️ Easy-to-use 🔨 Customizable 🔧 Installation I

A library for python made by me,to make the use of MySQL easier and more pythonic

my_ezql A library for python made by me,to make the use of MySQL easier and more pythonic This library was made by Tony Hasson , a 25 year old student

Py2neo is a client library and toolkit for working with Neo4j from within Python

Py2neo Py2neo is a client library and toolkit for working with Neo4j from within Python applications. The library supports both Bolt and HTTP and prov

MongoX is an async python ODM for MongoDB which is built on top Motor and Pydantic.
MongoX is an async python ODM for MongoDB which is built on top Motor and Pydantic.

MongoX MongoX is an async python ODM (Object Document Mapper) for MongoDB which is built on top Motor and Pydantic. The main features include: Fully t

Comments
  • Replace method. Custom connect arguments.

    Replace method. Custom connect arguments.

    This fix for not passing isolation_level and check_same_thread arguments to connect function and now it possible to pass custom arguments:

    aiodb = await aioDbLite('custom.db', detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
    

    Also new replace method is very useful in tables where primary key is not autoincremented.

    opened by vasia123 0
Releases(v1.2.0)
Py2neo is a comprehensive toolkit for working with Neo4j from within Python applications or from the command line.

Py2neo v3 Py2neo is a client library and toolkit for working with Neo4j from within Python applications and from the command line. The core library ha

64 Oct 14, 2022
A HugSQL-inspired database library for Python

PugSQL PugSQL is a simple Python interface for using parameterized SQL, in files. See pugsql.org for the documentation. To install: pip install pugsql

Dan McKinley 558 Dec 24, 2022
Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.

Redash is designed to enable anyone, regardless of the level of technical sophistication, to harness the power of data big and small. SQL users levera

Redash 22.4k Dec 30, 2022
A Telegram Bot to manage Redis Database.

A Telegram Bot to manage Redis database. Direct deploy on heroku Manual Deployment python3, git is required Clone repo git clone https://github.com/bu

Amit Sharma 4 Oct 21, 2022
Prometheus instrumentation library for Python applications

Prometheus Python Client The official Python 2 and 3 client for Prometheus. Three Step Demo One: Install the client: pip install prometheus-client Tw

Prometheus 3.2k Jan 07, 2023
A Pythonic, object-oriented interface for working with MongoDB.

PyMODM MongoDB has paused the development of PyMODM. If there are any users who want to take over and maintain this project, or if you just have quest

mongodb 345 Dec 25, 2022
Micro ODM for MongoDB

Beanie - is an asynchronous ODM for MongoDB, based on Motor and Pydantic. It uses an abstraction over Pydantic models and Motor collections to work wi

Roman 993 Jan 03, 2023
A Redis client library for Twisted Python

txRedis Asynchronous Redis client for Twisted Python. Install Install via pip. Usage examples can be found in the examples/ directory of this reposito

Dorian Raymer 127 Oct 23, 2022
MariaDB connector using python and flask

MariaDB connector using python and flask This should work with flask and to be deployed on docker. Setting up stuff 1. Docker build and run docker bui

Bayangmbe Mounmo 1 Jan 11, 2022
Making it easy to query APIs via SQL

Shillelagh Shillelagh (ʃɪˈleɪlɪ) is an implementation of the Python DB API 2.0 based on SQLite (using the APSW library): from shillelagh.backends.apsw

Beto Dealmeida 207 Dec 30, 2022
A SQL linter and auto-formatter for Humans

The SQL Linter for Humans SQLFluff is a dialect-flexible and configurable SQL linter. Designed with ELT applications in mind, SQLFluff also works with

SQLFluff 5.5k Jan 08, 2023
A Python Object-Document-Mapper for working with MongoDB

MongoEngine Info: MongoEngine is an ORM-like layer on top of PyMongo. Repository: https://github.com/MongoEngine/mongoengine Author: Harry Marr (http:

MongoEngine 3.9k Jan 08, 2023
Simplest SQL mapper in Python, probably

SQL MAPPER Basically what it does is: it executes some SQL thru a database connector you fed it, maps it to some model and gives to u. Also it can cre

2 Nov 07, 2022
PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.

PyPika - Python Query Builder Abstract What is PyPika? PyPika is a Python API for building SQL queries. The motivation behind PyPika is to provide a s

KAYAK 1.9k Jan 04, 2023
CouchDB client built on top of aiohttp (asyncio)

aiocouchdb source: https://github.com/aio-libs/aiocouchdb documentation: http://aiocouchdb.readthedocs.org/en/latest/ license: BSD CouchDB client buil

aio-libs 53 Apr 05, 2022
A Python-based RPC-like toolkit for interfacing with QuestDB.

pykit A Python-based RPC-like toolkit for interfacing with QuestDB. Requirements Python 3.9 Java Azul

QuestDB 11 Aug 03, 2022
A library for python made by me,to make the use of MySQL easier and more pythonic

my_ezql A library for python made by me,to make the use of MySQL easier and more pythonic This library was made by Tony Hasson , a 25 year old student

3 Nov 19, 2021
Sample code to extract data directly from the NetApp AIQUM MySQL Database

This sample code shows how to connect to the AIQUM Database and pull user quota details from it. AIQUM Requirements: 1. AIQUM 9.7 or higher. 2. An

1 Nov 08, 2021
MongoDB data stream pipeline tools by YouGov (adopted from MongoDB)

mongo-connector The mongo-connector project originated as a MongoDB mongo-labs project and is now community-maintained under the custody of YouGov, Pl

YouGov 1.9k Jan 04, 2023
MongoX is an async python ODM for MongoDB which is built on top Motor and Pydantic.

MongoX MongoX is an async python ODM (Object Document Mapper) for MongoDB which is built on top Motor and Pydantic. The main features include: Fully t

Amin Alaee 112 Dec 04, 2022