Jinja2 extension with custom filtersreplacing ORCIDs with elements from the orcid records.
Project description
Jinja2 ORCID extension
Extension with custom filters replacing ORCIDs with elements from the orcid records.
Free software: MIT license
Documentation: https://jinja2-orcid-extension.readthedocs.io.
Before we begin…
It is important to note that this package was created for one specific use case, namely to be used as a jinja2 extension while generating project structures with cookiecutter through the cookiecutter CLI interface. The goal is to make the information in the ORCID records available for researchers who are using cookiecutter for data management puposes, but are otherwise unfamiliar with programming.
The package works by adding custom jinja2 filters that perform a call to the ORCID REST API at the time of template rendering. Using this package in another context (e.g. in the context of a web framework), will likely be a bad idea. Fetching data in this way will not be in lign with the design principles of the framework you are using. Using it in those contexts will make error handling, automated testing and debugging more difficult.
Features
The package contains filter expressions which you can use on valid ORCIDS in Jinja2 templates. Each filter replaces the ORCID in the template with a string containing certain elements from the ORCID record. Currently several filters are available:
full_credit: returns a single preformated label containing the credit name and orcid id.
credit_name: contains the credit name as supplied in the ORCID record
given_names: contains the given names as supplied in the ORCID record
family_name: contains the family name as supplied in the ORCID record
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0.dev1 (2022-03-04)
First development release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jinja2_orcid_extension-0.1.0.dev1.tar.gz
.
File metadata
- Download URL: jinja2_orcid_extension-0.1.0.dev1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.57.0 importlib-metadata/4.11.2 keyring/22.2.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be982592eac4ffd11f66c040a013cf89ca2833704ec5d23cd9c3a7a48c1027a4 |
|
MD5 | f3b562feca9f19aabf79d65025e2e973 |
|
BLAKE2b-256 | c4a90a9fd1575f1da33c5667d09867e0dc57ea5d3ed235123f43be9a8edcc0d8 |
File details
Details for the file jinja2_orcid_extension-0.1.0.dev1-py2.py3-none-any.whl
.
File metadata
- Download URL: jinja2_orcid_extension-0.1.0.dev1-py2.py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.57.0 importlib-metadata/4.11.2 keyring/22.2.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec91a8122d396a275eb9648e66a2dc3cbb584896b0c3ca471fe77c3e07da8dd4 |
|
MD5 | 29b9dcacf64d5fe57bd8827f5d653b4c |
|
BLAKE2b-256 | 065007b1f4bab9ceab28bf755dd456d44d5e089a4e723c875ee953504e0f02de |