Skip to main content

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") or row[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() or row.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

simplysql-0.1.3.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

simplysql-0.1.3-py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page