Skip to main content

No project description provided

Project description

How to Use Path Chronicle CLI

This guide provides instructions on how to use the Path Chronicle command-line interface (CLI) for managing paths in your project. Below are the available commands and how to use them.

Where to get it

pip install path-chronicle

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

※Recommended to run immediately after installation

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.4.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

path_chronicle-0.1.4-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: path_chronicle-0.1.4.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1025-azure

File hashes

Hashes for path_chronicle-0.1.4.tar.gz
Algorithm Hash digest
SHA256 22b072ee54324b8f4c5c5808b9bfad24fbb47bb9fca63dd3443785ee0935e466
MD5 4d78b565b4aa51a4f261ab8159e62208
BLAKE2b-256 7e15fd613ca010fe1446decb6a97b4f7487e3e0938d4ccb072941e5c0c1f0307

See more details on using hashes here.

File details

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

File metadata

  • Download URL: path_chronicle-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1025-azure

File hashes

Hashes for path_chronicle-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8a365ea925a55fd292a3260f41491e67687d364239dfe0fdfec62d67dce4766c
MD5 73c4641a04c0d7aeb3f737b45fdfb64d
BLAKE2b-256 c05ed5be0ccd780643c26e3a5d89cf1103e053253046e6d9aa7d6653c0a4fb18

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