Skip to main content

Filters from `os.path` for jinja2

Project description

jinja2-ext-path

$ pip install jinja2-ext-path

Usage

See Extensions - Adding Extensions.

Name of the extension is jinja2_ext_path.PathExtension.

You would be able to use it like this:

jinja_env = Environment(extensions=['jinja2_ext_path.PathExtension'])

Or:

jinja_env.add_extension('jinja2_ext_path.PathExtension')

Then you can render like this:

jinja2_env.from_string("{{ '/home/user/test.txt'| dirname }}")

For further reference:

Please note: all functions on os.path are included.

Installation

$ pip install jinja2-ext-path

Development

This project uses pre-commit.

License

Licensed under GNU General Public License (Version 3, 29 June 2007).

See LICENSE.md.

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

jinja2_ext_path-0.1.0.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

jinja2_ext_path-0.1.0-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file jinja2_ext_path-0.1.0.tar.gz.

File metadata

  • Download URL: jinja2_ext_path-0.1.0.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.3.0

File hashes

Hashes for jinja2_ext_path-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1af56b7828411080e2cf66bddaf42033488445884bf3b2ed9dd42de7e2f103b5
MD5 c495805817dd17905812bdab8c31adca
BLAKE2b-256 a6614dc0b42412630e5bc5e50c1b28845cf39cd017bdaebf48a5d3e165a2063b

See more details on using hashes here.

File details

Details for the file jinja2_ext_path-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jinja2_ext_path-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.3.0

File hashes

Hashes for jinja2_ext_path-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb6cf44eee74323f595787a82c11a855bbc3c65bc049a7771f9cb11ab5f76732
MD5 6fa364628459603bd2f2ad02974f7bcf
BLAKE2b-256 3d142a2c44039390fe856e464c94685bb9b053fa355f44a40ebb864d6fef3445

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