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)
MySQL database connector for Python (with Python 3 support)

mysqlclient This project is a fork of MySQLdb1. This project adds Python 3 support and fixed many bugs. PyPI: https://pypi.org/project/mysqlclient/ Gi

PyMySQL 2.2k Dec 25, 2022
Asynchronous interface for peewee ORM powered by asyncio

peewee-async Asynchronous interface for peewee ORM powered by asyncio. Important notes Since version 0.6.0a only peewee 3.5+ is supported If you still

05Bit 666 Dec 30, 2022
Asynchronous Python client for InfluxDB

aioinflux Asynchronous Python client for InfluxDB. Built on top of aiohttp and asyncio. Aioinflux is an alternative to the official InfluxDB Python cl

Gustavo Bezerra 159 Dec 27, 2022
A simple password manager I typed with python using MongoDB .

Python with MongoDB A simple python code example using MongoDB. How do i run this code • First of all you need to have a python on your computer. If y

31 Dec 06, 2022
Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API

Apache Libcloud - a unified interface for the cloud Apache Libcloud is a Python library which hides differences between different cloud provider APIs

The Apache Software Foundation 1.9k Dec 25, 2022
Databank is an easy-to-use Python library for making raw SQL queries in a multi-threaded environment.

Databank Databank is an easy-to-use Python library for making raw SQL queries in a multi-threaded environment. No ORM, no frills. Thread-safe. Only ra

snapADDY GmbH 4 Apr 04, 2022
Python PostgreSQL adapter to stream results of multi-statement queries without a server-side cursor

streampq Stream results of multi-statement PostgreSQL queries from Python without server-side cursors. Has benefits over some other Python PostgreSQL

Department for International Trade 6 Oct 31, 2022
Python ODBC bridge

pyodbc pyodbc is an open source Python module that makes accessing ODBC databases simple. It implements the DB API 2.0 specification but is packed wit

Michael Kleehammer 2.6k Dec 27, 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
SpyQL - SQL with Python in the middle

SpyQL SQL with Python in the middle Concept SpyQL is a query language that combines: the simplicity and structure of SQL with the power and readabilit

Daniel Moura 853 Dec 30, 2022
Google Cloud Client Library for Python

Google Cloud Python Client Python idiomatic clients for Google Cloud Platform services. Stability levels The development status classifier on PyPI ind

Google APIs 4.1k Jan 01, 2023
Records is a very simple, but powerful, library for making raw SQL queries to most relational databases.

Records: SQL for Humans™ Records is a very simple, but powerful, library for making raw SQL queries to most relational databases. Just write SQL. No b

Kenneth Reitz 6.9k Jan 03, 2023
google-cloud-bigtable Apache-2google-cloud-bigtable (🥈31 · ⭐ 3.5K) - Google Cloud Bigtable API client library. Apache-2

Python Client for Google Cloud Bigtable Google Cloud Bigtable is Google's NoSQL Big Data database service. It's the same database that powers many cor

Google APIs 39 Dec 03, 2022
Async database support for Python. 🗄

Databases Databases gives you simple asyncio support for a range of databases. It allows you to make queries using the powerful SQLAlchemy Core expres

Encode 3.2k Dec 30, 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
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
Class to connect to XAMPP MySQL Database

MySQL-DB-Connection-Class Class to connect to XAMPP MySQL Database Basta fazer o download o mysql_connect.py e modificar os parâmetros que quiser. E d

Alexandre Pimentel 4 Jul 12, 2021
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 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
Estoult - a Python toolkit for data mapping with an integrated query builder for SQL databases

Estoult Estoult is a Python toolkit for data mapping with an integrated query builder for SQL databases. It currently supports MySQL, PostgreSQL, and

halcyon[nouveau] 15 Dec 29, 2022