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
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 | |
|---|---|---|---|
| pbumysql-0.1.0.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pbumysql-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
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
|