A tool to extract content from text files in a directory, with options to ignore certain files and directories.
Project description
FileContentExtractor
FileContentExtractor is a Python tool designed to recursively extract and save the contents of text files in a directory. It provides options to ignore specific files or directories, filter files based on various criteria, and output file paths as either absolute or relative paths.
Features
- Recursively traverses directories and extracts the content of text files.
- Allows you to ignore specific files, directories, or patterns using a
.ignorelistfile. - Outputs file paths as either relative or absolute paths.
- Supports filtering files by extension, size, and modification date.
- Allows splitting output into multiple files based on size.
- Displays a progress bar during extraction.
Installation
You can install the package via pip:
pip install file-content-extractor
Usage
-
Basic command:
-
Default usage (relative paths):
file_extractor
-
Use absolute paths:
file_extractor -a
-
-
Specify additional options:
-
Ignore specific files or directories:
file_extractor -i my_ignore_list.txt
-
Save output to a custom file:
file_extractor -o my_output.txt
-
Filter by file extension, size, and modification date:
file_extractor -e .txt,.py -m 1024 -M 1048576 -d 2023-01-01
-
Split output into multiple files:
file_extractor -s 10485760
-
Specify the directory to start extraction from:
file_extractor -p /path/to/directory
-
Options
-a,--absolute: Use absolute paths in the output.-i <file>,--ignore=<file>: Specify a custom ignore file (default is.ignorelist).-o <file>,--output=<file>: Specify a custom output file (default isoutput.txt).-e <ext1,ext2,...>,--extensions=<ext1,ext2,...>: Specify file extensions to include (e.g.,.txt,.py).-m <bytes>,--min-size=<bytes>: Specify minimum file size to include.-M <bytes>,--max-size=<bytes>: Specify maximum file size to include.-d <YYYY-MM-DD>,--modified-after=<YYYY-MM-DD>: Include only files modified after a specific date.-s <bytes>,--split-size=<bytes>: Split output files into chunks of the specified size.-p <directory>,--path=<directory>: Specify the directory to start extraction from.
Contributing
Contributions are welcome! Feel free to submit a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
- Daniel - joonheeu - daniel@udit.one
- Company: UDIT
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 file_content_extractor-0.1.3.tar.gz.
File metadata
- Download URL: file_content_extractor-0.1.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06595feb86e71c67d7b438ff34273c44371d659a84d64b7b71cfa41056a724bc
|
|
| MD5 |
ca28a0073515756f06020d34cd9470e1
|
|
| BLAKE2b-256 |
874d2573f56de506d8c10e7e56cd98247adab3b8caeda22983f9bacfe0e32ae2
|
File details
Details for the file file_content_extractor-0.1.3-py3-none-any.whl.
File metadata
- Download URL: file_content_extractor-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b04dfe0bb8e857257a462275b0d57e48f83e3b593fa72e5f9d0720e00fd4cb20
|
|
| MD5 |
e435ae79478d166217f09ca27028691d
|
|
| BLAKE2b-256 |
e89d02e9495cf950a059f0124fc3d670cb9007e832507f09d14c7860c089ccbf
|