Python Basic Utilities - MySQL pbumysql
Available on PyPi
This package is still in development!
Table of Contents
- Installation
- Usage
- Classes
- AbstractMysqlStore - abstract class for handling MySQL table access
- AbstractMysqlDocument - abstract class for wrapping rows representing entities
- MysqlConnection - a wrapper for a MySQL connection
Installation
Install via pip:
pip install pbumysql
Usage
It is good practice associating a sub-class of AbstractMysqlDocument with a sub-class of AbstractMysqlStore. This is
done through the object_class parameter in the super() constructor call of the store class. Any method for querying
rows will use that class to deserialise the row into the provided class, which should extend AbstractMysqlDocument.
Example: let's say we want to implement access to a collection containing user documents. We'll define a class User
that extends AbstractMysqlDocument and a class UserStore that extends AbstractMysqlStore.
- TODO: add code example of store and entity definition
- TODO: add code example of store and entity usage
Classes
AbstractMysqlStore
This is an abstract class and cannot be instantiated directly. Instead, define a class that extends this class.
Constructor
__init__(connection, table_name, object_class, logger=None)
connection- an instance ofMysqlConnectiontable_name- the name of the table containing the rowsobject_class- used for all the query methods to deserialise the row into a class with attributes for easier accesslogger- a logger instance with.info/.error/.warnmethods available
Methods
TODO: describe methods
AbstractMysqlDocument
TODO: add documentation
MysqlConnection
TODO: add documentation
Metadata
Release files for pbumysql 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 | Provenance | Actions |
|---|---|---|---|---|
| pbumysql-0.1.0.tar.gz | 6.9 kB | Without provenance | Details for pbumysql-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pbumysql-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pbumysql-0.1.0-py3-none-any.whl |
Total release size: 18.0 kB
Release files / pbumysql-0.1.0.tar.gz
| Download URL | pbumysql-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7883c2106743b0303bf4100fa1f984f424eb58f0359e90f695aa72f75a6a391
|
|
BLAKE2b-256 checksum How to use checksums |
b4a735ce0ef2315b028e6287b8e84794b6486416e9cd3583bf9e1bb43a7c2057
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.12
|
Release files / pbumysql-0.1.0-py3-none-any.whl
| Download URL | pbumysql-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ede9a6dd64b354c265a95665bee57568f62b61f678bfaabc11a95a7eb0244139
|
|
BLAKE2b-256 checksum How to use checksums |
917b2523d96de21a303977eec5570f9008409b50bce3ff6270aac28b4b00b29b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.12
|
Security for pbumysql 0.1.0
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.