Skip to main content

arches-templating

An application to add templating/reporting capabilities to Arches.

Installation

Install via pip, arches-templating (forthcoming). Or install a development version by pulling down the repository and running pip install from the local repo directory.

Add the arches_templating module to the project's list of INSTALLED_APPLICATIONS.

Run migrations from your project to install database.

python manage.py migrate arches_templating

Add urls to your project's urls.py if you wish to use the built-in view to submit your templates.

path("your-base-url-here/", include("arches_templating.urls"))

Alternatively, you can call the template engine directory and provide your data container and template ID.

The Data Container

The data container is a json-based object that is provided to the template engine along with the template ID. It is referenced by the template designer when creating the template - the paths in the template should match the ones being provided by the data container.

Adding Templates

Currently, the only way to add templates is via the django admin interface. Visit the /admin url of your site and upload your templates there.

Creating Templates

We currently support five base tags.

  • value
  • context
  • if
  • image
  • end

Each of these tags requires a "path" attribute and is prefixed by "arches:". For example:

<arches:value path="path/in/data/container">

An end tag is required for the context and if tags.

The context tag will change the "context" of its child tags to whatever its path matches within the data container provided to the template engine.

Functionally, this means that

<arches:value path="foo/bar">

and

<arches:context path="foo">
<arches:value path="bar">
<arches:end>

are functionally equivalent and referencing the same data within the data container.

If the context is pointing to an array, this is currently the method being used to render table rows.

Elements can be optionally rendered by an if tag.

<arches:if path="foo">
Some optionally rendered content, depending on value at the "foo" path of your data container.
<arches:end>

An image tag can render an image from a URL or (optionally) a base64 encoded image from the backend. <arches:image path=“path_to_image_or_path_to_url”>

The if tag can be inverted by providing an "inverse" attribute set to true.

<arches:if inverse="true" path="foo">

Currently powerpoint, word, and spreadsheet templates are supported. We welcome the addition of more implementations and improvements/bug fixes on the ones that currently exist.

Metadata

Release files for arches-templating 0.1.2

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

Source distribution (sdist)

Source distribution for arches-templating 0.1.2
File Size Uploaded
arches-templating-0.1.2.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arches-templating 0.1.2
File Interpreter ABI Platform
arches_templating-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 38.1 kB

Release files / arches-templating-0.1.2.tar.gz

Download URL arches-templating-0.1.2.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c5f0fab434b16197d296aff5c1c4ed81ee744b95a8e59b72219ea7a3332d978a
BLAKE2b-256 checksum
How to use checksums
1911f8a1d9ba44bc2bca72eb1bad7676c281af6bf2b256ad79bf4df60abcbd80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release files / arches_templating-0.1.2-py3-none-any.whl

Download URL arches_templating-0.1.2-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1710b358f285974827c0a11438dbf37337ef3c45520f536926b183d3109838a6
BLAKE2b-256 checksum
How to use checksums
49802c5e1a6e0f3ecded18d7af81e0ab39ad76da19cb2ed4e78919883f1ea577
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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