Data Merger: A Python package for merging data from two tables in a MySQL database. The service reads a configuration file that specifies the details of the merge operation, such as the names of the tables, the keys to join on, the type of join, and the output file name. Easy to use and highly flexible, Data Merger simplifies the process of merging data.
Project description
Data Merger Service
Data Merger Service is a Python package that provides a simple and flexible way to merge data from two tables in a MySQL database. The service reads a configuration file that specifies the details of the merge operation, such as the names of the tables, the keys to join on, the type of join, and the output file name.
Installation
You can install DataMerger from PyPI:
pip install atreign-datamanager
Usage
To use Data Merger Service, you need to create a configuration file in JSON format. Here’s an example:
{
"database_config": {
"server_host": "localhost",
"server_port": "3306",
"user_name": "root",
"user_password": "password",
"database_name": "database_name"
},
"data_merge_operations": [
{
"left_data_table": {
"table_name": "table1",
"merge_keys": ["key1", "key3"]
},
"right_data_table": {
"table_name": "table2",
"merge_keys": ["key2", "key4"]
},
"merge_type": "inner",
"column_suffixes": ["_from_left_table", "_from_right_table"],
"output_file_name": "merged_data_output.csv"
}
]
}
Once you have your configuration file, you can perform the merge operation with a single function call:
from data_merger import perform_merge_from_config
perform_merge_from_config('config.json')
Replace 'config.json' with the path to your actual configuration file.
Root Directory Structure
data_merger_atlas_reign/
│
├── data_merger/
│ ├── __init__.py
│ ├── config_loader.py
│ ├── database_connector.py
│ ├── data_operations.py
│ └── logger.py
│
├── tests/
│ ├── __init__.py
│ ├── test_config_loader.py
│ ├── test_database_connector.py
│ └── test_data_operations.py
│
├── server_logs/
│ └── DataMerger.log
│
├── config.json
├── test_config.json
├── requirements.txt
├── setup.py
└── main.py
Contributing
If you want to contribute to this project, please submit a pull request.
License
This project is licensed under the MIT License.
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
File details
Details for the file atreign-datamanager-0.0.2.tar.gz
.
File metadata
- Download URL: atreign-datamanager-0.0.2.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c86a10a5352344a751bdb15a90b711291280028995448eddb351db3c5a3a1c0a |
|
MD5 | aa6acb666d62526872734d184a07ead0 |
|
BLAKE2b-256 | 03552b294ca0ee216214e98c794b222080953ba2ae424185ead2036719498d7e |