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.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 copperlace 0.4.2
File Size Uploaded
copperlace-0.4.2.tar.gz 57.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for copperlace 0.4.2
File
copperlace-0.4.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
copperlace-0.4.2-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details
copperlace-0.4.2-py3-none-manylinux_2_34_aarch64.whl Python 3 none Linux glibc 2.34+ ARM64 Details
copperlace-0.4.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
copperlace-0.4.2-py3-none-macosx_11_0_universal2.whl Python 3 none macOS 11.0+ universal2 (ARM64, x86-64) Details
copperlace-0.4.2-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.2.tar.gz

Download URL copperlace-0.4.2.tar.gz
Size 57.8 kB
Tags Source
SHA-256 checksum
How to use checksums
801a53d7cb92956de6b6909e53e55cd2e80c4bc9a104c2bc9c170d5e0c83ea58
BLAKE2b-256 checksum
How to use checksums
99bd24d60b59b0effe32c39d194feda1af80637dd77ab51141272f7925129399
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.2-py3-none-win_amd64.whl

Download URL copperlace-0.4.2-py3-none-win_amd64.whl
Size 1.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
e7121563e4988d09ad5a16aad80a7ec50a26e0c92c6d7b3dd453b38f9adcb075
BLAKE2b-256 checksum
How to use checksums
1186a47d2294f5db5920a7dda7cb46ce04d2ef0018f23d48102c47ce8f263a12
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.2-py3-none-manylinux_2_34_x86_64.whl

Download URL copperlace-0.4.2-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
c80d512bac32568a9e5d71db41ca77ba99247b8f7b139a092bd4fe9130568080
BLAKE2b-256 checksum
How to use checksums
5da78da2abc19b92f99bf14128307f64fc06f81af2dc03b3835e39ac39060847
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.2-py3-none-manylinux_2_34_aarch64.whl

Download URL copperlace-0.4.2-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
330001e9787c80eae53efda809f1a4a45539a6160b73e886da941fdd020f6242
BLAKE2b-256 checksum
How to use checksums
00c07533793969659f8fdb26d2486b2dae58161a3eca83a2a602fead915a2332
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.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL copperlace-0.4.2-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
516767bc9ab0c18bd7023092db9b89104523c941522b3db44a732858a3f4df2a
BLAKE2b-256 checksum
How to use checksums
cacb095087ae456730f135331e3fbf41f7986ea14d035100277f8c7270419c82
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.2-py3-none-macosx_11_0_universal2.whl

Download URL copperlace-0.4.2-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
26f579537c76970223559b4d634cec252059867ece87dc6331eb0315778ea7dc
BLAKE2b-256 checksum
How to use checksums
fcde39058c9c23ba1faf79cd1b778b40db6260308e28d2601bb9a02fba8643d3
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.2-py3-none-macosx_10_13_universal2.whl

Download URL copperlace-0.4.2-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
ee8287a67006a56c92ce5aa20975ac793abfa990c520ada3b5cdf7d4b84a8e2f
BLAKE2b-256 checksum
How to use checksums
f436b9d9b2f33ac277b55f1ab63066398af0e54bb925714b36a0291d30252ace
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

This release

0.4.2 This release

7 release files

0.4.1

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