Skip to main content

Lightweight glob extensions with extended path joining.

Project description

prodos

os and glob extensions with advanced path joining.

Install

pip install prodos

Usage

from prodos import prodglob, pathprod, prodmake

print('pathprod: creating a product of path items.')
for f in pathprod('base', ('a', 'b'), 'something', ('c', 'd')):
    print(f)
print()

print('prodglob: globbing over the product of path items.')
for f in prodglob('base', ('a', 'b'), 'something', ('c', 'd')):
    print(f)
fs = pathprod('base', ('a', 'b'), 'something', ('c', 'd'))
print('how many files exist?', sum(os.path.exists(f) for f in fs))
print()

print('prodmake: making directories from the product of path items.')
fs = prodmake('base', ('a', 'b'), 'something', ('c', 'd'))
print('how many files exist?', sum(os.path.exists(f) for f in fs))
print()

print('prodglob: globbing over the product of path items.')
for f in prodglob('base', ('a', 'b'), 'something', ('c', 'd')):
    print(f)

Outputs:

pathprod: creating a product of path items.
base/a/something/c
base/a/something/d
base/b/something/c
base/b/something/d

prodglob: globbing over the product of path items.
how many files exist? 0

prodmake: making directories from the product of path items.
how many files exist? 4

prodglob: globbing over the product of path items.
base/a/something/c
base/a/something/d
base/b/something/c
base/b/something/d

Project details


Download files

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

Files for prodos, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size prodos-0.0.1.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page