Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinywlui/gerardo
gerardo provides decorators to easily compute in parallel and store the results in a PostgreSQL database.
https://github.com/kevinywlui/gerardo
Last synced: about 2 months ago
JSON representation
gerardo provides decorators to easily compute in parallel and store the results in a PostgreSQL database.
- Host: GitHub
- URL: https://github.com/kevinywlui/gerardo
- Owner: kevinywlui
- License: mit
- Created: 2019-08-23T16:06:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-29T05:57:36.000Z (over 5 years ago)
- Last Synced: 2024-10-18T12:35:58.817Z (2 months ago)
- Language: Python
- Homepage: https://github.com/kevinywlui/gerardo
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gerardo
[![PyPI version](https://badge.fury.io/py/gerardo.svg)](https://badge.fury.io/py/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.
```python
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
* https://github.com/kevinywlui/gerardo