pysql-beam
This package is still under development but has been used in few projects in production. This has been tested with dataflow Runner and Direct runner
This package aim to provide Apache_beam io connector for MySQL and Postgres database.
This package provides apache beam io connector for postgres db and mysql db. This package wil aim to be pure python implementation for both io connector
FYI: This does not uses any jdbc or odbc connector
Requirements:
1. Python>=2.7 or python>= 3.5
2. Apache beam >= 2.10
3. pymysql[rsa]
4. psycopg2-binary
Installation:
1. pip install git+git@github.com:MediaAgility/pysql-beam.git
Current functionality:
1. Read from MySQL database by passing either table name or sql query
2. Read from Postgres database by passing either table name or sql query
Reference Guide:
-
Java IO connector for the same: https://github.com/spotify/dbeam
-
How to write io connector for Apache Beam: https://beam.apache.org/documentation/io/developing-io-overview/
https://beam.apache.org/documentation/io/developing-io-python/
Usage Guide:
from pysql_beam.sql_io.sql import ReadFromSQL
....
ReadFromSQL(host=self.options.host, port=self.options.port,
username=self.options.username, password=self.options.password,
databse=self.options.database,
query=self.options.source_query,
wrapper=PostgresWrapper,
batch=100000)
Examples:
For mysql:
`python cloud_sql_to_file.py --host localhost --port 3306 --database SECRET_DATABASE --username SECRET_USER --password SECRET_PASSWORD --table YOUR_TABLE --output YOUR_OUTPUT_FLLE`
For postgres:
`python cloud_sql_to_file.py --host localhost --port 5432 --database SECRET_DATABASE --username SECRET_USER --password SECRET_PASSWORD --table YOUR_TABLE --output YOUR_OUTPUT_FLLE`
contribution: You can contribute to this package by raising bugs or sending pull requests
Metadata
Release files for pysql-beam 0.2
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 |
|---|---|---|---|---|
| pysql-beam-0.2.tar.gz | 13.9 kB | Without provenance | Details for pysql-beam-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysql_beam-0.2-py3-none-any.whl | Python 3 | none | any | Details for pysql_beam-0.2-py3-none-any.whl |
Total release size: 31.2 kB
Release files / pysql-beam-0.2.tar.gz
| Download URL | pysql-beam-0.2.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec887acb65104f44e990710d78b1222a144210d651dcabca0a6bdb1cd6eefcee
|
|
BLAKE2b-256 checksum How to use checksums |
02e60455b9e8af19df175e966dbe6bac01232a3a742e4732a73b8c1345330e4c
|
| 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.35.0 CPython/3.6.8
|
Release files / pysql_beam-0.2-py3-none-any.whl
| Download URL | pysql_beam-0.2-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7875d9552c67228945a1eed3b47b3fe1dca77444c8a543b0aee0c50cfe3768e0
|
|
BLAKE2b-256 checksum How to use checksums |
cbbcac9e6b9c8887045f71c3857407c38d7b888a51bf1e6afaba9bd6d670165a
|
| 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.35.0 CPython/3.6.8
|
Security for pysql-beam 0.2
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.