Skip to main content

Copperlace Python

Python wrapper for the Copperlace renderer.

The wheel build runs Cargo for ../rust-core, bundles the resulting native library, and exposes a small Python API over the Copperlace C ABI.

from copperlace import Copperlace

with Copperlace.from_string('name = ["Mia"]\norigin = "{name}"') as copperlace:
    print(copperlace.render("origin"))
    print(copperlace.render("origin"))
    print(copperlace.render("origin", {"name": "Darcy"}))

with Copperlace.from_string(
    'name = ["Mia"]\norigin = "{name | shout}"',
    {"shout": lambda value: value.upper()},
) as copperlace:
    print(copperlace.render("origin"))

Recursive rule references are errors by default. Pass max_recursion_depth to allow limited recursive expansion; recursive calls beyond the limit return an empty string:

from copperlace import render_str

print(render_str('origin = "x{origin}"', "origin", max_recursion_depth=1))
# xx

Structured rendering returns JSON strings for object-valued rules:

from copperlace import render_str_structured

config = """
name = ["Mia"]
origin {
  title = "Hello {name}"
  tags = ["structured", "{name | slug}"]
  count = 3
  active = true
  missing = null
}
"""

print(render_str_structured(config, "origin"))
# {
#     "active": true,
#     "count": 3,
#     "missing": null,
#     "tags": [
#         "structured",
#         "mia"
#     ],
#     "title": "Hello Mia"
# }

RuleSet.render_structured, Copperlace.render_structured, render_str_structured, and render_file_structured return formatted JSON strings from the native renderer.

Use inferred rendering when callers want the CLI-style behavior from one method: text rules return text, list rules keep random text choice behavior, and object-valued rules return a formatted JSON string.

from copperlace import render_str_inferred

print(render_str_inferred(config, "origin"))

Release files for copperlace 0.4.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 copperlace 0.4.1
File Size Uploaded
copperlace-0.4.1.tar.gz 57.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for copperlace 0.4.1
File
copperlace-0.4.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
copperlace-0.4.1-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details
copperlace-0.4.1-py3-none-manylinux_2_34_aarch64.whl Python 3 none Linux glibc 2.34+ ARM64 Details
copperlace-0.4.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
copperlace-0.4.1-py3-none-macosx_11_0_universal2.whl Python 3 none macOS 11.0+ universal2 (ARM64, x86-64) Details
copperlace-0.4.1-py3-none-macosx_10_13_universal2.whl Python 3 none macOS 10.13+ universal2 (ARM64, x86-64) Details

Total release size: 8.6 MB

Release files / copperlace-0.4.1.tar.gz

Download URL copperlace-0.4.1.tar.gz
Size 57.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6348f6c47c9e2602920af63e9e6187fd5ca1652a92c761965d9e19609bfa66d3
BLAKE2b-256 checksum
How to use checksums
be51b0dd6580c9d8d89efe4ca4dcfda1aa77e0cc2a806708a5b81c04f78ffc1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / copperlace-0.4.1-py3-none-win_amd64.whl

Download URL copperlace-0.4.1-py3-none-win_amd64.whl
Size 1.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b95e71b9fb90299cc3764995525204b6c71f13e7aab29a5ab99420c185aa076a
BLAKE2b-256 checksum
How to use checksums
522a361db107795b0a04e4105c162fbc1b65aeac7d8e3296b723fcc1bb7616e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / copperlace-0.4.1-py3-none-manylinux_2_34_x86_64.whl

Download URL copperlace-0.4.1-py3-none-manylinux_2_34_x86_64.whl
Size 1.5 MB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
39ae99bd6c8dba2fa982953dfe00507d43406a66f9594402561bc5e84391dc7d
BLAKE2b-256 checksum
How to use checksums
f5def817608fe7cf098ea24944fd14be97bf0b9f1ba7a0971e5dc7a254ccb9d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / copperlace-0.4.1-py3-none-manylinux_2_34_aarch64.whl

Download URL copperlace-0.4.1-py3-none-manylinux_2_34_aarch64.whl
Size 1.5 MB
Tags Linux glibc 2.34+ ARM64 Python 3
SHA-256 checksum
How to use checksums
4c1ff19d5b5018d24c40c153d05208105d42d201758e7960b3ba99f2d6502897
BLAKE2b-256 checksum
How to use checksums
ee27a254cca030723124950f2061ced1c162022a7c580063c9e3bd6385457a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / copperlace-0.4.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL copperlace-0.4.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.5 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
262c906f03b29df6be6d8a1d8839e4352a07059d44c74d200ab95b247e324072
BLAKE2b-256 checksum
How to use checksums
d97359bb2ac9aa07275c28f83c401e672682837ee0ac3376fea830a2d0ee16e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release files / copperlace-0.4.1-py3-none-macosx_11_0_universal2.whl

Download URL copperlace-0.4.1-py3-none-macosx_11_0_universal2.whl
Size 1.3 MB
Tags Python 3 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
aaaf5b944688ff4ba5ccc64a5213741429c41f2157bac8f8aa116048688c3d8f
BLAKE2b-256 checksum
How to use checksums
ebe346fb7289ed92e26bddb194a3011bc4da4c6db3c014faf74aa186648c0952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / copperlace-0.4.1-py3-none-macosx_10_13_universal2.whl

Download URL copperlace-0.4.1-py3-none-macosx_10_13_universal2.whl
Size 1.4 MB
Tags Python 3 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
8a56798de7086e914aa04642bb4c598ea2bb874efe4fd825271bafb939097a0e
BLAKE2b-256 checksum
How to use checksums
b2dac6849b8860decb9144257a08834c3d8d8ff76be7f100ec270168898ab507
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.2

7 release files

This release

0.4.1 This release

7 release files

0.4.0

6 release files

0.3.1

6 release files

0.3.0

6 release files

0.2.1

1 release file

0.1.0

1 release file

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