Skip to main content

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

Metadata

Release files for prodglob 0.0.3

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

Source distribution (sdist)

Source distribution for prodglob 0.0.3
File Size Uploaded
prodglob-0.0.3.tar.gz 2.0 kB Details

Release files / prodglob-0.0.3.tar.gz

Download URL prodglob-0.0.3.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
10f29794c6206e62731842473fde63e6150642c39876a2e73e7c5c12bf00a95f
BLAKE2b-256 checksum
How to use checksums
bb0522754cbffb4cc367bff75d94806a3b933639643da7c928248e1d3132ea55
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

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