Skip to main content

pyxfs Path Utilities

PyPI version License: MIT

pyxfs is a Python library that provides a URI-aware path abstraction similar to pathlib, but designed for distributed and cloud storage systems.

It supports Hadoop-style path components (scheme, authority, path) and provides concrete path classes for:

  • Local files (LocalPath, scheme: os://)
  • S3 paths (S3Path, scheme: s3:// — in pyxfs.s3.path)

It normalizes paths to POSIX style (/ separators), works with URIs, and provides high-level path manipulation utilities.


Features

  • Parse local and S3 URIs (os:///tmp/file, s3://bucket/path/file).
  • Normalize paths (/a/b/../c → /a/c).
  • Join, split, and modify paths without losing scheme/authority.
  • Build paths from absolute paths or URIs.
  • Generate safe URIs with percent-encoding for spaces and special characters.

Installation

Install directly from PyPI:

pip install pyxfs

Quickstart

from pyxfs.path import Path, LocalPath

# Build from absolute local path
p = Path.from_uri("/tmp/data/file.txt")
print(p)              # os:///tmp/data/file.txt
print(p.scheme)       # os
print(p.parts)        # ['tmp', 'data', 'file.txt']
print(p.name)         # file.txt
print(p.suffix)       # .txt

# Build from os:// URI
p2 = Path.from_uri("os:///var/log/syslog")
print(p2.as_uri())    # os:///var/log/syslog

# Path operations
p3 = p2 / "archive" / "old.log"
print(p3)             # os:///var/log/archive/old.log

p4 = p3.with_name("latest.log")
print(p4)             # os:///var/log/archive/latest.log

p5 = p4.with_suffix(".gz")
print(p5)             # os:///var/log/archive/latest.gz

print(p5.parent)      # os:///var/log/archive

S3 Path Example

from pyxfs.path import Path

p = Path.from_uri("s3://my-bucket/data/file.csv")
print(p.scheme)     # s3
print(p.authority)  # my-bucket
print(p.parts)      # ['data', 'file.csv']
print(p.name)       # file.csv
print(p.as_uri())   # s3://my-bucket/data/file.csv
print(p.with_suffix(".json"))  # s3://my-bucket/data/file.json

Metadata

Release files for pyxfs 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyxfs 0.1.0
File Size Uploaded Provenance Actions
pyxfs-0.1.0.tar.gz 7.7 kB Without provenance Details for pyxfs-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyxfs 0.1.0
File Interpreter ABI Platform Actions
pyxfs-0.1.0-py3-none-any.whl Python 3 none any Details for pyxfs-0.1.0-py3-none-any.whl

Total release size: 14.7 kB

Release files / pyxfs-0.1.0.tar.gz

Download URL pyxfs-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eccff2fbb5acdd2b9d447c94610afcc061c022419ddbc24fec5b28751f90e65e
BLAKE2b-256 checksum
How to use checksums
d50b4ff4c5f199f1ea63804361fca4114f259da3b00c25bdd0d0e395a8b9cd27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release files / pyxfs-0.1.0-py3-none-any.whl

Download URL pyxfs-0.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1edf7df367eba82ee0efb58fb4fe3c0a78104ad177d3bfc068d7548a326fce8f
BLAKE2b-256 checksum
How to use checksums
a4f8b3cd99a996d6f9384220ad4c4f2917d4acb6a7deccbd615a7063a5a53d31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Security for pyxfs 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page