Python MySQL Replication Blinker
Features
This package uses mysql-replication to read events from MySQL’s binlog and send to blinker’s signal.
binlog action level
rows level
It will send RowsEvent only.
Whenever a binlog event come, it will be dispatched into some signals:
binlog_position_signal: 1 signal for the binlog current position
binlog_signal: 1 signal for the binlog event.
rows_signal: 1 signal for event’s rows. 1 signal per row.
Signals
There are 5 signals:
binlog_position_signal: sent whenever binlog event come to notify the current position of binlog stream
binlog_signal: sent whenever binlog event come to notify the binlog event
rows_inserted_signal, rows_updated_signal, rows_deleted_signal: sent on the event as their name
Connect to signals
To connect to a signal, you can use the signal instance or a decorator.
Suppose that you need to connect to write signal on table db0.table1:
from mysqlbinlog2blinker import signals @signal.rows_updated.connect def on_rows_updated_signal(table_name, rows, meta): pass @signal.binlog_signal.connect def on_binlog_signal(event, stream): pass
Signal publishing
To start publishing signals
from pymysqlblinker import start_publishing start_publishing( { 'host': 'localohst', 'user': 'root', }, )
Replication
This package support a method to replicate from mysql database. It operates by keep memory at last binlog position. By default, it save to a file.
To make it, call:
from pymysqlblinker import start_replication start_replication( { 'host': 'localohst', 'user': 'root', }, ('/path/to/file/that/remember/binlog/position', 2), )
Change logs
0.1
First version
Metadata
Release files for mysqlbinlog2blinker 0.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 | Provenance | Actions |
|---|---|---|---|---|
| mysqlbinlog2blinker-0.1.tar.gz | 8.8 kB | Without provenance | Details for mysqlbinlog2blinker-0.1.tar.gz |
Release files / mysqlbinlog2blinker-0.1.tar.gz
| Download URL | mysqlbinlog2blinker-0.1.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5f13cd8c0e6e44178a47b718c3b50bfc17138ce830a8f12f71caa8d0e5fcad8
|
|
BLAKE2b-256 checksum How to use checksums |
18746ab10a7ab762f69043065ec6b009ed9e65fee3f2fa72c867fe117f270f45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for mysqlbinlog2blinker 0.1
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.