Skip to main content

No project description provided

Project description

HiDir: Hierarchical Directory

HiDir is a Python package designed to efficiently manage and organize files within a Hierarchical Directory structure. It provides operations to map, check, move, and copy files based on customizable strategies for file identification and path generation.

Installation

You can install DirectoryManager via pip:

pip install hidir

Usage

Initialization

Create an instance of DirectoryManager by specifying the root directory and optional parameters:

from hidir import DirectoryManager

manager = DirectoryManager(root='/path/to/folder', strategy='SHA-256')

files_predict and clear_index is optional parameters. files_predict is the estimated number of files. clear_index is a boolean value indicating whether to forbid the system file index.

Method

  • get_base_path(file_name): Get the base path for a file based on its name.
  • check_file(file_name): Check if a file exists by its name and return its path if it exists.
  • move_file(file_path): Move a file to its designated path.
  • copy_file(file_path): Copy a file to its designated path.

Example

# Move a file to its designated folder
manager.move_file('/path/to/file.txt')

# Copy a file to its designated folder
manager.copy_file('/path/to/file.txt')

# Check if a file exists and get its path
file_path = manager.check_file('file.txt')
if file_path:
    print(f'File exists at: {file_path}')
else:
    print('File does not exist.')

Contributing

If you find a bug :bug:, please open a bug report. If you have an idea for an improvement or new feature :rocket:, please open a feature request.

License

This package was started off with the python-package-template. This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hidir-0.0.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hidir-0.0.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file hidir-0.0.2.tar.gz.

File metadata

  • Download URL: hidir-0.0.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for hidir-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1d890d458b71bfa8de07928b6242e10919c4f70f0f326164d792456a6d926f59
MD5 a95469cc86709975940bfd3d76684eb6
BLAKE2b-256 3a911cb744439d98c6c87a7eb04266a7ae9c002f04393c25b30f92312336d9b9

See more details on using hashes here.

File details

Details for the file hidir-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: hidir-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for hidir-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 13919c8b285602b70d80c18173e63ccecac7d1f42298bfd640582a217f33047d
MD5 689a8c5a6b7320fda7d99ee7d7e10a45
BLAKE2b-256 0aa6906584e5d7df151c3bcadf84b04042cac01f24912896088aebc8ea9fcac2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page