Skip to main content

Extract, resolve and replace [SIGILS] embedded in text.

Project description

Sigils

A sigil is a token embedded in text, used as a placeholder for a future value. When resolved, the actual value will be extracted from an user-provided or global context.

This library contains tools to extract, replace and resolve such sigils.

.. _Documentation:

Installing

Install and update using pip_:

.. code-block:: text

pip install -U sigils

Using Sigils

A typical sigil has one of the following forms:

.. code-block:: text

[USERNAME]
[SETTINGS.BASE_DIR]
[MODEL='natural-key'.FIELD]
[MODEL.USR=[USERNAME].STATUS]

Dependencies

  • lark_: Allows us to parse arbitrarily complex sigils fast.

.. _lark: https://github.com/lark-parser/lark .. _pip: https://pip.pypa.io/en/stable/quickstart/

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

sigils-0.0.2.tar.gz (4.8 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page