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
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 hidir-0.0.1.tar.gz.
File metadata
- Download URL: hidir-0.0.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2480f44edf8478912555952bf857c294ca294e2c50cf6596e07350731c52cd30
|
|
| MD5 |
122950fc7f1f1f27b35361424194eba5
|
|
| BLAKE2b-256 |
871bc97682c1b43d026efb82882294c7f50423cfbdc400987cb4935c7d7b3a85
|
File details
Details for the file hidir-0.0.1-py3-none-any.whl.
File metadata
- Download URL: hidir-0.0.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8369239ad66337b379cd2cd26f493d7a5a8a0b50e5f1a4b3c562757974a41d65
|
|
| MD5 |
6ed5ae5d16e90a381cff567d8ee2e68f
|
|
| BLAKE2b-256 |
407892324f901ac34aac0db99835761742172557f8ab3f5d2957b4daba9db557
|