gerardo
gerardo provides decorators to easily compute in parallel and store the results in a PostgreSQL database.
Usage
See examples/example.py for more details.
from gerardo import psql_mp_insert, psql_handler
# Set a PostgreSQL handler
pghost = os.environ["PGHOST"]
DSN = {
"host": pghost,
"port": "",
"user": "",
"password": "",
"dbname": "example_db",
}
PSQL_TABLE = "test_table"
COLUMNS = [('x', 'INT'), ('y', 'INT')]
PH = psql_handler(DSN, PSQL_TABLE, COLUMNS)
# Define a single-variable function.
@psql_mp_insert(PH)
def f(x):
return (x[0]+x[1], x[0]*x[1])
# Compute by forming a list of arguments
list_args = [(x, y) for x in range(5) for y in range(10)]
f(list_args)
Installation
pip install gerardo --user
Homepage
Metadata
Release files for gerardo 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gerardo-0.1.1.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gerardo-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / gerardo-0.1.1.tar.gz
| Download URL | gerardo-0.1.1.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4495ec62032e1ca966293f092c4f9d1e21f53132c64749db2b75028e061d48f
|
|
BLAKE2b-256 checksum How to use checksums |
d513fa7b87af52b432144545f2dcd85168c62faafaf436aca571e15de16f451c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4
|
Release files / gerardo-0.1.1-py3-none-any.whl
| Download URL | gerardo-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bcada70095789db00777e37c74931d9d8b8f4cc2480d6b1d5233bf789ffb62e
|
|
BLAKE2b-256 checksum How to use checksums |
84313542809f296ba1f5e5c15f1788633123f1941b457d009beae1184c0c5d60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4
|