With PySQLe you can easily write parameterized SQL queries in Python, and run it against any SQLAlchemy-supported database.
from pysqle import PysqleModule, one
class MyQueries(PysqleModule):
@one
def find_user(self, user_id:):
return "select * from users where user_id = :user_id"
# Create the module and directly connect to the database
queries = MyQueries("sqlite:///foo.db")
# Invoke queries
user = queries.find_user(user_id=666)
print(repr(user)) # (666, 'thebeast')
print(repr(user._asdict())) # {'user_id': 666, 'username': 'thebeast'}
This is the way of running SQL with Python. Install PySQLe today!
Release files for pysqle 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pysqle-0.1.0.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pysqle-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.8 kB
Release files / pysqle-0.1.0.tar.gz
| Download URL | pysqle-0.1.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c830b83e04af2082d2e7e5f5f321d45f2e4e3615e1a34433530548fa3583421d
|
|
BLAKE2b-256 checksum How to use checksums |
9d253730b280836f82e5f8592d9ac1253f6a937b04340fb0cfdc57380e78e029
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.6 Darwin/24.6.0
|
Release files / pysqle-0.1.0-py3-none-any.whl
| Download URL | pysqle-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f899ebb008049e5875d6f4f5d411fc0019b7b15948ca0d1b229aecb7f8b917e
|
|
BLAKE2b-256 checksum How to use checksums |
3a1d108e1bbe1586c05e26e2896656e9a3555251670761d012fe24457653ec89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.6 Darwin/24.6.0
|