trackdir


Nametrackdir JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/bytebreach/trackdir
SummaryA package to track file changes in a directory
upload_time2024-09-02 03:59:56
maintainerNone
docs_urlNone
authorMrFidal
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # trackdir

**trackdir** is a Python package designed to monitor and track changes in a specified directory. It detects file creations, deletions, and modifications, providing real-time feedback either as a command-line tool or as a Python module in your scripts.

## Features

- **Real-Time Monitoring**: Instantly detects file creations, deletions, and modifications.
- **Flexible Usage**: Can be used both as a command-line tool and a Python module.
- **Detailed Change Information**: Returns detailed information about the type of change and the affected file.

## Installation

You can install the `trackdir` package using `pip`:

```bash
pip install trackdir
```

## Usage

### Command-Line Tool

To monitor a directory from the command line:

```bash
trackdir C:/telegram
```

This command will print details of any file changes (creation, deletion, modification) detected in the specified directory.

### Python Module

You can also use `trackdir` within your Python scripts:

```python
from trackdir import track_changes

# Track changes in the specified directory
change = track_changes("C:/telegram")
if change:
    event_type = change["type"]
    event_path = change["path"]
    if event_type == 'modified':
        print(f"File modified: {event_path}")
    elif event_type == 'created':
        print(f"File created: {event_path}")
    elif event_type == 'deleted':
        print(f"File deleted: {event_path}")
```

### Example

Here’s an example of using `trackdir` in a Python script:

```python
from trackdir import track_changes

directory_to_monitor = "C:/telegram"

# Continuously monitor the directory
while True:
    change = track_changes(directory_to_monitor)
    if change:
        event_type = change["type"]
        event_path = change["path"]
        print(f"Detected {event_type} at {event_path}")
```

### Contributions

Contributions are welcome! Please feel free to submit a pull request or open an issue on the [GitHub repository](https://github.com/bytebreach/trackdir).

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Acknowledgments

Special thanks to the [watchdog](https://github.com/gorakhargosh/watchdog) library, which powers the file system monitoring capabilities of this package.

## Thank You

A heartfelt thank you to everyone who has supported and contributed to this project. Your encouragement and feedback are deeply appreciated and motivate me to continue improving and innovating.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bytebreach/trackdir",
    "name": "trackdir",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "MrFidal",
    "author_email": "mrfidal@proton.me",
    "download_url": "https://files.pythonhosted.org/packages/c4/fa/1875f25352b1d4ff6da071fbf85567a33946c43612f6e3d57b4e31d459dd/trackdir-1.0.0.tar.gz",
    "platform": null,
    "description": "# trackdir\r\n\r\n**trackdir** is a Python package designed to monitor and track changes in a specified directory. It detects file creations, deletions, and modifications, providing real-time feedback either as a command-line tool or as a Python module in your scripts.\r\n\r\n## Features\r\n\r\n- **Real-Time Monitoring**: Instantly detects file creations, deletions, and modifications.\r\n- **Flexible Usage**: Can be used both as a command-line tool and a Python module.\r\n- **Detailed Change Information**: Returns detailed information about the type of change and the affected file.\r\n\r\n## Installation\r\n\r\nYou can install the `trackdir` package using `pip`:\r\n\r\n```bash\r\npip install trackdir\r\n```\r\n\r\n## Usage\r\n\r\n### Command-Line Tool\r\n\r\nTo monitor a directory from the command line:\r\n\r\n```bash\r\ntrackdir C:/telegram\r\n```\r\n\r\nThis command will print details of any file changes (creation, deletion, modification) detected in the specified directory.\r\n\r\n### Python Module\r\n\r\nYou can also use `trackdir` within your Python scripts:\r\n\r\n```python\r\nfrom trackdir import track_changes\r\n\r\n# Track changes in the specified directory\r\nchange = track_changes(\"C:/telegram\")\r\nif change:\r\n    event_type = change[\"type\"]\r\n    event_path = change[\"path\"]\r\n    if event_type == 'modified':\r\n        print(f\"File modified: {event_path}\")\r\n    elif event_type == 'created':\r\n        print(f\"File created: {event_path}\")\r\n    elif event_type == 'deleted':\r\n        print(f\"File deleted: {event_path}\")\r\n```\r\n\r\n### Example\r\n\r\nHere\u00e2\u20ac\u2122s an example of using `trackdir` in a Python script:\r\n\r\n```python\r\nfrom trackdir import track_changes\r\n\r\ndirectory_to_monitor = \"C:/telegram\"\r\n\r\n# Continuously monitor the directory\r\nwhile True:\r\n    change = track_changes(directory_to_monitor)\r\n    if change:\r\n        event_type = change[\"type\"]\r\n        event_path = change[\"path\"]\r\n        print(f\"Detected {event_type} at {event_path}\")\r\n```\r\n\r\n### Contributions\r\n\r\nContributions are welcome! Please feel free to submit a pull request or open an issue on the [GitHub repository](https://github.com/bytebreach/trackdir).\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n\r\n## Acknowledgments\r\n\r\nSpecial thanks to the [watchdog](https://github.com/gorakhargosh/watchdog) library, which powers the file system monitoring capabilities of this package.\r\n\r\n## Thank You\r\n\r\nA heartfelt thank you to everyone who has supported and contributed to this project. Your encouragement and feedback are deeply appreciated and motivate me to continue improving and innovating.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A package to track file changes in a directory",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/bytebreach/trackdir"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c4fa1875f25352b1d4ff6da071fbf85567a33946c43612f6e3d57b4e31d459dd",
                "md5": "5f9133c2d7885538ef75bdafdfe2dfe6",
                "sha256": "a5bd7a458cae4aafd6908da638087999b4d6e38dc63ab0c8d44922d85122ed1f"
            },
            "downloads": -1,
            "filename": "trackdir-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5f9133c2d7885538ef75bdafdfe2dfe6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3319,
            "upload_time": "2024-09-02T03:59:56",
            "upload_time_iso_8601": "2024-09-02T03:59:56.331102Z",
            "url": "https://files.pythonhosted.org/packages/c4/fa/1875f25352b1d4ff6da071fbf85567a33946c43612f6e3d57b4e31d459dd/trackdir-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-02 03:59:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bytebreach",
    "github_project": "trackdir",
    "github_not_found": true,
    "lcname": "trackdir"
}
        
Elapsed time: 0.93447s