FileHarvestor


NameFileHarvestor JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/Hardvan/FileHarvestor
SummaryFileHarvestor is a Python utility that reads the contents of specified files and writes them to both text and markdown files. If a file does not exist, it is added to a list of not found files. This tool is useful for consolidating and documenting the contents of multiple files in a directory.
upload_time2024-02-19 11:50:19
maintainer
docs_urlNone
authorHardik Pawar
requires_python>=3.6
license
keywords file harvestor read write text markdown file-reader read-file
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FileHarvestor

This script is a Python utility that reads the contents of specified files and writes them to both text and markdown files. If a file does not exist, it is added to a list of not found files. This tool is useful for consolidating and documenting the contents of multiple files in a directory.

## Features

- Reads the contents of specified files.
- Writes the contents to both a text file (`contents.txt`) and a markdown file (`contents.md`).
- Handles non-existent files and maintains a list of files that were not found.
- Provides a summary of the process, including read times for each file and overall execution time.

## How it works

1. The script takes a list of file paths as input and iterates through each file.
2. For each file, it checks if it exists, reads its contents, and writes the contents to both a text file and a markdown file.
3. If a file is not found, it is added to a list of not found files.
4. The script provides detailed output about the success or failure of reading each file and summarizes the overall process at the end.

Function arguments:

- **file_list (list, optional):** List of files to read. Defaults to None.
- **output_text_file (str, optional):** Output text file. Defaults to './output/contents.txt'.
- **output_markdown_file (str, optional):** Output markdown file. Defaults to './output/contents.md'.

## Usage

1. Install the `FileHarvestor` package from PyPI using pip:

   ```bash
   pip install FileHarvestor
   ```

   OR

   Clone or download the `FileHarvestor.py` script to your local machine.

   ```bash
   git clone https://github.com/Hardvan/FileHarvestor
   cd FileHarvestor
   pip install .
   ```

2. Call the `read_files_in_directory` function from the `FileHarvestor` package with the directory path as an argument.

   ```python
   from FileHarvestor import read_files_in_directory

   read_files(file_list=['./path/to/file1.txt', './path/to/file2.txt'], output_text_file='./output/contents.txt', output_markdown_file='./output/contents.md')
   ```

   View the `run.py` file for an example of how to use the `FileHarvestor` package.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Hardvan/FileHarvestor",
    "name": "FileHarvestor",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "file,harvestor,read,write,text,markdown,file-reader,read-file",
    "author": "Hardik Pawar",
    "author_email": "hardikpawarh@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d0/61/908c8070a325dd5f3457b9e924d64d7b4733b965a7e9883d3e047d3a3d37/FileHarvestor-1.0.2.tar.gz",
    "platform": null,
    "description": "# FileHarvestor\r\n\r\nThis script is a Python utility that reads the contents of specified files and writes them to both text and markdown files. If a file does not exist, it is added to a list of not found files. This tool is useful for consolidating and documenting the contents of multiple files in a directory.\r\n\r\n## Features\r\n\r\n- Reads the contents of specified files.\r\n- Writes the contents to both a text file (`contents.txt`) and a markdown file (`contents.md`).\r\n- Handles non-existent files and maintains a list of files that were not found.\r\n- Provides a summary of the process, including read times for each file and overall execution time.\r\n\r\n## How it works\r\n\r\n1. The script takes a list of file paths as input and iterates through each file.\r\n2. For each file, it checks if it exists, reads its contents, and writes the contents to both a text file and a markdown file.\r\n3. If a file is not found, it is added to a list of not found files.\r\n4. The script provides detailed output about the success or failure of reading each file and summarizes the overall process at the end.\r\n\r\nFunction arguments:\r\n\r\n- **file_list (list, optional):** List of files to read. Defaults to None.\r\n- **output_text_file (str, optional):** Output text file. Defaults to './output/contents.txt'.\r\n- **output_markdown_file (str, optional):** Output markdown file. Defaults to './output/contents.md'.\r\n\r\n## Usage\r\n\r\n1. Install the `FileHarvestor` package from PyPI using pip:\r\n\r\n   ```bash\r\n   pip install FileHarvestor\r\n   ```\r\n\r\n   OR\r\n\r\n   Clone or download the `FileHarvestor.py` script to your local machine.\r\n\r\n   ```bash\r\n   git clone https://github.com/Hardvan/FileHarvestor\r\n   cd FileHarvestor\r\n   pip install .\r\n   ```\r\n\r\n2. Call the `read_files_in_directory` function from the `FileHarvestor` package with the directory path as an argument.\r\n\r\n   ```python\r\n   from FileHarvestor import read_files_in_directory\r\n\r\n   read_files(file_list=['./path/to/file1.txt', './path/to/file2.txt'], output_text_file='./output/contents.txt', output_markdown_file='./output/contents.md')\r\n   ```\r\n\r\n   View the `run.py` file for an example of how to use the `FileHarvestor` package.\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "FileHarvestor is a Python utility that reads the contents of specified files and writes them to both text and markdown files. If a file does not exist, it is added to a list of not found files. This tool is useful for consolidating and documenting the contents of multiple files in a directory.",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/Hardvan/FileHarvestor"
    },
    "split_keywords": [
        "file",
        "harvestor",
        "read",
        "write",
        "text",
        "markdown",
        "file-reader",
        "read-file"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8a507dbf905422175f4cdea564c3d22304b47106c61a36973ed47054b14f2b2e",
                "md5": "826165f0c0552dfe428fc341fb6f5034",
                "sha256": "eecf3397b56de7d61262625ecb735e6fd9cf693f5ca5b928e4484d228df4790e"
            },
            "downloads": -1,
            "filename": "FileHarvestor-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "826165f0c0552dfe428fc341fb6f5034",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5867,
            "upload_time": "2024-02-19T11:50:17",
            "upload_time_iso_8601": "2024-02-19T11:50:17.160533Z",
            "url": "https://files.pythonhosted.org/packages/8a/50/7dbf905422175f4cdea564c3d22304b47106c61a36973ed47054b14f2b2e/FileHarvestor-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d061908c8070a325dd5f3457b9e924d64d7b4733b965a7e9883d3e047d3a3d37",
                "md5": "d78ca402a4790480bbf264028d55e8a9",
                "sha256": "21fb0256cb86248dbd3a0cc2802880083eab53c28f423dfbbf06cddacdddd118"
            },
            "downloads": -1,
            "filename": "FileHarvestor-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d78ca402a4790480bbf264028d55e8a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5054,
            "upload_time": "2024-02-19T11:50:19",
            "upload_time_iso_8601": "2024-02-19T11:50:19.593619Z",
            "url": "https://files.pythonhosted.org/packages/d0/61/908c8070a325dd5f3457b9e924d64d7b4733b965a7e9883d3e047d3a3d37/FileHarvestor-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-19 11:50:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Hardvan",
    "github_project": "FileHarvestor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fileharvestor"
}
        
Elapsed time: 0.18196s