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-32.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-32.0.0-py3-none-win_amd64.whl (5.6 MB view details)

Uploaded Python 3Windows x86-64

amalgam_lang-32.0.0-py3-none-manylinux_2_29_x86_64.whl (63.1 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

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

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-32.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-32.0.0-py3-none-macosx_12_0_arm64.whl (3.9 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-32.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-32.0.0.tar.gz
Algorithm Hash digest
SHA256 a680fa4837c453d6c7ad9793ed1583df4c052c6224509c1a05884c41b2f71f2b
MD5 6279ec3bad7e32817af697c81f4ea95f
BLAKE2b-256 6489a62919a435e978e7587b80dccc9063c0ba0d705796c4ee412d9aae16d217

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bf6a7287650336046236f60ab3bc72d530d3ac340616c82d82785bcf0cb6f89f
MD5 5be660755e2b92d736cc9ec92f552c6f
BLAKE2b-256 d6aa1c7e99383d62d948d8fea67d82919d8453d4ba0a5e43629cc8ce72cf1652

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.0-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 ec81e9ecb0589b364e55750e5e8a2453550483fe5a475a72095cbe14206985cc
MD5 02c94929e3b8f9c3c1a7e4f5e47f132f
BLAKE2b-256 78e256f696842c9e998492099d0cc6b7da6700b12ce396107487c65fe39757fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.0-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 145af7522b742f58f92d47cb4a9e24bc6369fae6b6463907f218c2f9b995c44e
MD5 b516d3b83b22998b2f08adc04697906d
BLAKE2b-256 0a23a404d6cb94a64631369b61c22cc3412d4d69889596eff9e58ebbcad86dd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cfa5d4e695a14efb7b4054852a845deee31a8df740aee868465f496c1b486b04
MD5 6daceacdf03290166c6398c0e551ff49
BLAKE2b-256 615a1227fd243afbdcc95e7e84f1dd0e1bcf3226cfafc98b46d3a36db2745cc7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.0-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 e79e8d41c226caafaeb23a52d223c1e64c34406ff0d4011f99cc02c2551a887f
MD5 859edfee94ed8e7e8d27fd71bb43957b
BLAKE2b-256 a114885301470d12e1706c26c7795f3a7ff47ba51697d4a55439f0f6c964d4f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgam_lang-32.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-32.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45219e520f284b72c6eba60efeb5e08121bca704eb74a4de26dc280360171c62
MD5 ea5255d240fbfa175a13f9c08fb92ce6
BLAKE2b-256 1c93f73a36dfa0926fb574e5e17b51fad1bba05bbc2098fd1dd7a457bd6b3392

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