Skip to main content

Python utilities for file system operations

Project description

rexpand-pyutils-file

A comprehensive Python utility package for file system operations, providing easy-to-use functions for reading, writing, finding, and downloading files.

Features

  • File Reading: Read JSON, CSV, Excel, HTML, text files (including .txt, .log, .md) with a simple API
  • File Writing: Write data to JSON, CSV, Excel, HTML, and text files with customizable options
  • File Finding: Find files and folders in directories with filtering options and recursive search
  • File Downloading: Download files from URLs with automatic extension detection
  • File Compression: Unzip gzip (.gz) files
  • Path Refinement: Clean and normalize file paths with cross-platform support

Installation

You can install the package using pip:

pip install rexpand-pyutils-file

Usage

from rexpand_pyutils_file import read_file, write_file, find_files

# Read a JSON file
data = read_file("path/to/file.json")

# Write data to a CSV file
write_file("path/to/output.csv", data)

# Find all CSV files in a directory
csv_files = find_files("path/to/directory", file_suffix="csv")

API Reference

Main Functions

  • read_file(path, verbose=None, encoding=None, excel_sheet_name=None): Read a file (supports .json, .csv, .xlsx, .html, .txt, .log, .md)
  • write_file(path, data, verbose=None, encoding=None, csv_and_excel_overwrite=True, csv_fieldnames=None, excel_sheet_name="Sheet1", excel_enable_str_conversion=False): Write data to a file
  • download_file(url, file_path_without_extension, verbose=None): Download a file from a URL
  • unzip_file(path, output_path=None, verbose=None): Unzip a gzip (.gz) file
  • find_files(path, ignored_file_set=None, file_suffix=None, recursive=False): Find files in a directory
  • find_folders(path, ignored_folder_set=None, recursive=False): Find folders in a directory
  • refine_path(path): Refine a path with cross-platform support

License

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

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

rexpand_pyutils_file-0.0.5.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

rexpand_pyutils_file-0.0.5-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file rexpand_pyutils_file-0.0.5.tar.gz.

File metadata

  • Download URL: rexpand_pyutils_file-0.0.5.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for rexpand_pyutils_file-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d0d5557bf4b3b4f5e4fd3996666df9e1aaadc09c0813291f65145e32da3e6d7e
MD5 70e0f4a58372eef3d374c9e059ad4478
BLAKE2b-256 8ff435f23cdf0b142d9666a093689332fcf5a579df13a964144edaa68e5bf22e

See more details on using hashes here.

File details

Details for the file rexpand_pyutils_file-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for rexpand_pyutils_file-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0a4a5d283184505fba2f671639f833f6535cc3127ebd4ecfcb8f4968ca2fa6c2
MD5 0dc6af9deb6a248fb48e9f8a588c3518
BLAKE2b-256 b6adb6d2abb7fd7efb8ba6e693cdab24f42cdea64a261b7a919c72b3fbc74f0e

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