Skip to main content

A simple API wrapper for Newsworthy's template writer, https://jplusplus-murasaki.herokuapp.com/

Installation

pip install murasaki

Usage

from murasaki import Murasaki


murasaki = Murasaki("https://jplusplus-murasaki.herokuapp.com/", language="sv-SE", timezone="Europe/Stockholm")

context_data = {
  "region": "Tjörns kommun",
}
template = """
| Ovanligt varmt #{ territoryShort(region), "locative" } i går
"""
murasaki.pug(context_data, template)
'Ovanligt varmt på Tjörn i går'

template = "Ovanligt varmt {{ territoryShort(region), 'locative' }} i går"
murasaki.mustache(context_data, template)
'Ovanligt varmt på Tjörn i går'

By default we will look for user credentials in MURASAKI_USER and MURASAKI_PWD respectively. They can also be set using the user and password arguments.

Methods

  • constructor(API_endpoint, language=None, timezone=None, user=process.env.MURASAKI_USER, password=process.env.MURASAKI_PWD)
  • .pug(data, template) Render a pug template
  • .pugz(data, template) Render a gzipped pug template
  • .javascript(data, template) Render a ECMAScript template literal
  • .mustache(data, template) Render a Mustache template

Changelog

  • 1.0.1

    • Make language and timezone work properly
  • 1.0.0

    • First version

Metadata

Release files for murasaki 1.0.1

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

Source distribution (sdist)

Source distribution for murasaki 1.0.1
File Size Uploaded Provenance
murasaki-1.0.1.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for murasaki 1.0.1
File Interpreter ABI Platform
murasaki-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / murasaki-1.0.1.tar.gz

Download URL murasaki-1.0.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1f22f938c034d83cf544a25d7ed538350ca19ca7d74a2407b042541ae7446d48
BLAKE2b-256 checksum
How to use checksums
3ab692a2794a0d0a1f617817021e419e7694391c664d1df1cbe39b078fdc5cda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Release files / murasaki-1.0.1-py3-none-any.whl

Download URL murasaki-1.0.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2bc2aba9c1a1d0f3a9a0749d27c05fb45c707ef64d34f0c2451db66bebf6a20
BLAKE2b-256 checksum
How to use checksums
bc18060d1f921fbddd4ff76c0ce60a3bca322626677f0b97eb39106a01ce4177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Security for murasaki 1.0.1

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

1.0.1 This release

2 release files 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