AnySQL
Lightweight, Thread-Safe, Version-Agnostic, SQL Client Implementation inspired by Databases
Features
- Lightweight - no use of sqlalchemy or other massive frameworks
- ThreadSafe - implements threadsafe features for fearless concurrent usage
- Flexible - acts as a standard frontend for a wide variety of SQL backends
- Powerful - simple API design with powerful utilities and quality-of-life features
Installation
$ pip install anysql # plain install
$ pip install anysql[mysql] # install with mysql driver
$ pip install anysql[postgres] # install with postgres driver
Security
It should be noted that anysql implements its own query parameterization to allow for greater API flexibility and performance, rather than rely on individual sql backends or relying on massive frameworks like sqlalchemy to handle query generation.
The existing parameterization has been thoroughly tested with sqlmap, the world standard of sql pentesting-tools, to prevent and detect any possible sql-injection vulnerabilities.
The test-suite used is publically available within the source-code repo within the tests folder.
Example
# Create a database instance, and connect to it.
from anysql import Database
database = Database('sqlite://:memory:')
database.connect()
# Create a table.
query = """CREATE TABLE HighScores (id INTEGER PRIMARY KEY, name VARCHAR(100), score INTEGER)"""
database.execute(query=query)
# Insert some data.
query = "INSERT INTO HighScores(name, score) VALUES (:name, :score)"
values = [
{"name": "Daisy", "score": 92},
{"name": "Neil", "score": 87},
{"name": "Carol", "score": 43},
]
database.execute_many(query=query, values=values)
# Run a database query.
query = "SELECT * FROM HighScores"
rows = database.fetch_all(query=query)
print('High Scores:', rows)
Metadata
Release files for anysql 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anysql-0.0.4.tar.gz | 14.5 kB | Without provenance | Details for anysql-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anysql-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for anysql-0.0.4-py3-none-any.whl |
Total release size: 32.3 kB
Release files / anysql-0.0.4.tar.gz
| Download URL | anysql-0.0.4.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a796fdf68fcfb761faa0ab2faf3e1f4dfa974ed6aafc445f73e301f6be237e8c
|
|
BLAKE2b-256 checksum How to use checksums |
3485580b15c567f0a6f955ba65a41a174236462f03d35ef9f84c16c6e31137de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.19
|
Release files / anysql-0.0.4-py3-none-any.whl
| Download URL | anysql-0.0.4-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60c6fc4e071d13088d2cb152b032caf3b6ec245573d60d4209b681edaf3bedf3
|
|
BLAKE2b-256 checksum How to use checksums |
24b30138e381592b25d144319501a6347ed40c130c4af9e94e5d6e08495425a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.19
|
Security for anysql 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.