A direct interface with Amalgam compiled DLL, dylib, or so.
Project description
Amalgam™
Amalgam™ is a domain specific language (DSL) developed primarily for genetic programming and instance based machine learning, but also for simulation, agent based modeling, data storage and retrieval, the mathematics of probability theory and information theory, and game content and AI. The language format is somewhat LISP-like in that it uses parenthesized list format with prefix notation and is geared toward functional programming, where there is a one-to-one mapping between the code and the corresponding parse tree. The Howso Engine is an example of a program written in Amalgam.
Resources
General Overview
Coding in Amalgam can be done natively as demonstrated in the Amalgam User Guide or through this Amalgam™ Python wrapper. The Python wrapper handles the binaries for the user so the user just needs to worry about the code.
Supported Platforms
Compatible with Python versions: 3.9, 3.10, 3.11, and 3.12.
Operating Systems
OS | x86_64 | arm64 |
---|---|---|
Windows | Yes | No |
Linux | Yes | Yes |
MacOS | Yes | 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
File details
Details for the file amalgam_lang-15.0.0.tar.gz
.
File metadata
- Download URL: amalgam_lang-15.0.0.tar.gz
- Upload date:
- Size: 66.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce13df75dd31b6234f2c7f9a1a9bc6eec7199b8e6e98871e3a133b744822085c |
|
MD5 | 8fce3040132f517d5b132f6926f36dd4 |
|
BLAKE2b-256 | e7e6acdcd7de96bc004d28e55b669fee6d430f66e1ea40df27f29764be1fd40a |
File details
Details for the file amalgam_lang-15.0.0-py3-none-win_amd64.whl
.
File metadata
- Download URL: amalgam_lang-15.0.0-py3-none-win_amd64.whl
- Upload date:
- Size: 4.9 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30fde93623c0a441a4d1876267aedd6f65223daca1ea47bf020b16f5cdee95c7 |
|
MD5 | a6efddf08717de24a340b7a4a095d35c |
|
BLAKE2b-256 | 7b1c40d7bfa96c8c7f59de36301e4c49d5e719e8125e73e2dee2709868ea9c00 |
File details
Details for the file amalgam_lang-15.0.0-py3-none-manylinux_2_29_x86_64.whl
.
File metadata
- Download URL: amalgam_lang-15.0.0-py3-none-manylinux_2_29_x86_64.whl
- Upload date:
- Size: 47.5 MB
- Tags: Python 3, manylinux: glibc 2.29+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 546c92b9422956e6dbe61b17479425a53030d3470f0314e054200c95e4d13e69 |
|
MD5 | 4a23d167a778bbfb26828cff95d707ac |
|
BLAKE2b-256 | cee43c83f22b34c2e8d602e42e019dcf30868f6ed90859355f860ba31459ec23 |
File details
Details for the file amalgam_lang-15.0.0-py3-none-manylinux_2_29_aarch64.whl
.
File metadata
- Download URL: amalgam_lang-15.0.0-py3-none-manylinux_2_29_aarch64.whl
- Upload date:
- Size: 5.4 MB
- Tags: Python 3, manylinux: glibc 2.29+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a64edfeca4b6b2ee599e483d6b62f4fb0e02add1c511cd82fc238728fedf0a7 |
|
MD5 | 853c9133aa0dc1c60123ce643ec0d595 |
|
BLAKE2b-256 | 75a07255326e0f73500bd5250a21fc9b25efb4baa506dbc387f3730788d0c61e |
File details
Details for the file amalgam_lang-15.0.0-py3-none-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: amalgam_lang-15.0.0-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 47.6 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 611de895f992239469088187ea08825e2c7701222adce8b7718a8452acdf5f1a |
|
MD5 | 5eecce80592a3012732710ff24c729be |
|
BLAKE2b-256 | 47141af403d23c0e1b8793cda805edd6480f42b9b9d97913a67044f828ea7d02 |
File details
Details for the file amalgam_lang-15.0.0-py3-none-macosx_12_0_x86_64.whl
.
File metadata
- Download URL: amalgam_lang-15.0.0-py3-none-macosx_12_0_x86_64.whl
- Upload date:
- Size: 5.6 MB
- Tags: Python 3, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cb7ef495a5178cc0fcea2551e53cc6df581372a57c2c1af461085cc1482ce45 |
|
MD5 | ad5cd30d9f844b87749c01cc38818cb1 |
|
BLAKE2b-256 | f9adb4de6647129785607db7dee2864f1172316f0d2893c38ccbb0fd89efa649 |
File details
Details for the file amalgam_lang-15.0.0-py3-none-macosx_12_0_arm64.whl
.
File metadata
- Download URL: amalgam_lang-15.0.0-py3-none-macosx_12_0_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cde008590927a8239f3ff668f47194f35f8730c5a3d81c0464e854580f0934f2 |
|
MD5 | 6832460563c2f3a52b249036c7d36a33 |
|
BLAKE2b-256 | 5156ae75720db89515e947124f3c2d20e65bea61cd00d59f1b83aae07de40219 |
File details
Details for the file amalgam_lang-15.0.0-py3-none-any.whl
.
File metadata
- Download URL: amalgam_lang-15.0.0-py3-none-any.whl
- Upload date:
- Size: 66.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49a2258dfa0b4a3d802c6fd7948e1f3c4fbfc6ec0ec54f69696f306be8f36333 |
|
MD5 | d618a1e7ea9b65828c47004b720649cb |
|
BLAKE2b-256 | 2fa7f46f3cfea8266ffce99400e1c18b7252664d4647ac4b2013f91b57356113 |