Skip to main content

No project description provided

Project description

My-Exporter

A Python tool to export the contents of a folder into a single text file while respecting .gitignore patterns and maintaining the hierarchical structure.

Table of Contents

Features

  • Respect .gitignore Patterns: Automatically excludes files and directories based on your .gitignore file.
  • Hierarchical Structure: Maintains the folder hierarchy in the output by using relative file paths as headers.
  • Customizable Output: Specify the root directory, output file name, and ignore file.
  • Handles Non-Text Files: Gracefully handles non-text or unreadable files by indicating their presence without content.

Installation

You can install my-exporter via PyPI using pip:

pip install my-exporter

Alternatively, you can install it directly from the source:

git clone https://github.com/RK0429/my-exporter.git
cd my-exporter
pip install .

Usage

Command-Line Interface

After installation, you can use the my-exporter CLI tool to export your folder contents.

Basic Usage:

my-exporter --root-dir path/to/project --output-file exported.txt

Options:

  • --root-dir: Specifies the root directory to start exporting from. Defaults to the current directory (.).
  • --output-file: Defines the name of the output text file. Defaults to output.txt.
  • --ignore-file: Specifies a custom ignore file. Defaults to .gitignore.

Example:

my-exporter --root-dir ./my_project --output-file project_contents.txt

Programmatic Usage

You can also use my-exporter as a library within your Python projects.

Example:

from my_exporter import export_folder_contents

export_folder_contents(
    root_dir='path/to/project',
    output_file='exported_contents.txt',
    ignore_file='.gitignore'
)

Configuration

  • .gitignore Support: The tool uses your .gitignore file to determine which files and directories to exclude. Ensure that your .gitignore is properly configured in the root directory you are exporting.

  • Custom Ignore Files: If you prefer to use a different ignore file, specify it using the --ignore-file option.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the Repository: Click the "Fork" button on the repository page.

  2. Create a Feature Branch:

    git checkout -b feature/my-new-feature
    
  3. Commit Your Changes:

    git commit -m "Add some feature"
    
  4. Push to the Branch:

    git push origin feature/my-new-feature
    
  5. Open a Pull Request: Describe your changes and submit the pull request.

Please make sure to update tests as appropriate and adhere to the PEP 8 style guide.

License

This project is licensed under the MIT License.

Contact

Your Name
Email: s.woods.m.29@gmail.com
GitHub: https://github.com/RK0429

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

my_exporter-0.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

my_exporter-0.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file my_exporter-0.2.0.tar.gz.

File metadata

  • Download URL: my_exporter-0.2.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.5 Windows/11

File hashes

Hashes for my_exporter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fa93cfe1c57c2fc35315cb0e12012d91d4db6cffdc6edfaaf5091c3bc516a5f6
MD5 12a68f8d16a64ba79631ea88a6f231c4
BLAKE2b-256 3224dc70ee8de9cc4260d33c90ba118b28598324b46a9e76d69e5a7b10e81ea7

See more details on using hashes here.

File details

Details for the file my_exporter-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: my_exporter-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.5 Windows/11

File hashes

Hashes for my_exporter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d0d2f479a92cad991e312e36f034e607fb70315bced6a5923d2369542b44348
MD5 377f83af9f569ce596411cbe5cd86d26
BLAKE2b-256 e6925e02984afbbfa5daa3a98ab758d4ff592cefbf137bfdc9bdaf7e7340db07

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