Skip to main content

Template-based path generation for data pipelines

Project description

SciPathGen

Template-based path generation for data pipelines.

Generates file paths with associated metadata from a template and metadata value combinations.

Usage

from scipathgen import PathGenerator

paths = PathGenerator(
    "{subject}/trial_{trial}.mat",
    root_folder="/data/experiment",
    subject=range(3),
    trial=range(5),
)

for path, meta in paths:
    print(path, meta)
# /data/experiment/0/trial_0.mat {'subject': 0, 'trial': 0}
# /data/experiment/0/trial_1.mat {'subject': 0, 'trial': 1}
# ...

# Supports indexing and length
print(len(paths))  # 15
path, meta = paths[0]

If root_folder is omitted, paths are resolved relative to the current working directory via Path.resolve().

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

scipathgen-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

scipathgen-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file scipathgen-0.1.0.tar.gz.

File metadata

  • Download URL: scipathgen-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for scipathgen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 47c4e29e19b5653d1730c0a0648e8e2126101647fe4731ddd11270b481fe7cf1
MD5 ac12f8047593566f6e8feb51ba12e969
BLAKE2b-256 bd864cabc2048666cd71270e6017d5521d19f1b2d342215de6a05339bbbbadd3

See more details on using hashes here.

File details

Details for the file scipathgen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scipathgen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for scipathgen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1ae5e1037581d9823a1d516b1324a4aac4ae3465904b823e7d3aab0602cc130
MD5 b672371fab1fdf6337319bf015355e35
BLAKE2b-256 85666c08faa712826e0fb0670eb8b8f3ea24357c9c4e234bccdeb93ac372a0c1

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