python-mysql-replication
========================
<a href="https://pypi.python.org/pypi/mysql-replication"><img src="http://img.shields.io/pypi/dm/mysql-replication.svg"></a>
<img src ="https://github.com/julien-duponchelle/python-mysql-replication/blob/main/logo.svg">
Pure Python Implementation of MySQL replication protocol build on top of PyMYSQL. This allows you to receive event like insert, update, delete with their datas and raw SQL queries.
Use cases
===========
* MySQL to NoSQL database replication
* MySQL to search engine replication
* Invalidate cache when something change in database
* Audit
* Real time analytics
Documentation
==============
A work in progress documentation is available here: https://python-mysql-replication.readthedocs.org/en/latest/
Instruction about building documentation is available here:
https://python-mysql-replication.readthedocs.org/en/latest/developement.html
Installation
=============
```
pip install mysql-replication
```
Getting support
===============
You can get support and discuss about new features on:
https://github.com/julien-duponchelle/python-mysql-replication/discussions
Project status
================
The project is test with:
* MySQL 5.5, 5.6 and 5.7 (v0.1 ~ v0.45)
* MySQL 8.0.14 (v1.0 ~)
* MariaDB 10.6
* Python 3.7, 3.11
* PyPy 3.7, 3.9 (really faster than the standard Python interpreter)
MySQL version 8.0.14 and later Set global variable binlog_row_metadata='FULL' and binlog_row_image='FULL'
The project is used in production for critical stuff in some
medium internet corporations. But all use case as not
been perfectly test in the real world.
Limitations
=============
https://python-mysql-replication.readthedocs.org/en/latest/limitations.html
Featured
=============
[Data Pipelines Pocket Reference](https://www.oreilly.com/library/view/data-pipelines-pocket/9781492087823/) (by James Densmore, O'Reilly): Introduced and exemplified in Chapter 4: Data Ingestion: Extracting Data.
[Streaming Changes in a Database with Amazon Kinesis](https://aws.amazon.com/blogs/database/streaming-changes-in-a-database-with-amazon-kinesis/) (by Emmanuel Espina, Amazon Web Services)
[Near Zero Downtime Migration from MySQL to DynamoDB](https://aws.amazon.com/ko/blogs/big-data/near-zero-downtime-migration-from-mysql-to-dynamodb/) (by YongSeong Lee, Amazon Web Services)
[Enable change data capture on Amazon RDS for MySQL applications that are using XA transactions](https://aws.amazon.com/ko/blogs/database/enable-change-data-capture-on-amazon-rds-for-mysql-applications-that-are-using-xa-transactions/) (by Baruch Assif, Amazon Web Services)
Projects using this library
===========================
* pg_chameleon: Migration and replica from MySQL to PostgreSQL https://github.com/the4thdoctor/pg_chameleon
* Yelp Data Pipeline: https://engineeringblog.yelp.com/2016/11/open-sourcing-yelps-data-pipeline.html
* Singer.io Tap for MySQL (https://github.com/singer-io/tap-mysql)
* MySQL River Plugin for ElasticSearch: https://github.com/scharron/elasticsearch-river-mysql
* Ditto: MySQL to MemSQL replicator https://github.com/memsql/ditto
* ElasticMage: Full Magento integration with ElasticSearch https://github.com/ElasticMage/elasticmage
* Cache buster: an automatic cache invalidation system https://github.com/rackerlabs/cache-busters
* Zabbix collector for OpenTSDB https://github.com/OpenTSDB/tcollector/blob/master/collectors/0/zabbix_bridge.py
* Meepo: Event sourcing and event broadcasting for databases. https://github.com/eleme/meepo
* Python MySQL Replication Blinker: This package read events from MySQL binlog and send to blinker's signal. https://github.com/tarzanjw/python-mysql-replication-blinker
* aiomysql_replication: Fork supporting asyncio https://github.com/jettify/aiomysql_replication
* python-mysql-eventprocessor: Daemon interface for handling MySQL binary log events. https://github.com/jffifa/python-mysql-eventprocessor
* mymongo: MySQL to mongo replication https://github.com/njordr/mymongo
* pg_ninja: The ninja elephant obfuscation and replica tool https://github.com/transferwise/pg_ninja/ (http://tech.transferwise.com/pg_ninja-replica-with-obfuscation/)
* MySQLStreamer: MySQLStreamer is a database change data capture and publish system https://github.com/Yelp/mysql_streamer
* binlog2sql: a popular binlog parser that could convert raw binlog to sql and also could generate flashback sql from raw binlog (https://github.com/danfengcao/binlog2sql)
* Streaming mysql binlog replication to Snowflake/Redshift/BigQuery (https://github.com/trainingrocket/mysql-binlog-replication)
* MySQL to Kafka (https://github.com/scottpersinger/mysql-to-kafka/)
* Aventri MySQL Monitor (https://github.com/aventri/mysql-monitor)
* BitSwanPump: A real-time stream processor (https://github.com/LibertyAces/BitSwanPump)
* clickhouse-mysql-data-reader: https://github.com/Altinity/clickhouse-mysql-data-reader
* py-mysql-elasticsearch-sync: https://github.com/jaehyeonpy/py-mysql-elasticsearch-sync
* synch: Sync data from other DB to ClickHouse (https://github.com/long2ice/synch)
* sb-osc: Online schema change tool created by Sendbird (https://github.com/sendbird/sb-osc)
MySQL server settings
=========================
In your MySQL server configuration file you need to enable replication:
[mysqld]
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
binlog_expire_logs_seconds = 864000
max_binlog_size = 100M
binlog-format = ROW #Very important if you want to receive write, update and delete row events
binlog_row_metadata = FULL
binlog_row_image = FULL
reference: https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html
Examples
=========
All examples are available in the [examples directory](https://github.com/noplay/python-mysql-replication/tree/main/examples)
This example will dump all replication events to the console:
```python
from pymysqlreplication import BinLogStreamReader
mysql_settings = {'host': '127.0.0.1', 'port': 3306, 'user': 'root', 'passwd': ''}
stream = BinLogStreamReader(connection_settings = mysql_settings, server_id=100)
for binlogevent in stream:
binlogevent.dump()
stream.close()
```
For this SQL sessions:
```sql
CREATE DATABASE test;
use test;
CREATE TABLE test4 (id int NOT NULL AUTO_INCREMENT, data VARCHAR(255), data2 VARCHAR(255), PRIMARY KEY(id));
INSERT INTO test4 (data,data2) VALUES ("Hello", "World");
UPDATE test4 SET data = "World", data2="Hello" WHERE id = 1;
DELETE FROM test4 WHERE id = 1;
```
Output will be:
=== RotateEvent ===
Date: 1970-01-01T01:00:00
Event size: 24
Read bytes: 0
=== FormatDescriptionEvent ===
Date: 2012-10-07T15:03:06
Event size: 84
Read bytes: 0
=== QueryEvent ===
Date: 2012-10-07T15:03:16
Event size: 64
Read bytes: 64
Schema: test
Execution time: 0
Query: CREATE DATABASE test
=== QueryEvent ===
Date: 2012-10-07T15:03:16
Event size: 151
Read bytes: 151
Schema: test
Execution time: 0
Query: CREATE TABLE test4 (id int NOT NULL AUTO_INCREMENT, data VARCHAR(255), data2 VARCHAR(255), PRIMARY KEY(id))
=== QueryEvent ===
Date: 2012-10-07T15:03:16
Event size: 49
Read bytes: 49
Schema: test
Execution time: 0
Query: BEGIN
=== TableMapEvent ===
Date: 2012-10-07T15:03:16
Event size: 31
Read bytes: 30
Table id: 781
Schema: test
Table: test4
Columns: 3
=== WriteRowsEvent ===
Date: 2012-10-07T15:03:16
Event size: 27
Read bytes: 10
Table: test.test4
Affected columns: 3
Changed rows: 1
Values:
--
* data : Hello
* id : 1
* data2 : World
=== XidEvent ===
Date: 2012-10-07T15:03:16
Event size: 8
Read bytes: 8
Transaction ID: 14097
=== QueryEvent ===
Date: 2012-10-07T15:03:17
Event size: 49
Read bytes: 49
Schema: test
Execution time: 0
Query: BEGIN
=== TableMapEvent ===
Date: 2012-10-07T15:03:17
Event size: 31
Read bytes: 30
Table id: 781
Schema: test
Table: test4
Columns: 3
=== UpdateRowsEvent ===
Date: 2012-10-07T15:03:17
Event size: 45
Read bytes: 11
Table: test.test4
Affected columns: 3
Changed rows: 1
Affected columns: 3
Values:
--
* data : Hello => World
* id : 1 => 1
* data2 : World => Hello
=== XidEvent ===
Date: 2012-10-07T15:03:17
Event size: 8
Read bytes: 8
Transaction ID: 14098
=== QueryEvent ===
Date: 2012-10-07T15:03:17
Event size: 49
Read bytes: 49
Schema: test
Execution time: 1
Query: BEGIN
=== TableMapEvent ===
Date: 2012-10-07T15:03:17
Event size: 31
Read bytes: 30
Table id: 781
Schema: test
Table: test4
Columns: 3
=== DeleteRowsEvent ===
Date: 2012-10-07T15:03:17
Event size: 27
Read bytes: 10
Table: test.test4
Affected columns: 3
Changed rows: 1
Values:
--
* data : World
* id : 1
* data2 : Hello
=== XidEvent ===
Date: 2012-10-07T15:03:17
Event size: 8
Read bytes: 8
Transaction ID: 14099
Tests
========
When it's possible we have a unit test.
More information is available here:
https://python-mysql-replication.readthedocs.org/en/latest/developement.html
Changelog
==========
https://github.com/julien-duponchelle/python-mysql-replication/blob/main/CHANGELOG
Similar projects
==================
* Kodoma: Ruby-binlog based MySQL replication listener https://github.com/y310/kodama
* MySQL Hadoop Applier: C++ version http://dev.mysql.com/tech-resources/articles/mysql-hadoop-applier.html
* Java: https://github.com/shyiko/mysql-binlog-connector-java
* GO: https://github.com/siddontang/go-mysql
* PHP: Based on this this project https://github.com/krowinski/php-mysql-replication and https://github.com/fengxiangyun/mysql-replication
* .NET: https://github.com/SciSharp/dotnet-mysql-replication
* .NET Core: https://github.com/rusuly/MySqlCdc
Special thanks
================
* MySQL binlog from Jeremy Cole was a great source of knowledge about MySQL replication protocol https://github.com/jeremycole/mysql_binlog
* Samuel Charron for his help https://github.com/scharron
Contributors
==============
Major contributor:
* Julien Duponchelle Original author https://github.com/noplay
* bjoernhaeuser for his bugs fixing, improvements and community support https://github.com/bjoernhaeuser
* Arthur Gautier gtid, slave report... https://github.com/baloo
Maintainer:
* Julien Duponchelle Original author https://github.com/noplay
* Sean-k1 https://github.com/sean-k1
* dongwook-chan https://github.com/dongwook-chan
Other contributors:
* Dvir Volk for bug fix https://github.com/dvirsky
* Lior Sion code cleanup and improvements https://github.com/liorsion
* Lx Yu code improvements, primary keys detections https://github.com/lxyu
* Young King for pymysql 0.6 support https://github.com/youngking
* David Reid checksum checking fix https://github.com/dreid
* Alex Gaynor fix smallint24 https://github.com/alex
* lifei NotImplementedEvent https://github.com/lifei
* Maralla Python 3.4 fix https://github.com/maralla
* Daniel Gavrila more MySQL error codes https://github.com/danielduduta
* Bernardo Sulzbach code cleanup https://github.com/mafagafogigante
* Darioush Jalali Python 2.6 backport https://github.com/darioush
* Jasonz bug fixes https://github.com/jasonzzz
* Bartek Ogryczak cleanup and improvements https://github.com/vartec
* Wang, Xiaozhe cleanup https://github.com/chaoslawful
* siddontang improvements https://github.com/siddontang
* Cheng Chen Python 2.6 compatibility https://github.com/cccc1999
* Jffifa utf8mb4 compatibility https://github.com/jffifa
* Romuald Brunet bug fixes https://github.com/romuald
* Cédric Hourcade Don't fail on incomplete dates https://github.com/hc
* Giacomo Lozito Explicit close stream connection on exception https://github.com/giacomolozito
* Giovanni F. MySQL 5.7 support https://github.com/26fe
* Igor Mastak intvar event https://github.com/mastak
* Xie Zhenye fix missing update _next_seq_no https://github.com/xiezhenye
* Abrar Sheikh: Multiple contributions https://github.com/abrarsheikh
* Keegan Parker: secondary database for reference schema https://github.com/kdparker
* Troy J. Farrell Clear table_map if RotateEvent has timestamp of 0 https://github.com/troyjfarrell
* Zhanwei Wang Fail to get table informations https://github.com/wangzw
* Alexander Ignatov Fix the JSON literal
* Garen Chan Support PyMysql with a version greater than 0.9.3 https://github.com/garenchan
* Mike Ascah: Add logic to handle inlined ints in large json documents ttps://github.com/mascah
* Hiroaki Kawai: PyMySQL 1.0 support (https://github.com/hkwi)
* Dongwook Chan: Support for ZEROFILL, Correct timedelta value for negative MySQL TIME datatype, Fix parsing of row events for MySQL8 partitioned table, Parse status variables in query event, Parse status variables in query event , Fix parse errors with MariaDB (https://github.com/dongwook-chan)
* Paul Vickers: Add support for specifying an end log_pos (https://github.com/paulvic)
* Samira El Aabidi: Add support for MariaDB GTID (https://github.com/Samira-El)
* Oliver Seemann: Handle large json, github actions,
Zero-pad fixed-length binary fields (https://github.com/oseemann)
* Mahadir Ahmad: Handle null json payload (https://github.com/mahadirz)
* Axel Viala: Removal of Python 2.7 (https://github.com/darnuria)
* Etern: Add XAPrepareEvent, parse last_committed & sequence_number of GtidEvent (https://github.com/etern)
Thanks to GetResponse for their support
Licence
=======
Copyright 2012-2023 Julien Duponchelle
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Raw data
{
"_id": null,
"home_page": "https://github.com/julien-duponchelle/python-mysql-replication",
"name": "mysql-replication",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Julien Duponchelle",
"author_email": "julien@duponchelle.info",
"download_url": "https://files.pythonhosted.org/packages/57/af/e23aa4e52a094e865554998112f0d94751072b1f076f16ac970ce93e6002/mysql_replication-1.0.9.tar.gz",
"platform": null,
"description": "python-mysql-replication\n========================\n\n<a href=\"https://pypi.python.org/pypi/mysql-replication\"><img src=\"http://img.shields.io/pypi/dm/mysql-replication.svg\"></a>\n\n<img src =\"https://github.com/julien-duponchelle/python-mysql-replication/blob/main/logo.svg\">\nPure Python Implementation of MySQL replication protocol build on top of PyMYSQL. This allows you to receive event like insert, update, delete with their datas and raw SQL queries.\n\nUse cases\n===========\n\n* MySQL to NoSQL database replication\n* MySQL to search engine replication\n* Invalidate cache when something change in database\n* Audit\n* Real time analytics\n\nDocumentation\n==============\n\nA work in progress documentation is available here: https://python-mysql-replication.readthedocs.org/en/latest/\n\nInstruction about building documentation is available here:\nhttps://python-mysql-replication.readthedocs.org/en/latest/developement.html\n\n\nInstallation\n=============\n\n```\npip install mysql-replication\n```\n\nGetting support\n===============\n\nYou can get support and discuss about new features on:\nhttps://github.com/julien-duponchelle/python-mysql-replication/discussions\n\nProject status\n================\n\nThe project is test with:\n* MySQL 5.5, 5.6 and 5.7 (v0.1 ~ v0.45)\n* MySQL 8.0.14 (v1.0 ~)\n* MariaDB 10.6\n* Python 3.7, 3.11\n* PyPy 3.7, 3.9 (really faster than the standard Python interpreter)\n\nMySQL version 8.0.14 and later Set global variable binlog_row_metadata='FULL' and binlog_row_image='FULL'\n\nThe project is used in production for critical stuff in some\nmedium internet corporations. But all use case as not\nbeen perfectly test in the real world.\n\nLimitations\n=============\n\nhttps://python-mysql-replication.readthedocs.org/en/latest/limitations.html\n\nFeatured\n=============\n\n[Data Pipelines Pocket Reference](https://www.oreilly.com/library/view/data-pipelines-pocket/9781492087823/) (by\u00a0James Densmore, O'Reilly): Introduced and exemplified in Chapter 4: Data Ingestion: Extracting Data.\n\n[Streaming Changes in a Database with Amazon Kinesis](https://aws.amazon.com/blogs/database/streaming-changes-in-a-database-with-amazon-kinesis/) (by Emmanuel Espina, Amazon Web Services)\n\n[Near Zero Downtime Migration from MySQL to DynamoDB](https://aws.amazon.com/ko/blogs/big-data/near-zero-downtime-migration-from-mysql-to-dynamodb/) (by YongSeong Lee, Amazon Web Services)\n\n[Enable change data capture on Amazon RDS for MySQL applications that are using XA transactions](https://aws.amazon.com/ko/blogs/database/enable-change-data-capture-on-amazon-rds-for-mysql-applications-that-are-using-xa-transactions/) (by Baruch Assif, Amazon Web Services)\n\nProjects using this library\n===========================\n\n* pg_chameleon: Migration and replica from MySQL to PostgreSQL https://github.com/the4thdoctor/pg_chameleon\n* Yelp Data Pipeline: https://engineeringblog.yelp.com/2016/11/open-sourcing-yelps-data-pipeline.html\n* Singer.io Tap for MySQL (https://github.com/singer-io/tap-mysql)\n* MySQL River Plugin for ElasticSearch: https://github.com/scharron/elasticsearch-river-mysql\n* Ditto: MySQL to MemSQL replicator https://github.com/memsql/ditto\n* ElasticMage: Full Magento integration with ElasticSearch https://github.com/ElasticMage/elasticmage\n* Cache buster: an automatic cache invalidation system https://github.com/rackerlabs/cache-busters\n* Zabbix collector for OpenTSDB https://github.com/OpenTSDB/tcollector/blob/master/collectors/0/zabbix_bridge.py\n* Meepo: Event sourcing and event broadcasting for databases. https://github.com/eleme/meepo\n* Python MySQL Replication Blinker: This package read events from MySQL binlog and send to blinker's signal. https://github.com/tarzanjw/python-mysql-replication-blinker\n* aiomysql_replication: Fork supporting asyncio https://github.com/jettify/aiomysql_replication\n* python-mysql-eventprocessor: Daemon interface for handling MySQL binary log events. https://github.com/jffifa/python-mysql-eventprocessor\n* mymongo: MySQL to mongo replication https://github.com/njordr/mymongo\n* pg_ninja: The ninja elephant obfuscation and replica tool https://github.com/transferwise/pg_ninja/ (http://tech.transferwise.com/pg_ninja-replica-with-obfuscation/)\n* MySQLStreamer: MySQLStreamer is a database change data capture and publish system https://github.com/Yelp/mysql_streamer\n* binlog2sql: a popular binlog parser that could convert raw binlog to sql and also could generate flashback sql from raw binlog (https://github.com/danfengcao/binlog2sql)\n* Streaming mysql binlog replication to Snowflake/Redshift/BigQuery (https://github.com/trainingrocket/mysql-binlog-replication)\n* MySQL to Kafka (https://github.com/scottpersinger/mysql-to-kafka/)\n* Aventri MySQL Monitor (https://github.com/aventri/mysql-monitor)\n* BitSwanPump: A real-time stream processor (https://github.com/LibertyAces/BitSwanPump)\n* clickhouse-mysql-data-reader: https://github.com/Altinity/clickhouse-mysql-data-reader\n* py-mysql-elasticsearch-sync: https://github.com/jaehyeonpy/py-mysql-elasticsearch-sync\n* synch: Sync data from other DB to ClickHouse (https://github.com/long2ice/synch)\n* sb-osc: Online schema change tool created by Sendbird (https://github.com/sendbird/sb-osc)\n\nMySQL server settings\n=========================\n\nIn your MySQL server configuration file you need to enable replication:\n\n [mysqld]\n server-id\t\t = 1\n log_bin\t\t\t = /var/log/mysql/mysql-bin.log\n binlog_expire_logs_seconds = 864000\n max_binlog_size = 100M\n binlog-format = ROW #Very important if you want to receive write, update and delete row events\n binlog_row_metadata = FULL\n binlog_row_image = FULL\n\nreference: https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html\n\nExamples\n=========\n\nAll examples are available in the [examples directory](https://github.com/noplay/python-mysql-replication/tree/main/examples)\n\n\nThis example will dump all replication events to the console:\n\n```python\nfrom pymysqlreplication import BinLogStreamReader\n\nmysql_settings = {'host': '127.0.0.1', 'port': 3306, 'user': 'root', 'passwd': ''}\n\nstream = BinLogStreamReader(connection_settings = mysql_settings, server_id=100)\n\nfor binlogevent in stream:\n binlogevent.dump()\n\nstream.close()\n```\n\nFor this SQL sessions:\n\n```sql\nCREATE DATABASE test;\nuse test;\nCREATE TABLE test4 (id int NOT NULL AUTO_INCREMENT, data VARCHAR(255), data2 VARCHAR(255), PRIMARY KEY(id));\nINSERT INTO test4 (data,data2) VALUES (\"Hello\", \"World\");\nUPDATE test4 SET data = \"World\", data2=\"Hello\" WHERE id = 1;\nDELETE FROM test4 WHERE id = 1;\n```\n\nOutput will be:\n\n === RotateEvent ===\n Date: 1970-01-01T01:00:00\n Event size: 24\n Read bytes: 0\n\n === FormatDescriptionEvent ===\n Date: 2012-10-07T15:03:06\n Event size: 84\n Read bytes: 0\n\n === QueryEvent ===\n Date: 2012-10-07T15:03:16\n Event size: 64\n Read bytes: 64\n Schema: test\n Execution time: 0\n Query: CREATE DATABASE test\n\n === QueryEvent ===\n Date: 2012-10-07T15:03:16\n Event size: 151\n Read bytes: 151\n Schema: test\n Execution time: 0\n Query: CREATE TABLE test4 (id int NOT NULL AUTO_INCREMENT, data VARCHAR(255), data2 VARCHAR(255), PRIMARY KEY(id))\n\n === QueryEvent ===\n Date: 2012-10-07T15:03:16\n Event size: 49\n Read bytes: 49\n Schema: test\n Execution time: 0\n Query: BEGIN\n\n === TableMapEvent ===\n Date: 2012-10-07T15:03:16\n Event size: 31\n Read bytes: 30\n Table id: 781\n Schema: test\n Table: test4\n Columns: 3\n\n === WriteRowsEvent ===\n Date: 2012-10-07T15:03:16\n Event size: 27\n Read bytes: 10\n Table: test.test4\n Affected columns: 3\n Changed rows: 1\n Values:\n --\n * data : Hello\n * id : 1\n * data2 : World\n\n === XidEvent ===\n Date: 2012-10-07T15:03:16\n Event size: 8\n Read bytes: 8\n Transaction ID: 14097\n\n === QueryEvent ===\n Date: 2012-10-07T15:03:17\n Event size: 49\n Read bytes: 49\n Schema: test\n Execution time: 0\n Query: BEGIN\n\n === TableMapEvent ===\n Date: 2012-10-07T15:03:17\n Event size: 31\n Read bytes: 30\n Table id: 781\n Schema: test\n Table: test4\n Columns: 3\n\n === UpdateRowsEvent ===\n Date: 2012-10-07T15:03:17\n Event size: 45\n Read bytes: 11\n Table: test.test4\n Affected columns: 3\n Changed rows: 1\n Affected columns: 3\n Values:\n --\n * data : Hello => World\n * id : 1 => 1\n * data2 : World => Hello\n\n === XidEvent ===\n Date: 2012-10-07T15:03:17\n Event size: 8\n Read bytes: 8\n Transaction ID: 14098\n\n === QueryEvent ===\n Date: 2012-10-07T15:03:17\n Event size: 49\n Read bytes: 49\n Schema: test\n Execution time: 1\n Query: BEGIN\n\n === TableMapEvent ===\n Date: 2012-10-07T15:03:17\n Event size: 31\n Read bytes: 30\n Table id: 781\n Schema: test\n Table: test4\n Columns: 3\n\n === DeleteRowsEvent ===\n Date: 2012-10-07T15:03:17\n Event size: 27\n Read bytes: 10\n Table: test.test4\n Affected columns: 3\n Changed rows: 1\n Values:\n --\n * data : World\n * id : 1\n * data2 : Hello\n\n === XidEvent ===\n Date: 2012-10-07T15:03:17\n Event size: 8\n Read bytes: 8\n Transaction ID: 14099\n\n\n\nTests\n========\nWhen it's possible we have a unit test.\n\nMore information is available here:\nhttps://python-mysql-replication.readthedocs.org/en/latest/developement.html\n\nChangelog\n==========\nhttps://github.com/julien-duponchelle/python-mysql-replication/blob/main/CHANGELOG\n\nSimilar projects\n==================\n* Kodoma: Ruby-binlog based MySQL replication listener https://github.com/y310/kodama\n* MySQL Hadoop Applier: C++ version http://dev.mysql.com/tech-resources/articles/mysql-hadoop-applier.html\n* Java: https://github.com/shyiko/mysql-binlog-connector-java\n* GO: https://github.com/siddontang/go-mysql\n* PHP: Based on this this project https://github.com/krowinski/php-mysql-replication and https://github.com/fengxiangyun/mysql-replication\n* .NET: https://github.com/SciSharp/dotnet-mysql-replication\n* .NET Core: https://github.com/rusuly/MySqlCdc\n\nSpecial thanks\n================\n* MySQL binlog from Jeremy Cole was a great source of knowledge about MySQL replication protocol https://github.com/jeremycole/mysql_binlog\n* Samuel Charron for his help https://github.com/scharron\n\nContributors\n==============\n\nMajor contributor:\n* Julien Duponchelle Original author https://github.com/noplay\n* bjoernhaeuser for his bugs fixing, improvements and community support https://github.com/bjoernhaeuser\n* Arthur Gautier gtid, slave report... https://github.com/baloo\n\nMaintainer:\n* Julien Duponchelle Original author https://github.com/noplay\n* Sean-k1 https://github.com/sean-k1\n* dongwook-chan https://github.com/dongwook-chan\n\nOther contributors:\n* Dvir Volk for bug fix https://github.com/dvirsky\n* Lior Sion code cleanup and improvements https://github.com/liorsion\n* Lx Yu code improvements, primary keys detections https://github.com/lxyu\n* Young King for pymysql 0.6 support https://github.com/youngking\n* David Reid checksum checking fix https://github.com/dreid\n* Alex Gaynor fix smallint24 https://github.com/alex\n* lifei NotImplementedEvent https://github.com/lifei\n* Maralla Python 3.4 fix https://github.com/maralla\n* Daniel Gavrila more MySQL error codes https://github.com/danielduduta\n* Bernardo Sulzbach code cleanup https://github.com/mafagafogigante\n* Darioush Jalali Python 2.6 backport https://github.com/darioush\n* Jasonz bug fixes https://github.com/jasonzzz\n* Bartek Ogryczak cleanup and improvements https://github.com/vartec\n* Wang, Xiaozhe cleanup https://github.com/chaoslawful\n* siddontang improvements https://github.com/siddontang\n* Cheng Chen Python 2.6 compatibility https://github.com/cccc1999\n* Jffifa utf8mb4 compatibility https://github.com/jffifa\n* Romuald Brunet bug fixes https://github.com/romuald\n* C\u00e9dric Hourcade Don't fail on incomplete dates https://github.com/hc\n* Giacomo Lozito Explicit close stream connection on exception https://github.com/giacomolozito\n* Giovanni F. MySQL 5.7 support https://github.com/26fe\n* Igor Mastak intvar event https://github.com/mastak\n* Xie Zhenye fix missing update _next_seq_no https://github.com/xiezhenye\n* Abrar Sheikh: Multiple contributions https://github.com/abrarsheikh\n* Keegan Parker: secondary database for reference schema https://github.com/kdparker\n* Troy J. Farrell Clear table_map if RotateEvent has timestamp of 0 https://github.com/troyjfarrell\n* Zhanwei Wang Fail to get table informations https://github.com/wangzw\n* Alexander Ignatov Fix the JSON literal\n* Garen Chan Support PyMysql with a version greater than 0.9.3 https://github.com/garenchan\n* Mike Ascah: Add logic to handle inlined ints in large json documents ttps://github.com/mascah\n* Hiroaki Kawai: PyMySQL 1.0 support (https://github.com/hkwi)\n* Dongwook Chan: Support for ZEROFILL, Correct timedelta value for negative MySQL TIME datatype, Fix parsing of row events for MySQL8 partitioned table, Parse status variables in query event, Parse status variables in query event , Fix parse errors with MariaDB (https://github.com/dongwook-chan)\n* Paul Vickers: Add support for specifying an end log_pos (https://github.com/paulvic)\n* Samira El Aabidi: Add support for MariaDB GTID (https://github.com/Samira-El)\n* Oliver Seemann: Handle large json, github actions,\nZero-pad fixed-length binary fields (https://github.com/oseemann)\n* Mahadir Ahmad: Handle null json payload (https://github.com/mahadirz)\n* Axel Viala: Removal of Python 2.7 (https://github.com/darnuria)\n* Etern: Add XAPrepareEvent, parse last_committed & sequence_number of GtidEvent (https://github.com/etern)\n\nThanks to GetResponse for their support\n\nLicence\n=======\nCopyright 2012-2023 Julien Duponchelle\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"bugtrack_url": null,
"license": "Apache 2",
"summary": "Pure Python Implementation of MySQL replication protocol build on top of PyMYSQL.",
"version": "1.0.9",
"project_urls": {
"Homepage": "https://github.com/julien-duponchelle/python-mysql-replication"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "57afe23aa4e52a094e865554998112f0d94751072b1f076f16ac970ce93e6002",
"md5": "c937a241e848b5d316bba88b06279119",
"sha256": "eb5603256cc18892bbccce30b6e7c800ec8f6bfe4e44add79f9b88d222322064"
},
"downloads": -1,
"filename": "mysql_replication-1.0.9.tar.gz",
"has_sig": false,
"md5_digest": "c937a241e848b5d316bba88b06279119",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 71567,
"upload_time": "2024-08-11T15:44:07",
"upload_time_iso_8601": "2024-08-11T15:44:07.280654Z",
"url": "https://files.pythonhosted.org/packages/57/af/e23aa4e52a094e865554998112f0d94751072b1f076f16ac970ce93e6002/mysql_replication-1.0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-11 15:44:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "julien-duponchelle",
"github_project": "python-mysql-replication",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mysql-replication"
}