# FileContentExtractor
**Languages:** [🇺🇸English](README.md) | [🇰🇷한êµì–´](README_ko.md)
`FileContentExtractor` is a versatile Python tool designed to recursively extract and save the contents of text files in a directory. It provides various options to ignore specific files or directories, filter files based on several criteria, and output file paths as either absolute or relative paths. The tool also includes user confirmation, version display, and help options for better usability.
## Features
- Recursively traverses directories and extracts the content of text files.
- Allows you to ignore specific files, directories, or patterns using a `.conf` file.
- 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.
- Prompts user confirmation before proceeding with extraction.
- Provides version information and help details via command-line options.
## Installation
You can install the package via `pip`:
```bash
pip install file-content-extractor
```
## Usage
1. **Basic command**:
- Default usage (relative paths):
```bash
fce
```
- After running this command, you will be prompted to confirm the extraction by typing `y`.
- Use absolute paths:
```bash
fce -a
```
2. **Specify additional options**:
- Ignore specific files or directories:
```bash
fce -i my_ignore_list.conf
```
- Save output to a custom file:
```bash
fce -o my_output.txt
```
- Filter by file extension, size, and modification date:
```bash
fce -e .txt,.py -m 1024 -M 1048576 -d 2023-01-01
```
- Split output into multiple files:
```bash
fce -s 10485760
```
- Specify the directory to start extraction from:
```bash
fce -p /path/to/directory
```
3. **Check version**:
- To display the current version of the tool:
```bash
fce -v
```
4. **Help**:
- To display help information and usage details:
```bash
fce -h
```
## Options
- `-a`, `--absolute`: Use absolute paths in the output.
- `-i <file>`, `--ignore=<file>`: Specify a custom ignore file (default is `ignore.conf`).
- `-o <file>`, `--output=<file>`: Specify a custom output file (default is `output.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.
- `--tree`: Print the directory tree of the current path and add it to the output file.
- `--include-ignored`: Include files and directories listed in the `ignore.conf` when printing the directory tree.
- `-h`, `--help`: Show this help message and exit.
- `-v`, `--version`: Show version information and exit.
## Contributing
Contributions are welcome! Feel free to submit a Pull Request.
## License
This project is licensed
under the MIT License. See the [LICENSE](LICENSE) file for details.
## Author
- **Daniel** - [joonheeu](https://github.com/joonheeu) - daniel@udit.one
- **Company**: UDIT
Raw data
{
"_id": null,
"home_page": "https://github.com/joonheeu/file-content-extractor",
"name": "file-content-extractor",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Daniel",
"author_email": "daniel@udit.one",
"download_url": "https://files.pythonhosted.org/packages/99/6e/d8efe0d28a33e9e51c6a598a34eb6d768f97ce0670576fd96a63003cee23/file_content_extractor-0.3.7.tar.gz",
"platform": null,
"description": "\n# FileContentExtractor\n\n**Languages:** [\ud83c\uddfa\ud83c\uddf8English](README.md) | [\ud83c\uddf0\ud83c\uddf7\ud55c\uad6d\uc5b4](README_ko.md)\n\n`FileContentExtractor` is a versatile Python tool designed to recursively extract and save the contents of text files in a directory. It provides various options to ignore specific files or directories, filter files based on several criteria, and output file paths as either absolute or relative paths. The tool also includes user confirmation, version display, and help options for better usability.\n\n## Features\n\n- Recursively traverses directories and extracts the content of text files.\n- Allows you to ignore specific files, directories, or patterns using a `.conf` file.\n- Outputs file paths as either relative or absolute paths.\n- Supports filtering files by extension, size, and modification date.\n- Allows splitting output into multiple files based on size.\n- Displays a progress bar during extraction.\n- Prompts user confirmation before proceeding with extraction.\n- Provides version information and help details via command-line options.\n\n## Installation\n\nYou can install the package via `pip`:\n\n```bash\npip install file-content-extractor\n```\n\n## Usage\n\n1. **Basic command**:\n\n - Default usage (relative paths):\n\n ```bash\n fce\n ```\n\n - After running this command, you will be prompted to confirm the extraction by typing `y`.\n\n - Use absolute paths:\n\n ```bash\n fce -a\n ```\n\n2. **Specify additional options**:\n\n - Ignore specific files or directories:\n\n ```bash\n fce -i my_ignore_list.conf\n ```\n\n - Save output to a custom file:\n\n ```bash\n fce -o my_output.txt\n ```\n\n - Filter by file extension, size, and modification date:\n\n ```bash\n fce -e .txt,.py -m 1024 -M 1048576 -d 2023-01-01\n ```\n\n - Split output into multiple files:\n\n ```bash\n fce -s 10485760\n ```\n\n - Specify the directory to start extraction from:\n\n ```bash\n fce -p /path/to/directory\n ```\n\n3. **Check version**:\n\n - To display the current version of the tool:\n\n ```bash\n fce -v\n ```\n\n4. **Help**:\n\n - To display help information and usage details:\n\n ```bash\n fce -h\n ```\n\n## Options\n\n- `-a`, `--absolute`: Use absolute paths in the output.\n- `-i <file>`, `--ignore=<file>`: Specify a custom ignore file (default is `ignore.conf`).\n- `-o <file>`, `--output=<file>`: Specify a custom output file (default is `output.txt`).\n- `-e <ext1,ext2,...>`, `--extensions=<ext1,ext2,...>`: Specify file extensions to include (e.g., `.txt,.py`).\n- `-m <bytes>`, `--min-size=<bytes>`: Specify minimum file size to include.\n- `-M <bytes>`, `--max-size=<bytes>`: Specify maximum file size to include.\n- `-d <YYYY-MM-DD>`, `--modified-after=<YYYY-MM-DD>`: Include only files modified after a specific date.\n- `-s <bytes>`, `--split-size=<bytes>`: Split output files into chunks of the specified size.\n- `-p <directory>`, `--path=<directory>`: Specify the directory to start extraction from.\n- `--tree`: Print the directory tree of the current path and add it to the output file.\n- `--include-ignored`: Include files and directories listed in the `ignore.conf` when printing the directory tree.\n- `-h`, `--help`: Show this help message and exit.\n- `-v`, `--version`: Show version information and exit.\n\n## Contributing\n\nContributions are welcome! Feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed\n\n under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Author\n\n- **Daniel** - [joonheeu](https://github.com/joonheeu) - daniel@udit.one\n- **Company**: UDIT\n",
"bugtrack_url": null,
"license": null,
"summary": "A tool to extract content from text files in a directory, with options to ignore certain files and directories.",
"version": "0.3.7",
"project_urls": {
"Homepage": "https://github.com/joonheeu/file-content-extractor"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2baaa99e2368a00f7d7de17e14691c466e90211499640bfa9a1914a5f03fe122",
"md5": "b2ed35a8e4f54918030b6013bce76afc",
"sha256": "789f7d79544961972e2e356c16ba56c69e9943985aaec85a69461270c9873c73"
},
"downloads": -1,
"filename": "file_content_extractor-0.3.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b2ed35a8e4f54918030b6013bce76afc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 8912,
"upload_time": "2024-09-03T13:51:46",
"upload_time_iso_8601": "2024-09-03T13:51:46.883889Z",
"url": "https://files.pythonhosted.org/packages/2b/aa/a99e2368a00f7d7de17e14691c466e90211499640bfa9a1914a5f03fe122/file_content_extractor-0.3.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "996ed8efe0d28a33e9e51c6a598a34eb6d768f97ce0670576fd96a63003cee23",
"md5": "db5a1a2ab8e78bc61f872aafc95aea31",
"sha256": "870035bdd5194a430661b40918d392ee7d4727b199faa7130f078d5218519a20"
},
"downloads": -1,
"filename": "file_content_extractor-0.3.7.tar.gz",
"has_sig": false,
"md5_digest": "db5a1a2ab8e78bc61f872aafc95aea31",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7310,
"upload_time": "2024-09-03T13:51:47",
"upload_time_iso_8601": "2024-09-03T13:51:47.839219Z",
"url": "https://files.pythonhosted.org/packages/99/6e/d8efe0d28a33e9e51c6a598a34eb6d768f97ce0670576fd96a63003cee23/file_content_extractor-0.3.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-03 13:51:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "joonheeu",
"github_project": "file-content-extractor",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "file-content-extractor"
}