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-27.1.0.tar.gz (68.7 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-27.1.0-py3-none-win_amd64.whl (5.0 MB view details)

Uploaded Python 3Windows x86-64

amalgam_lang-27.1.0-py3-none-manylinux_2_29_x86_64.whl (54.5 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

amalgam_lang-27.1.0-py3-none-manylinux_2_29_aarch64.whl (6.1 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-27.1.0-py3-none-manylinux_2_28_x86_64.whl (54.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

amalgam_lang-27.1.0-py3-none-macosx_12_0_arm64.whl (3.6 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

amalgam_lang-27.1.0-py3-none-any.whl (69.1 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for amalgam_lang-27.1.0.tar.gz
Algorithm Hash digest
SHA256 8e3c5ed24c9e86fc3c8977f527c487d8dfb0f011e447160c9119276854bb3b6e
MD5 a4acc65e315811844066071d6f010a0b
BLAKE2b-256 6d72be605c44bddf4d690f942ed5f00e9d8d886b47bef4d8cfbf708d169ed224

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5ce55194fe4686e8e6082faa8841c461fe79354010a42b28a88ad5a5eb97659a
MD5 264e69ae427071ece4ecee367bdc0c09
BLAKE2b-256 43d112370fb31cd72976c359667b5f222f1b8fe9efd13aca62ae6c7db797523b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.1.0-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 d294e648277f919d0ab13de1d11782774145eb531edc810be94c8b22457976dd
MD5 0c9a11915261ba731340d121bb1ed435
BLAKE2b-256 6d537915d6b85f44772eba8488e3cb6fc8a5e35444c41769be409bf5c50eecad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.1.0-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 5e1c57e82e230c544021f02b18bc5305828d62e2f64d0493e15af387bdbe6752
MD5 079411d4ae765cbb97addfa9cc1249c0
BLAKE2b-256 bd96ffaa47a4c96bca080dbe64eaae794e01ef4bad5592cb356a67fb001b8726

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.1.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 37d517768a0f51a020a07b7f0ea81250a2743d15cb7820ea42ef1a6bd92fdcc7
MD5 3556cc027f2a4faf2bbea1b665105f7c
BLAKE2b-256 dcc77b01c83d41229d84328c4d87efadf07710d2b96ec850fcd458e9fb47d8ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.1.0-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 26c4733389670366fc32936ecd4b9f815c8f80cec8566a26cf2a05192d1bf6d8
MD5 b78f015fd4ddd8ee79d7738c40ace4b0
BLAKE2b-256 c3d7720ae1bde865e43e8efcd2348a7dcd7255775d71f10ce88d599f06d09e32

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for amalgam_lang-27.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 062db0cee47d9e04d0e4ea3aeb28c3609dfefe1edce6eb812cc635cf32624584
MD5 97ddc8dc821a90d68a6bf703e90ee70e
BLAKE2b-256 5aaa0022c9640eb8b56141a70a4b5d18c83fe0e903041dc0feb30e1e42fcf07c

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