A direct interface with Amalgam compiled DLL, dylib, or so.
Project description
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, and 3.14.
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")
Testing
There is a Pytest unit test suite located in amalgam/test. The tests in test_standalone.py will only execute if an Amalgam binary is located in the default expected path of amalgam/lib/{os}/{architecture}.
To specify whether test_standalone.py should use single-threaded or multi-threaded Amalgam (assuming the appropriate binary is in the above path), set the AMALGAM_LIBRARY_POSTFIX environment variable to the desired postfix, e.g., -st or -mt.
License
Contributing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file amalgam_lang-34.0.0.tar.gz.
File metadata
- Download URL: amalgam_lang-34.0.0.tar.gz
- Upload date:
- Size: 81.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03f5f2966ad5c3288b4a0df8565903639092f791d188bae9f3789af84d16d5f3
|
|
| MD5 |
45f57580fcd81344c4c044c06520b1c0
|
|
| BLAKE2b-256 |
f69f27e13fb5846eafb5a6a3c86505f8ecf19fee06c6871c900fed86ebbff00d
|
File details
Details for the file amalgam_lang-34.0.0-py3-none-win_amd64.whl.
File metadata
- Download URL: amalgam_lang-34.0.0-py3-none-win_amd64.whl
- Upload date:
- Size: 5.7 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
103ca2c63f0b0b97235e5db9db36bdd50f18b562e941b893c3f8cd82f3a906b5
|
|
| MD5 |
3d1e01f95a5711d8c2147489dba10ad8
|
|
| BLAKE2b-256 |
bfe527a491f9ff8beab61b10174e6e8d083b0cce7dd1ba05b016f76c89c51cd0
|
File details
Details for the file amalgam_lang-34.0.0-py3-none-manylinux_2_29_x86_64.whl.
File metadata
- Download URL: amalgam_lang-34.0.0-py3-none-manylinux_2_29_x86_64.whl
- Upload date:
- Size: 65.0 MB
- Tags: Python 3, manylinux: glibc 2.29+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f344d1b6c2b1ca3c3eb9808e12d37baad7592149d6991277b95ed70569eb88a6
|
|
| MD5 |
d92ffabd56b39b799cc88e82f4eeafe9
|
|
| BLAKE2b-256 |
4d380fabffecc1b40051a403ec8f7627cbf465b75a611e050f4e27d39ff7a91d
|
File details
Details for the file amalgam_lang-34.0.0-py3-none-manylinux_2_29_aarch64.whl.
File metadata
- Download URL: amalgam_lang-34.0.0-py3-none-manylinux_2_29_aarch64.whl
- Upload date:
- Size: 7.0 MB
- Tags: Python 3, manylinux: glibc 2.29+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53261c28ed3efa96d89e878e53e4ef6fa514cf235b5f16254963f510ce847977
|
|
| MD5 |
78bb56b26021c11ad18157ea51271eca
|
|
| BLAKE2b-256 |
c912ee5f53e3bc946332d78c4d371c44139258db86fa6e07e325f1c982b3b9fc
|
File details
Details for the file amalgam_lang-34.0.0-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: amalgam_lang-34.0.0-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 65.1 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47470f4e06a9037add43be630d1d0401c72473cdad62d8154a89341817d6bf6f
|
|
| MD5 |
75c7c9e541241ac128dc268e67bbadd3
|
|
| BLAKE2b-256 |
fa13a853dfae9cbdd1f16a97ec05654badc026476f73c336c47247971c9e8962
|
File details
Details for the file amalgam_lang-34.0.0-py3-none-macosx_12_0_arm64.whl.
File metadata
- Download URL: amalgam_lang-34.0.0-py3-none-macosx_12_0_arm64.whl
- Upload date:
- Size: 4.0 MB
- Tags: Python 3, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d887dea8bc8ac3dfd5fbb48652606f2c9aef9937eaf0b5af267c22ea06c3701
|
|
| MD5 |
b6982a33d83dd7ec4a7f9e80df764a47
|
|
| BLAKE2b-256 |
33d7eb9e2e76466c2aa79d2c7f2a98bfb7fdabe335701bedc5042b8748c9a0ff
|
File details
Details for the file amalgam_lang-34.0.0-py3-none-any.whl.
File metadata
- Download URL: amalgam_lang-34.0.0-py3-none-any.whl
- Upload date:
- Size: 81.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94651024b13a07ec0d53c5ecdccb55413fdeb339879b860cd9c404c68f3a1112
|
|
| MD5 |
9adfe4460783863f786535bbb41d5409
|
|
| BLAKE2b-256 |
239c9cbfa1bda2efb2d19b8e8524a429495316c87e1d0d92725022f64b504641
|