With PySQLe you can easily write parameterized SQL queries in Python, and run it against any SQLAlchemy-supported database.
Project description
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pysqle-0.1.0.tar.gz
(4.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysqle-0.1.0.tar.gz.
File metadata
- Download URL: pysqle-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.14.6 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c830b83e04af2082d2e7e5f5f321d45f2e4e3615e1a34433530548fa3583421d
|
|
| MD5 |
abd085a829a7aa0a8a8f63a300034f05
|
|
| BLAKE2b-256 |
9d253730b280836f82e5f8592d9ac1253f6a937b04340fb0cfdc57380e78e029
|
File details
Details for the file pysqle-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pysqle-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.14.6 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f899ebb008049e5875d6f4f5d411fc0019b7b15948ca0d1b229aecb7f8b917e
|
|
| MD5 |
cc1a2589694e3e143df379997ffb941c
|
|
| BLAKE2b-256 |
3a1d108e1bbe1586c05e26e2896656e9a3555251670761d012fe24457653ec89
|