https://github.com/absaoss/py2k
A Python to Kafka Serialization Tool
https://github.com/absaoss/py2k
pandas-dataframes python
Last synced: 2 months ago
JSON representation
A Python to Kafka Serialization Tool
- Host: GitHub
- URL: https://github.com/absaoss/py2k
- Owner: AbsaOSS
- License: apache-2.0
- Created: 2021-03-01T12:17:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-27T01:08:59.000Z (over 2 years ago)
- Last Synced: 2024-10-12T19:50:39.307Z (8 months ago)
- Topics: pandas-dataframes, python
- Language: Python
- Homepage:
- Size: 462 KB
- Stars: 13
- Watchers: 4
- Forks: 1
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Welcome to Py2k
[](https://github.com/AbsaOSS/py2k/actions/workflows/ci.yml)
[](https://codecov.io/gh/AbsaOSS/py2k)
[](https://pypi.python.org/pypi/py2k)
[](https://pypistats.org/packages/py2k)
[](https://github.com/AbsaOSS/py2k)
[](https://github.com/AbsaOSS/py2k/blob/main/LICENSE)A high level Python to Kafka API with Schema Registry compatibility and automatic avro schema creation.
- Free software: Apache2 license
## Installation
Py2K is currently available on PIP:
```bash
pip install py2k
```## Documentation
You can view additional documentation on our [website](https://absaoss.github.io/py2k).
## Contributing
Please see the [Contribution Guide](.github/CONTRIBUTING.md) for more information.
## Usage
### Minimal Example
```python
from py2k.record import PandasToRecordsTransformer
from py2k.writer import KafkaWriter# assuming we have a pandas DataFrame, df
records = PandasToRecordsTransformer(df=df, record_name='test_model').from_pandas()writer = KafkaWriter(
topic="topic_name",
schema_registry_config=schema_registry_config,
producer_config=producer_config
)writer.write(records)
```For additional examples please see the [examples](./examples) folder
## Features
- Schema Registry Integration
- Automatic Avro Serialization from pandas DataFrames
- Automatic Avro Schema generation from pandas DataFrames and Pydantic objects## License
Copyright 2021 ABSA Group Limited
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 athttp://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.