Simplified editing of SQL databases (sqlite3) without having to deal with queries!
Project description
SimplySQL - The easiest way to edit SQL databases!
With SimplySQL you can edit SQL databases without having to have a great understanding of SQL queries. Creating, reading or editing a database is made possible by simple python commands without the need for many lines of code.
Overview
The following features are included:
- Open or create databases
- Open or create tables
- Run through all rows or columns, create them or delete them
At this stage only the following databases are supported: SQLite.
Installation
The installation is possible in two ways: either fork this github repo or use Pypi via pip.
$ pip install simplysql
Usage
Because SimplySQL should work without queries, it is only necessary to import DataBase from SimplySQL
from simplysql import DataBase
From this moment the fun can begin. The next step is the assignment of the database. Two methods can be used for this. The first method is a direct assignment (whereby this must be closed again at the end of processing):
DB = DataBase("tests/Test.db")
...
DB.close()
Or you can choose the with-assignment:
with DataBase("tests/Test.db") as DB:
...
Grab a table and iterate over all rows:
DBtable = DB.table(0)
for row in DBTable.rows():
print(row.as_dict())
# first row would be like:: {'name': 'Karl', 'age': 29, 'gender': 'female'}
Each entry in a row can be reached by several ways where the assignment via a name depends on the name of the table columns:
row.name
,row["name"]
,row.get("name")
orrow[0]
To display the all content of a row you can use this functions and methods:
row.attribute()
,row.data
,row.as_list()
,row.as_dict()
orrow.as_tuple()
For a complete overview of all functions have a look at the manual and the examples. >>> coming soon
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
Built Distribution
File details
Details for the file simplysql-0.1.3.tar.gz
.
File metadata
- Download URL: simplysql-0.1.3.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3de197aed3419b58ee3a1c9d9af97878b71b5d76a2c13eed5a52655d122fac97 |
|
MD5 | 603a195fa6bd5077ac05fe2b09061920 |
|
BLAKE2b-256 | 497b898e4899386b0e6139d5ced6f6e4bcdc48ae2ef724313f86abd122a9d576 |
File details
Details for the file simplysql-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: simplysql-0.1.3-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efcd93ec509851b73d79c156a2288fbc04ee2d64d9739208b145eb12b174a45c |
|
MD5 | 99747480d2e5024662d9e773126403fb |
|
BLAKE2b-256 | 904f919b89903938b08b13ff8d0a2b42118e9d3c0b6e1e758273715136dbe739 |