A Python library for safely copying, moving, and deleting files with path-traversal protection, overwrite confirmation, and checksum verification.
Project description
fsplus
Safe file system operations for Python — copy, move, create, and delete with path-traversal protection, overwrite confirmation, and checksum verification.
Install
pip install fsplus
Operations
| Function | Description |
|---|---|
copy_file |
Copy a file with overwrite confirmation |
move_file |
Move a file with checksum verification |
create_file |
Create a new file with content |
create_temp_file |
Create a temporary file |
clear_directory |
Remove all contents of a directory |
delete_directory |
Remove a directory entirely |
Usage
from fsplus import copy_file, move_file, delete_directory
# Copy a file
copy_file("/data/report.csv", "/backup/")
# Overwrite requires explicit confirmation
copy_file("/data/report.csv", "/backup/", overwrite=True, required_partial_path="backup")
# Move with automatic checksum verification
move_file("/data/report.csv", "/archive/")
# Rename on the way
move_file("/data/report.csv", "/archive/", new_name="report_2024.csv")
License
MIT
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
fsplus-1.0.0.tar.gz
(38.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
fsplus-1.0.0-py3-none-any.whl
(18.6 kB
view details)
File details
Details for the file fsplus-1.0.0.tar.gz.
File metadata
- Download URL: fsplus-1.0.0.tar.gz
- Upload date:
- Size: 38.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8998a87a6c3480500d8c319f0fe7ab31281f23e81092cd9e2867eacb63a1bbad
|
|
| MD5 |
2314d5467337089499189e1c5724686b
|
|
| BLAKE2b-256 |
934fe815ec89699ed2a86cd59e880346a7f53084b7556b1063c1108f195091b1
|
File details
Details for the file fsplus-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fsplus-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1656c7adb617e29042c234caf221f01377c6df4f474318d558d5f317461a1c3e
|
|
| MD5 |
3d5e332e9f12319244b402aa1dec619b
|
|
| BLAKE2b-256 |
821e9c49c57bac2cc19a32e163caabfc577453b5908904108662d1b7b48e742b
|