Um pacote para processamento em lote usando MongoDB
Project description
Batch Processor Custom
This package provides an efficient solution for batch processing of data in MongoDB collections. It enables reading, locking, processing, and unlocking records in batches, facilitating the management and scalable processing of large data volumes.
Features
- Configurable connection to any MongoDB instance.
- Efficient handling of record locking and unlocking to ensure data integrity during batch processing.
- Ability to process batches of specified size, suitable for large-scale data operations.
Installation
You can install this package using pip:
pip install batch_processor_custom
## Usage
from batch_processor_custom import BatchProcessor
# Initialize the processor
processor = BatchProcessor('mongodb://localhost:27017', 'your_database', 'your_collection')
# Process batches
for batch_id, records in processor.process_batches(10, 100):
print(f'Processing batch {batch_id}')
# Here you can add your processing logic
processor.unlock_records([record['_id'] for record in records])
##License
This project is licensed under the MIT License - see the LICENSE file for details.
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 batch_processor_custom-0.1.1.tar.gz.
File metadata
- Download URL: batch_processor_custom-0.1.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e14dd4e0dd4d62cb24d15b7ad53841b82e8c1fb376bc610952adaf6e5ab53e87
|
|
| MD5 |
7c0a48f79ab778cf8e6485dad209d6d7
|
|
| BLAKE2b-256 |
a34f8a613f4b88cf8ec61be8ff4182aaa00d93c885f29d602d9d1a1256867275
|
File details
Details for the file batch_processor_custom-0.1.1-py3-none-any.whl.
File metadata
- Download URL: batch_processor_custom-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4446802537a7aa0fd2edc6de5006a8319070ec7e926d16b87e9eaa11be2724c
|
|
| MD5 |
228fe48c1a8f972f75abbfd6cf01f0c0
|
|
| BLAKE2b-256 |
c6869ab9ef74f5d699a08ca51e3928dd27cbef98e49ff0a2a1d7d307f5e6f2a1
|