Skip to main content

Lightweight glob extensions with extended path joining.

Project description

prodglob

os and glob extensions with advanced path joining.

Install

pip install prodglob

Usage

from prodglob 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.

Source Distribution

prodglob-0.0.3.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file prodglob-0.0.3.tar.gz.

File metadata

  • Download URL: prodglob-0.0.3.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for prodglob-0.0.3.tar.gz
Algorithm Hash digest
SHA256 10f29794c6206e62731842473fde63e6150642c39876a2e73e7c5c12bf00a95f
MD5 7cd74fb2b4c553131bfc44cb482b151a
BLAKE2b-256 bb0522754cbffb4cc367bff75d94806a3b933639643da7c928248e1d3132ea55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page