Move files around
Project description
💨 Kuling 💨
A simple, intuitive Python library for file operations with clean APIs and robust error handling.
🚀 Features
- Glob Pattern Matching 🔍 - Find files with support for
*,?,[abc], and**wildcards - Safe File Operations 📁 - Move, copy, and delete files with automatic directory creation
- Robust Error Handling ⚠️ - Clear exceptions for all edge cases
- Path Flexibility 🛤️ - Works with both strings and Path objects
- Type Safety 🔒 - Full type hints for better IDE support
📦 Installation
pip install kuling
🔧 Quick Start
from kuling import find_matching_paths, move_file, copy_file, delete_file
# Find all Python files recursively
python_files = find_matching_paths("/project/**/*.py")
# Move a file (creates parent directories automatically)
move_file("old/location/file.txt", "new/location/file.txt")
# Copy a file to a directory (keeps original name)
copy_file("important.txt", "backups/")
# Delete a file
delete_file("temp/unwanted.log")
🔧 Advanced Features
Pattern Matching Examples
# Question mark - single character
find_matching_paths("file?.txt") # file1.txt, fileA.txt
# Character sets
find_matching_paths("test[123].py") # test1.py, test2.py, test3.py
find_matching_paths("file[abc].txt") # filea.txt, fileb.txt, filec.txt
# Negation
find_matching_paths("test[!1].py") # test2.py, test3.py (not test1.py)
# Recursive search
find_matching_paths("**/*.py") # All .py files in all subdirectories
# Combined wildcards
find_matching_paths("logs/*/2024/*.log") # Logs in any subdirectory for 2024
Path Flexibility
from pathlib import Path
# All functions accept both strings and Path objects
source = Path("file.txt")
dest = "backup/"
copy_file(source, dest) # Mixed types work fine
copy_file(str(source), str(dest)) # Strings work
copy_file(source, Path(dest)) # Path objects work
🔗 Links
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
kuling-1.0.2.tar.gz
(15.4 kB
view details)
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
kuling-1.0.2-py3-none-any.whl
(16.5 kB
view details)
File details
Details for the file kuling-1.0.2.tar.gz.
File metadata
- Download URL: kuling-1.0.2.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6ec3d6b10f384bbaf43edd7480a6751f7f4f7640da4da2e593688b614a225dc
|
|
| MD5 |
88b9a30943874936d7cd8cc5ea3cc8cd
|
|
| BLAKE2b-256 |
07295dc85e71795239c15dd252a42d63cd1e9b718733f51d106c6ef2eafe23c6
|
File details
Details for the file kuling-1.0.2-py3-none-any.whl.
File metadata
- Download URL: kuling-1.0.2-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cddcbf68c3da041adb5619d491e85e43e4a977bdd50e29b236ce1a11ea1577b6
|
|
| MD5 |
a4a6f97789ea367b865f4f555ff6b514
|
|
| BLAKE2b-256 |
6214f9ad1dc09136f97ca514e02324db428c518573cb4d377eca9d42db54f93f
|