Skip to main content

Assorted filesystem related utility functions, some of which have been bloating cs.fileutils for too long.

Project description

Assorted filesystem related utility functions, some of which have been bloating cs.fileutils for too long.

Latest release 20220327: New module cs.fs to contain more filesystem focussed functions than cs.fileutils, which is feeling a bit bloated.

Function atomic_directory(*da, **dkw)

Decorator for a function which fills in a directory which calls the function against a temporary directory then renames the temporary to the target name on completion.

Parameters:

  • infill_func: the function to fill in the target directory
  • make_placeholder: optional flag, default False: if true an empty directory will be make at the target name and after completion it will be removed and the completed directory renamed to the target name

Function rpaths(dirpath='.', *, only_suffixes=None, skip_suffixes=None, sort_paths=False)

Yield relative file paths from a directory.

Parameters:

  • dirpath: optional top directory, default '.'
  • only_suffixes: optional iterable of suffixes of interest; if provided only files ending in these suffixes will be yielded
  • skip_suffixes: optional iterable if suffixes to ignore; if provided files ending in these suffixes will not be yielded
  • sort_paths: optional flag specifying that filenames should be sorted, default False

Release Log

Release 20220327: New module cs.fs to contain more filesystem focussed functions than cs.fileutils, which is feeling a bit bloated.

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

cs.fs-20220327.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

cs.fs-20220327-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file cs.fs-20220327.tar.gz.

File metadata

  • Download URL: cs.fs-20220327.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for cs.fs-20220327.tar.gz
Algorithm Hash digest
SHA256 3a41e126e4d07ae6a8b1c707c8c00afc4ab2dc97aee73c445737456af5aeb910
MD5 ce7da20d2586ada4ee664b25e15486f2
BLAKE2b-256 7ddfaf5e9ae696a62883b6166812a8449b0727a4b7d58524ab9787b7ac889469

See more details on using hashes here.

File details

Details for the file cs.fs-20220327-py3-none-any.whl.

File metadata

  • Download URL: cs.fs-20220327-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for cs.fs-20220327-py3-none-any.whl
Algorithm Hash digest
SHA256 c8ddcd19818ff7888d0ae8b6e448065295a2e00b30c62381f4ac9e8943f27ac3
MD5 16a46d7bde50f115ce35c77a08e40e2b
BLAKE2b-256 6ed0afb6e6636b594d0696e32d50eefc3de7fd65f467429e589598c0c564836a

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