Skip to main content

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.10, 3.11, 3.12, and 3.13.

Operating Systems

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

License

Contributing

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

amalgam_lang-31.0.0.tar.gz (78.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

amalgam_lang-31.0.0-py3-none-win_amd64.whl (5.6 MB view details)

Uploaded Python 3Windows x86-64

amalgam_lang-31.0.0-py3-none-manylinux_2_29_x86_64.whl (63.2 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

amalgam_lang-31.0.0-py3-none-manylinux_2_29_aarch64.whl (6.6 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-31.0.0-py3-none-manylinux_2_28_x86_64.whl (63.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

amalgam_lang-31.0.0-py3-none-macosx_12_0_arm64.whl (3.9 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

amalgam_lang-31.0.0-py3-none-any.whl (79.2 MB view details)

Uploaded Python 3

File details

Details for the file amalgam_lang-31.0.0.tar.gz.

File metadata

  • Download URL: amalgam_lang-31.0.0.tar.gz
  • Upload date:
  • Size: 78.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for amalgam_lang-31.0.0.tar.gz
Algorithm Hash digest
SHA256 1b6ee801fdc60043f2ff2dfc2d0ba4088626a4df959272f24cd1e7e732fe96d9
MD5 5f70430c0b26f76103e4b45a182159b5
BLAKE2b-256 24a244484c4c4523614a24fbe9b51985c7c76f8b45e928c9331295f603548787

See more details on using hashes here.

File details

Details for the file amalgam_lang-31.0.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for amalgam_lang-31.0.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 aa93468ae5cd69b2cea22eb4b625ac323a47a9990fec0316a11e31b88efa6a10
MD5 887347bd460f47555015f5bbe8e003a3
BLAKE2b-256 c2d1e55da0ecce129e8b1d0ec094536621669bc14862a50826e3fcfab85aaad5

See more details on using hashes here.

File details

Details for the file amalgam_lang-31.0.0-py3-none-manylinux_2_29_x86_64.whl.

File metadata

File hashes

Hashes for amalgam_lang-31.0.0-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 aba18e315327625aa7467694854f4f41fcc54a2120d7435e5ed767a077023eb8
MD5 11f5133f6fd5c54a6327cfafd34a4d1f
BLAKE2b-256 0be87d838f8a847df0c3890275746fb61f0ec8b4db42f5587aba985f0df356f8

See more details on using hashes here.

File details

Details for the file amalgam_lang-31.0.0-py3-none-manylinux_2_29_aarch64.whl.

File metadata

File hashes

Hashes for amalgam_lang-31.0.0-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 bc76db1d2b49d4be65162e469b1df63f23a7d02b7d8061e4e2c263f03ce12898
MD5 863a6c8b5cb753cfca41ae9b307cb1de
BLAKE2b-256 16d55fb8bd2b800a2b654925329f066a3ec6780c09fa0954c269f3e11f798330

See more details on using hashes here.

File details

Details for the file amalgam_lang-31.0.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for amalgam_lang-31.0.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8cac1b1bf731247dee8c01e2fb29982673fb55770828493e6eafd476df65b3ba
MD5 fa3569b31350b8a625c92ffb56bcc2cf
BLAKE2b-256 49a572d48a9f169a1c6e8dfbdce45422d680ea3f0cf0f38303953ef2069dbb2d

See more details on using hashes here.

File details

Details for the file amalgam_lang-31.0.0-py3-none-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for amalgam_lang-31.0.0-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 c53f708508bbaa48f733197a80484dc2819c0b0725696b665d7f0a9e4a9fa0b2
MD5 6c3053356fd6b0a85176bc3cb51474d4
BLAKE2b-256 5d936857a577493c56fabbe737542496a670bd4af6d34d69bfc98f1bd07f9e04

See more details on using hashes here.

File details

Details for the file amalgam_lang-31.0.0-py3-none-any.whl.

File metadata

  • Download URL: amalgam_lang-31.0.0-py3-none-any.whl
  • Upload date:
  • Size: 79.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for amalgam_lang-31.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c8451da63ac02c4ee20831a333fde6446086b79fad74213ec1a7f9b00162c40
MD5 1053b9804659ac6144aa2c524a9fbfab
BLAKE2b-256 2d4b0baf21d7223f4adb35e86210685103e80d9910e3874553bc542d9bf5d0b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page