This library provides the mechanism to implement Change Data Capture (CDC) services...
Project description
core-cdc (CDC a.k.a Change Data Capture)
It provides the core mechanism and required resources to implement “Change Data Capture” services…
Installation
Install from PyPI using pip:
pip install core-cdc
uv pip install core-cdc # Or using UV...
Features
- Multi-Database CDC Support
MySQL Binary Log (BinLog) based change capture
MongoDB Change Streams for real-time event streaming
Extensible processor architecture for additional database engines
- Comprehensive Event Handling
DML operations: INSERT, UPDATE, DELETE
DDL operations: CREATE, ALTER, DROP (schemas and tables)
Configurable event filtering by operation type
- Flexible Target Replication
MySQL target for database-to-database replication
Snowflake target for data warehouse integration
Support for multiple simultaneous targets
- Standardized Data Format
Common Record structure for cross-service integration
Includes metadata: timestamps, transaction IDs, source position
JSON serialization support for streaming and messaging systems
- Production-Ready Features
Built-in error handling and retry mechanisms
Comprehensive logging for monitoring and debugging
Optional event timestamp column for UPSERT/MERGE operations
Quick Start
Installation
Install the package:
pip install core-cdc
uv pip install core-cdc # Or using UV...
pip install -e ".[dev]" # For development...
Setting Up Environment
Install required libraries:
pip install --upgrade pip
pip install virtualenv
Create Python virtual environment:
virtualenv --python=python3.12 .venv
Activate the virtual environment:
source .venv/bin/activate
Install packages
pip install .
pip install -e ".[dev]"
Optional libraries
pip install '.[all]' # For all...
pip install '.[mysql]'
pip install '.[mongo]'
pip install '.[snowflake]'
Check tests and coverage
python manager.py run-tests
python manager.py run-tests --test-type integration
python manager.py run-coverage
# Having the docker containers up and running you can execute the functional
# tests that ensure the CDC services are working as expected...
python manager.py run-tests --test-type functional --pattern "*.py"
Implemented CDC Engines
The following database engines have CDC implementations:
Fully Implemented
- MySQL - Binary Log (BinLog) based CDC
Uses mysql-replication library
Captures INSERT, UPDATE, DELETE operations
Supports DDL events (CREATE, ALTER, DROP)
Fallback mechanism for column name resolution
- MongoDB - Change Streams based CDC
Uses native MongoDB Change Streams
Captures INSERT, UPDATE, DELETE operations
Requires replica set configuration
Real-time event streaming
In Development
- MS SQL Server - Abstract base class defined
- Oracle - Abstract base class defined
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Write tests for new functionality
Ensure all tests pass: pytest -n auto
Run linting: pylint core_cdc
Run security checks: bandit -r core_cdc
Submit a pull request
License
This project is licensed under the MIT License. See the LICENSE file for details.
Links
Support
For questions or support, please open an issue on GitLab or contact the maintainers.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file core_cdc-2.0.2.tar.gz.
File metadata
- Download URL: core_cdc-2.0.2.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a1808e3e4a5044cea89457a488d0568d54139dae29ba5cc7f5c03be4381d1b3
|
|
| MD5 |
6800908cf056c36d87323221634c7731
|
|
| BLAKE2b-256 |
bb6b6bb83e64227275318612b7678b4268b83965c196b1708292e4bd3cec80b2
|
File details
Details for the file core_cdc-2.0.2-py3-none-any.whl.
File metadata
- Download URL: core_cdc-2.0.2-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c90773cc6360c17f35828798e42d1026c9022ffd9484e19aee5021072262a377
|
|
| MD5 |
8cda2c14575fe1b3712ae30b3577af68
|
|
| BLAKE2b-256 |
121203ab18ac3823304006aa427149bf9f4fecfa2065c4edf5b240c9343c1571
|