Skip to content

chigwell/BulkFileOperationsManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI version License: MIT Downloads

BulkFileOperationsManager

BulkFileOperationsManager is a Python tool designed to manage and execute bulk Create, Read, Update, and Delete (CRUD) operations on files, especially useful for handling large files that need to be processed in chunks to fit into memory constraints.

Installation

To install BulkFileOperationsManager, you can use pip:

pip install BulkFileOperationsManager

Usage

As a Python Module

BulkFileOperationsManager can be used as a Python module in your scripts for orchestrating bulk file operations.

Adding and Executing Tasks

from bulkfileoperationsmanager.bulk_operations_manager import BulkOperationsManager
from filechunkcrud import FileHandler

# Initialize the manager
manager = BulkOperationsManager()

# Example of adding and executing a create task
file_path = '/path/to/your/largefile.txt'
manager.add_task(("create", file_path, "Initial content"))
manager.run()

# Example of adding and executing a read task with handler
def read_handler(chunk):
    print(chunk)  # or process the chunk

manager.add_task(("read", file_path, 1024, read_handler))
manager.run()

# Example of adding and executing an update task with content generator
def additional_data_generator():
    yield "\nMore data...\n"

manager.add_task(("update", file_path, additional_data_generator()))
manager.run()

# Example of adding and executing a delete task
manager.add_task(("delete", file_path))
manager.run()

Features

  • Manage Bulk Operations: Efficiently manage and execute multiple file operations in a queue-based system.
  • Integration with FileChunkCRUD: Seamlessly integrates with FileChunkCRUD for handling large files in chunks.
  • Supports CRUD operations: Supports creating, reading, updating, and deleting files, especially suitable for large files.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages