Skip to main content

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

  1. Set Project Root Directory
  2. Create a Directory and Save to CSV
  3. Create a File and Save to CSV
  4. List All Paths in CSV
  5. Remove a Path from CSV
  6. Generate Paths Python File
  7. Add a Path to CSV
  8. 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


Download files

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

Source Distribution

path_chronicle-0.1.5.7.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

path_chronicle-0.1.5.7-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file path_chronicle-0.1.5.7.tar.gz.

File metadata

  • Download URL: path_chronicle-0.1.5.7.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

Hashes for path_chronicle-0.1.5.7.tar.gz
Algorithm Hash digest
SHA256 dfdf23c196c913e06650abfa3b13619153a78175f37aec04ac1337be6ef75d85
MD5 239a08a3d5b14a9a5ec1be0654531b74
BLAKE2b-256 eef29970746a7fea05c57c969e40d634f8d39da383a6d61be1ccb119b822a779

See more details on using hashes here.

File details

Details for the file path_chronicle-0.1.5.7-py3-none-any.whl.

File metadata

File hashes

Hashes for path_chronicle-0.1.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 74406624bbbad7e1a03e1b78f038d13c51ea6ced9fba15a402c68216f29abea0
MD5 9622967992278f607296243bcd26d463
BLAKE2b-256 e90b455ad9d1510d6b3dc866b9ba04ec874eb579255cfca029c608e72c628887

See more details on using hashes here.

Supported by

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