Skip to main content

File filter plugin for docums

select-files is a docums plugin that filters out files (pages) using a parametrized regular expression.

The main use case for this plugin is to prepare lectures or assignments and only publishing them at a given date.

Quick start

  1. Install the module using pip: pip3 install docums-select-files

  2. In your project, add a plugin configuration to docums.yml:

    plugins:
      - select-files:
       select: '^s(\d+)'
       where: 'lambda x : int(x) <= 5'
    

This would search for files named sNN... and select only those where NN is less than or equal to 5.

In the where expression, you can use the following declared variables

  • now : represent the current time in ISO format
  • sfc : The value of the SELECT_FILE_CONDITION environment variable.

The modules os and datetime are imported, so you can use methods from them.

Disabling the plugin

You can disable the plugin using an environment variable. For example, you could configure your site this way:

plugins:
  - select-files:
  select: '^s(\d+)'
  where: 'lambda x : int(x) <= 5'
  disabled_if_env: SELECT_FILES_DISABLED

and then, running docums with SELECT_FILES_DISABLED set to 1 would disable this plugin and let all pages be processed:

SELECT_FILES_DISABLED=1 docums ...

Similar plugins

  • docums-exclude : exclude arbitrary file paths and patterns from the input

Metadata

Release files for docums-select-files 0.3.6

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

Source distribution (sdist)

Source distribution for docums-select-files 0.3.6
File Size Uploaded Provenance
docums-select-files-0.3.6.tar.gz 6.8 kB Without provenance Details

Release files / docums-select-files-0.3.6.tar.gz

Download URL docums-select-files-0.3.6.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f3293d5c86b5a2eab3f03d5f07adbf594e8e7d5c2525e0bf4a35c4b59c440377
BLAKE2b-256 checksum
How to use checksums
62bdd9388b035d6b8073f440cab49e561d820d54a4b5338bdaf6614e9c56018c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.4

Security for docums-select-files 0.3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.6 This release

1 release file No provenance

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