Skip to main content

Pathlib-style classes for local files and named remote storage.

Project description

ppathlib

ppathlib provides a pathlib-style public path object for local paths and named remote storage.

The current library exposes one public path type:

  • PPath(path) uses local mode internally
  • PPath(path, profile=...) uses remote mode internally
  • PPath("s3://...") can also enter public remote mode without a profile for lightweight public S3 access

Current Status

The library currently supports:

  • local mode with pathlib-style composition
  • remote lexical behavior such as /, joinpath, name, stem, suffix, parent, parts, relative_to, and with_suffix
  • backend-backed remote runtime operations such as open, read_*, write_*, exists, listing, globbing, copy, move, and unlink
  • project-scoped TOML configuration discovery
  • profile-less public S3 access for lightweight public objects

Remote runtime behavior is still experimental. Remote runtime methods emit ExperimentalRemoteRuntimeWarning so callers do not mistake the current behavior for a frozen contract.

The source of truth for project governance is the numbered documentation set in docs/.

Installation

pip install ppathlib

Minimum supported Python version: 3.11.

Quick Start

Local Mode

from ppathlib import PPath

path = PPath("data/local-report.parquet")
print(path.mode)
print(path.parent)

Profiled Remote Mode

version = 1

[profiles.analytics]
storage_type = "s3"
endpoint_url = "https://storage.example.com"
access_key_id = "xxx"
secret_access_key = "yyy"
root = "s3://analytics-bucket"
from ppathlib import PPath

path = PPath("daily/report.parquet", profile="analytics")
print(path)
print(path.name)
print(path.with_suffix(".csv"))

Public S3 Mode

from ppathlib import PPath

path = PPath("s3://wikisum/README.txt")
print(path.read_text(encoding="utf-8")[:120])

Current API Surface

PPath(path, profile=None)

Returns the public PPath object in either local or remote mode.

ExperimentalRemoteRuntimeWarning

Warning type emitted by experimental remote runtime operations.

InvalidConfigurationException

Exception type raised for invalid configuration or invalid remote path inputs.

Internal backend binding types are implementation details and are not part of the top-level API.

Documentation

License

MIT

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

ppathlib-0.2.1.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

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

ppathlib-0.2.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file ppathlib-0.2.1.tar.gz.

File metadata

  • Download URL: ppathlib-0.2.1.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ppathlib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fbb17ebfa375f4b0ecac37861e0c07990f979ecb609e9d3fef495d6a4424a8ac
MD5 1a2c3327e028e12957e5c5e7577f7030
BLAKE2b-256 fb9fccea483005b3eb7a989f14a9738b6f455034b0497df08080de06e65b7b26

See more details on using hashes here.

Provenance

The following attestation bundles were made for ppathlib-0.2.1.tar.gz:

Publisher: publish.yml on husgbb/ppathlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ppathlib-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ppathlib-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ppathlib-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 366270376a82cdff19ea5857b362f9f2669614f02aa19ae8a3844cccbdbf93dd
MD5 ad97d3be038330014ffd3bf0076a6a51
BLAKE2b-256 fec340d0524ba6beb1963779b0e352afc59ec9cc8ffcda6a5ecae8d9f3eb9702

See more details on using hashes here.

Provenance

The following attestation bundles were made for ppathlib-0.2.1-py3-none-any.whl:

Publisher: publish.yml on husgbb/ppathlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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