Skip to main content

Cross-platform file and folder utility functions in Python made simple.

Project description

easypath

easypath is a lightweight Python toolkit for file, folder, and path workflows on top of pathlib, now expanded with a major advanced utility layer for automation, integrity checks, and data pipelines.

Installation

pip install easypath

What Is New In This Expansion

This release extends the library with 45 new tools focused on high-impact workflows:

  • Atomic and resilient file writes
  • Backup and restore flows
  • File checksum and verification
  • Fast search/replace and file grep
  • Zip/Tar/Gzip archive workflows
  • Directory snapshots + diffing
  • Folder synchronization and filtered copy
  • NDJSON + CSV append helpers
  • JSON deep merge and merge-from-files
  • Permission inspection and executable toggles

New Advanced Tools (45)

Path intelligence

  • normalize_path
  • is_absolute_path
  • path_depth
  • common_path
  • same_path

Safe I/O and recovery

  • read_text_safe
  • write_text_atomic
  • backup_file
  • restore_file
  • copy_if_newer
  • remove_files
  • touch_files
  • wait_for_path

Integrity, inspection, and content operations

  • file_checksum
  • verify_checksum
  • compare_file_contents
  • count_lines
  • head_file
  • tail_file
  • find_in_file
  • replace_in_file
  • grep_files
  • merge_text_files
  • concat_binary_files
  • list_recent_files
  • list_largest_files

Archives and structure workflows

  • make_zip_archive
  • extract_zip_archive
  • make_tar_archive
  • extract_tar_archive
  • gzip_file
  • gunzip_file
  • hardlink_file
  • duplicate_tree_structure

Snapshot and sync workflows

  • snapshot_directory
  • diff_snapshots
  • sync_folders
  • copy_folder_filtered

Structured data workflows

  • read_ndjson
  • write_ndjson
  • append_csv_row
  • json_merge
  • merge_json_files

Permissions and executability

  • get_path_permissions
  • make_executable

Quick Example

from easypath import (
    write_text_atomic,
    backup_file,
    file_checksum,
    snapshot_directory,
    diff_snapshots,
    sync_folders,
    merge_json_files,
)

write_text_atomic("data/config.txt", "version=2\n")
backup = backup_file("data/config.txt")
print("backup:", backup)

digest = file_checksum("data/config.txt")
print("sha256:", digest)

before = snapshot_directory("data", include_checksum=False)
write_text_atomic("data/notes.txt", "hello\n")
after = snapshot_directory("data", include_checksum=False)
print(diff_snapshots(before, after))

print(sync_folders("data", "mirror", delete_extras=False, dry_run=True))
print(merge_json_files("base.json", "override.json"))

Existing Core API

All existing folder/file/path helpers remain available (creation, deletion, move/copy, JSON/CSV read-write, path transforms, permissions, tree listing, and disk usage).

For usage examples across both legacy and new APIs, see DOCUMENTATION.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easypath-0.3.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easypath-0.3.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file easypath-0.3.0.tar.gz.

File metadata

  • Download URL: easypath-0.3.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for easypath-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1dd88700d96e1785a0d4659c361ce5519bb1eb6e4bc1917992626ba1b87dba9f
MD5 f035079d99384eff35465fe6a9632f0b
BLAKE2b-256 fe8b78f869ab41f8ae69791d38339b924181899c050f8f0a19de0f0c9250f3ae

See more details on using hashes here.

File details

Details for the file easypath-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: easypath-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for easypath-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b715b01935627427036abea22919b35c713ce6d18cf938a302b00f61a30205a
MD5 3a77f9e5876c0424ffc05f22e58bb729
BLAKE2b-256 0f984e3e22f1a30c1971f2b0a4c0ccf9c72fb8364838f305d1eb53cfe22fb8b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page