No project description provided
Project description
path-chronicle
This library is for efficiently managing paths in a project. This README describes the standard usage of this library and the commands that can be used.
Standard Usage
1. Install
pip install path-chronicle
2. Set project root directory
※Please run it first after installation
pcsetpjroot ./
3. Create a directory
pcmkdir test_dir
id,name,path,description
1,test_dir,test_dir,
4. Create a file
pctouch test_dir/test.txt
id,name,path,description
1,test_dir,test_dir,
2,test.txt,test_dir/test.txt,
Import PathArchives
Commands
- Set Project Root Directory
- Create a Directory and Save to CSV
- Create a File and Save to CSV
- List All Paths in CSV
- Remove a Path from CSV
- Generate Paths Python File
- Add a Path to CSV
- Remove a Path from CSV by Criteria
Set Project Root Directory
Sets the project root directory in the config file.
Example Usage
pcsetpjroot ./
pcsetpjroot /path/to/project
Create a Directory and Save to CSV
Creates a directory and optionally saves the path info to the CSV file.
Example Usage
pcmkdir ./my_temp_directory --description "Temporary directory for storage"
Create a File and Save to CSV
Creates a file and optionally saves the path info to the CSV file.
Example Usage
pctouch ./my_temp_directory/another_file.txt --description "Another file for testing"
List All Paths in CSV
Lists all paths stored in the CSV file.
Example Usage
pcpathslist
Remove a Path from CSV
Removes a path based on ID, name, or path, and also removes it from the CSV file.
Example Usage
pcrmpath --id 1
pcrmpath --name example_name
pcrmpath --path /example/path/to/delete
Generate Paths Python File
Generates a Python file with paths for project directories and files.
Example Usage
gpaths
gpaths --csv_root_dir ./csv --module_root_dir ./path_module --module_name paths.py
Example of Module Created
from pathlib import Path
class PathArchives:
"""
This class provides paths for various project directories and files.
"""
my_temp_directory = Path('my_temp_directory')
another_file_txt = Path('my_temp_directory/another_file.txt')
@staticmethod
def get_path(name: str) -> Path:
"""
Returns the Path object for the given name.
Available paths:
- my_temp_directory: my_temp_directory
- another_file_txt: my_temp_directory/another_file.txt
"""
return getattr(PathArchives, name, None) or Path("")
Add a Path to CSV
Adds a path to the CSV file.
Example Usage
pcaddtocsv ./my_temp_directory --description "Temporary directory for storage"
Remove a Path from CSV by Criteria
Removes a path from the CSV file based on ID, name, or path.
Example Usage
pcrmtocsv --id 1
pcrmtocsv --name example_name
pcrmtocsv --path /example/path/to/delete
Common Arguments
path
: The path to the directory or file.--description
: A description for the directory or file.--csv_name
: Name of the CSV file for storing paths. Default is "paths.csv".--csv_root_dir
: Root directory where the CSV file will be stored.--csv_dir_name
: Name of the directory containing the CSV file. Default is "csv".--no-save
: Do not save the path to the CSV file.--config_root_dir
: Root directory where the config file is located.
This guide provides a comprehensive overview of the commands available in the Path Chronicle CLI for managing paths in your project. Each command includes example usage and the corresponding function definition.
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
File details
Details for the file path_chronicle-0.1.5.6.tar.gz
.
File metadata
- Download URL: path_chronicle-0.1.5.6.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6ed000249ecd1351e7c09652700d219d17cc1075652932fc0b59e049bb7ecba |
|
MD5 | 6394fe1bc562493d3a37f62113503519 |
|
BLAKE2b-256 | 47225238dcef9130c43c26e2aa48dd6e5fec5737173ea1f5732468e50c5ccdd0 |
File details
Details for the file path_chronicle-0.1.5.6-py3-none-any.whl
.
File metadata
- Download URL: path_chronicle-0.1.5.6-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e8eae1d002373dca00b0f82ddc61d74d95bbec7236da6a91a41d51a8be7114c |
|
MD5 | 2e5605a1def246556acb0233d9b81b56 |
|
BLAKE2b-256 | 579fb800a08b72dba068d8fff271f034862e6af932068feaaf9718f9dc6fc559 |