SimQLe
The simple way to SQL
Perfect for no fuss SQL in your Python projects. Execute SQL and return simple record sets with named parameters. Manage several connections, and switch between production, development and testing modes.
Documentation can be found here
Installation
Repository
https://github.com/Harlekuin/SimQLe
Or choose your poison:
$ pip install simqle
$ poetry add simqle
$ pipenv install simqle
SimQLe reads from a connections file in yaml format. See the
.connections.yaml
file section for more details.
Usage
In Production
Get a result from the name of your connection, the SQL statement, and a dict of parameters:
from simqle import ConnectionManager
# Intialise your connections
cm = ConnectionManager(".connections.yaml")
# Write some simple SQL
sql = "SELECT name, age FROM people WHERE category = :category"
params = {"category": 5}
result = cm.recordset(con_name="my-database", sql=sql, params=
…