Effortless Symlink Management as a Python Package!
Project description
Symply - Advanced Symlink Management and Monitoring
Symply is a Python library designed to provide robust symlink creation, deletion, and monitoring functionality. It helps developers handle file system events efficiently and perform specific actions based on those events, such as creating or managing symlinks dynamically.
Features
- Symlink Management: Easily create and delete symlinks using straightforward Python functions.
- File System Monitoring: Monitor directories for changes like creation, deletion, modification, and moving of files or directories.
- Event-Driven Actions: Execute custom actions based on file system events using user-defined callback functions.
- Customizable Filters: Specify which files to monitor based on patterns, enhancing the flexibility and efficiency of the monitoring process.
Installation
To install Symply, clone this repository and include it in your project, or use pip to install directly from the source:
pip install symply
Usage
Symlink Management
Creating a Symlink
from symply import symlink
symlink('/path/to/source', '/path/to/target', force=True)
Deleting a Symlink
from symply import delete_symlink
delete_symlink('/path/to/target')
File System Monitoring
Set up monitoring to react to file system events:
from symply.watcher import SymlinkMonitor, SymlinkHandler
def handle_event(path, event_type, destination=None):
print(f"Event: {event_type}, Path: {path}")
if destination:
print(f"Destination: {destination}")
handler = SymlinkHandler(handle_event)
monitor = SymlinkMonitor('/path/to/watch', handler)
monitor.start()
Stop Monitoring
input("Monitoring... Press Enter to stop.\n")
monitor.stop()
Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'feat: Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
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
File details
Details for the file symply-0.1.2.tar.gz
.
File metadata
- Download URL: symply-0.1.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.2 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c3c5e940f5de0c3781db7b6d03a14cffc18fdceeb0e77a9309a817ce87e5cbf |
|
MD5 | 3a008500ac9bc36f55d317219a701830 |
|
BLAKE2b-256 | b26e7b6761c7fd47451729e0ff091ee4a17ed905014d1a562064bcb5932a379e |
File details
Details for the file symply-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: symply-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.2 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15b05c14038bb700a5a9369bc051743879a9d343401d85da5a51b86a8998bb02 |
|
MD5 | 9856eace2f62e100fe39f0e88e637502 |
|
BLAKE2b-256 | 33eacc38e89a0c563d98c368902408652c9e012e537333c3b81aacaf55fc56d6 |