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.3.1.tar.gz (79.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-27.3.1-py3-none-win_amd64.whl (5.5 MB view details)

Uploaded Python 3Windows x86-64

amalgam_lang-27.3.1-py3-none-manylinux_2_29_x86_64.whl (64.1 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

amalgam_lang-27.3.1-py3-none-manylinux_2_29_aarch64.whl (6.8 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-27.3.1-py3-none-manylinux_2_28_x86_64.whl (64.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3macOS 12.0+ ARM64

amalgam_lang-27.3.1-py3-none-any.whl (80.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-27.3.1.tar.gz
  • Upload date:
  • Size: 79.8 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.3.1.tar.gz
Algorithm Hash digest
SHA256 6999144e0457ac337726b89611a147c1ffd747374704ca82126930bd9a346310
MD5 b9fab01c81afe6cd900559303e166f36
BLAKE2b-256 521de791b39b303caaeae857dd68808e84c0a28cbf9255fddbc71395b07a3ace

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1bd493b4edad46414113f2c981f3c44cfdf947a3f5506fbff6acab84c2fff8cc
MD5 ac8c546ce3fe31e0f8f0022e7fa39936
BLAKE2b-256 2af9842287c6222ab71e50fbe3f2f4b476c3e298cf0d3b8d8fb24da36649be41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.1-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 509ab7c32f724061899b981968802fe4b89c15b55505e1d49f468f1eef0f7df6
MD5 1d80e25ab13102eb3f168f056e14ebea
BLAKE2b-256 4bc9c72322ec2b13dd0e1f239256b876ed6201a1b2b88f967b19c34f73c3d252

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.1-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 f48f36852bff18bfc83bb6fd3f6afbfb4a7fb089954515134d86f8bca2dfe22b
MD5 091aa0563d8c65ea2bc04e51ad5cb363
BLAKE2b-256 241e1ed3a675b0bb94584bf4cade9c74e12051616570583fccf8b08cb4647960

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9fb1edd2a32ae089e02545d1ea76b0b7d4dd958537fe4b5e80dc896b5a5eefc4
MD5 339d641830e8cfd19f09532661c4075c
BLAKE2b-256 1ba935891ed07577214021898c138507479af23de53d420f96c8414c8b051f99

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.1-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 12301d7df9b7e5f0812757fbe20ccfc45063ea083279cfb1a2a6325e185697fa
MD5 cf854aae0584b5c97c8601b143365cab
BLAKE2b-256 3e2cc65144b005d1109bfe51bbea7635260ec9da9e037da402911f7cefef0010

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgam_lang-27.3.1-py3-none-any.whl
  • Upload date:
  • Size: 80.2 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38ad4d2901f12a895bd638145af938bc0dcf9aff7757fccb75804afc580e8fc0
MD5 07e0b894ae07160adbaf4f64293612de
BLAKE2b-256 016cf237f4b6ca99b785482f41d8d85b75ed31a051ba80a67c273eddc0e0b7f4

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