Skip to main content

Amalgam®

Amalgam® is an LLM-ready, tree-structured language for safe, sandboxed code generation, manipulation, and advanced information-theoretic inference. Unlike traditional languages that prioritize developer shorthand, Amalgam focuses on code-data symmetry and semantic consistency. These properties give it unique strengths in a wide variety of domains, including genetic programming, instance-based machine learning, simulation, agent-based modeling, data storage and retrieval, the mathematics of probability theory and information theory, and game content and AI. This package supports directly calling the language via Python.

Coding in Amalgam can be done natively as demonstrated in the Amalgam User Guide or through this Python wrapper.

Supported Platforms

Compatible with Python versions: 3.11, 3.12, 3.13, 3.14, and 3.15.

Operating Systems

Binaries are built for the following operating systems, though in theory they could be built for virtually any modern system.

OS x86_64 arm64
Windows Yes No
Linux Yes Yes
MacOS No Yes

Install

To install the current release:

pip install amalgam-lang

Usage

This wrapper allows the user to write and execute Amalgam™ code in Python, just like any other Python program. Once the wrapper is imported, the code handles like native Python code as shown below:

from amalgam.api import Amalgam
import json

amlg = Amalgam()
# Load entity .amlg or .caml file
amlg.load_entity("handle_name", "/path/to/file.amlg")
# Execute a label in the loaded entity, passing parameters as JSON
response = amlg.execute_entity_json("handle_name", "label_name", json.dumps({ "abc": 123 }))
result = json.loads(response)

The wrapper handles the Amalgam language binary (so/dll/dylib) automatically for the user, however the default binary can be overridden using the library_path parameter.

amlg = Amalgam(library_path="/path/to/amalgam-mt.so")

Native backends

The wrapper calls the Amalgam C library through one of two backends: the compiled C extension amalgam._api, or a fallback backend that calls the library through ctypes. Both backends pass bytes arguments to the engine without copying them; the C extension also passes ASCII str arguments, such as json.dumps() output, without the UTF-8 copy the ctypes backend makes, which matters for large payloads. The AMALGAM_PY_BACKEND environment variable selects one:

  • auto (the default, also used when the variable is unset or empty) uses the C extension when it is installed and ctypes otherwise.
  • c uses the C extension, and raises ImportError when it is not installed.
  • ctypes always uses ctypes.

Releases publish cp311-abi3 wheels that include the C extension for Linux (manylinux, x86_64 and aarch64), macOS (arm64), and Windows (amd64), plus a py3-none-any wheel without it that always uses ctypes. A source or editable install (pip install . or pip install -e .) compiles it, which needs a C compiler; without one, the install still succeeds and uses the ctypes backend.

Testing

There is a Pytest unit test suite located in amalgam/test. Most tests load the Amalgam library from amalgam/lib/{os}/{architecture} and are skipped when it is not there; link or copy the libraries from a local Amalgam build into that directory, or download a release matching version.json and copy its lib/ files there.

To specify whether the tests should use single-threaded or multi-threaded Amalgam, set the AMALGAM_LIBRARY_POSTFIX environment variable to the desired postfix, e.g., -st or -mt.

Tests that call the library run once per native backend. The C extension backend is skipped when the extension is not built; pass --require-c-extension (on by default when the CI environment variable is set to a truthy value, meaning anything other than empty, 0, false, no, or off, ignoring case and surrounding whitespace) to make a missing extension a test failure instead.

License

License

Contributing

Contributing

Metadata

Release files for amalgam-lang 38.0.3

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

Source distribution (sdist)

Source distribution for amalgam-lang 38.0.3
File Size Uploaded Provenance Actions
amalgam_lang-38.0.3.tar.gz 100.8 MB Without provenance Details for amalgam_lang-38.0.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for amalgam-lang 38.0.3
File Actions
amalgam_lang-38.0.3-py3-none-any.whl Python 3 none any Details for amalgam_lang-38.0.3-py3-none-any.whl
amalgam_lang-38.0.3-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for amalgam_lang-38.0.3-cp311-abi3-win_amd64.whl
amalgam_lang-38.0.3-cp311-abi3-manylinux_2_29_x86_64.whl CPython 3.11 abi3 Linux glibc 2.29+ x86-64 Details for amalgam_lang-38.0.3-cp311-abi3-manylinux_2_29_x86_64.whl
amalgam_lang-38.0.3-cp311-abi3-manylinux_2_29_aarch64.whl CPython 3.11 abi3 Linux glibc 2.29+ ARM64 Details for amalgam_lang-38.0.3-cp311-abi3-manylinux_2_29_aarch64.whl
amalgam_lang-38.0.3-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for amalgam_lang-38.0.3-cp311-abi3-manylinux_2_28_x86_64.whl
amalgam_lang-38.0.3-cp311-abi3-macosx_12_0_arm64.whl CPython 3.11 abi3 macOS 12.0+ ARM64 Details for amalgam_lang-38.0.3-cp311-abi3-macosx_12_0_arm64.whl

Total release size: 388.8 MB

Release files / amalgam_lang-38.0.3.tar.gz

Download URL amalgam_lang-38.0.3.tar.gz
Size 100.8 MB
Tags Source
SHA-256 checksum
How to use checksums
b1a033ec1e51f5c958ab30f2b886b0ec011d8a753ed826c6fe5284c42dd2650a
BLAKE2b-256 checksum
How to use checksums
1be2ccc42c89d9fc6506dc0afe252800ac54012ca4cdbd5bea411d04d7893428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / amalgam_lang-38.0.3-py3-none-any.whl

Download URL amalgam_lang-38.0.3-py3-none-any.whl
Size 101.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8db3a364ca0b4d0cfc51ed9a6999072edb80bc68597af995c6460eba74c8e7b7
BLAKE2b-256 checksum
How to use checksums
64d5e177ec8ec3da3fdb98bdf754f0784e732ec6c909ef8adc3c5bf0ed71bf35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / amalgam_lang-38.0.3-cp311-abi3-win_amd64.whl

Download URL amalgam_lang-38.0.3-cp311-abi3-win_amd64.whl
Size 6.3 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7eec04752386e254c89749d2c9ce806f10a217659503fa0e676ad11b86e87a3a
BLAKE2b-256 checksum
How to use checksums
785587b47b18e721a927691c1025261b38116eccd09ec7f6e6ce6d25c9afb1c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / amalgam_lang-38.0.3-cp311-abi3-manylinux_2_29_x86_64.whl

Download URL amalgam_lang-38.0.3-cp311-abi3-manylinux_2_29_x86_64.whl
Size 82.4 MB
Tags CPython 3.11 Linux glibc 2.29+ x86-64 abi3
SHA-256 checksum
How to use checksums
76064149ae10bd81f8962443b5d85963ad0da15070ca3a96010f33218baa1621
BLAKE2b-256 checksum
How to use checksums
ba8da86f6d37e10b76f8dc0c1a87e12ab79894833ad7d927475f1888ad5c5ace
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / amalgam_lang-38.0.3-cp311-abi3-manylinux_2_29_aarch64.whl

Download URL amalgam_lang-38.0.3-cp311-abi3-manylinux_2_29_aarch64.whl
Size 8.3 MB
Tags CPython 3.11 Linux glibc 2.29+ ARM64 abi3
SHA-256 checksum
How to use checksums
c4c5b4fb18db2cc459d1c725b83d01b3f5b6148894e0382f68e02a5d233200ab
BLAKE2b-256 checksum
How to use checksums
ba06d09d3f4f882ef1d97ff8233a139c8b33f7a19dc7ba06917fdce77ba0b701
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / amalgam_lang-38.0.3-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL amalgam_lang-38.0.3-cp311-abi3-manylinux_2_28_x86_64.whl
Size 85.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
092cb265a15986209d1990c852b970f1e4036261e43e02b96f26dede300869d6
BLAKE2b-256 checksum
How to use checksums
06e1a3ed58508e23abfd820ca94b406eee6217948b0d8299e2fde1821e4156de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / amalgam_lang-38.0.3-cp311-abi3-macosx_12_0_arm64.whl

Download URL amalgam_lang-38.0.3-cp311-abi3-macosx_12_0_arm64.whl
Size 4.5 MB
Tags CPython 3.11 abi3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
9e2aa82507c19d5bb34c73d5d68d9b922d1c5109ec792144e044936a02ec4cee
BLAKE2b-256 checksum
How to use checksums
470e12c7a4ddcaeea693388f84ceb7ed49c82fada648f23339426c7b2f6d9f10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for amalgam-lang 38.0.3

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

38.0.3 This release

7 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