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.4.0.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.4.0-py3-none-win_amd64.whl (5.5 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.29+ x86-64

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

Uploaded Python 3manylinux: glibc 2.29+ ARM64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3macOS 12.0+ ARM64

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-27.4.0.tar.gz
  • Upload date:
  • Size: 79.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-27.4.0.tar.gz
Algorithm Hash digest
SHA256 2c260410de315374f10af8a5314b5c3271ea0ef05c22b6f7fa209939174c5d03
MD5 c483edff62270fe2503b4b01a7d7ee74
BLAKE2b-256 a8cf1d9b17ea6a6b8d7e3a1e2919e404b9bc806414f3883a48f0ca17dc607a66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cd455e5d194eb92fb1421710420e9f1553ec3c678a0465896b2a96c0641975ae
MD5 c30134db8c44c7d8e62c36ec84c60792
BLAKE2b-256 dd17e8d9ff57e4caf4f12012bd4118983b7a94861d9ff11edc4f0b20193a520c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.4.0-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 95a32fbe4060f2c3fbbbb4a3b78949819faf70a1ab3d458ad01c883ab946dc66
MD5 13046a1ff5551d3295e4581e20ab8ac7
BLAKE2b-256 5e4e38b84713873fd48d5ca42c7f95f47296b67284758a89d63d8a8b7795a412

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.4.0-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 71ae2b52f892ef861860f875335d139eb9617b3d179e0eb65e012f65871aefd9
MD5 ad32bf8d96be943280441f06edd52a96
BLAKE2b-256 c81e75fcd2a960f37b99154cdf05576e26f4e266d18f2a396567364d3c1dcba0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.4.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a594270c8f741843a5a1bf4a3634e55526e299c82605ba354dab126dc9b12d9d
MD5 fa6a571f841feb957da3784adb94aa3b
BLAKE2b-256 77c5b57f32dedb2845aefb0e7ff78f318724e28f06d95ee83037d995969376d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.4.0-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 48874ae6fd69c9cbbf02613eb456d1c435521c7173135b91222552edfd3c45cc
MD5 48a7347f4f4724954175b4d960767807
BLAKE2b-256 af0ae9a4e61364d4efeaf636ba68ddb3b8ded724f585d9d944d3c9cf080ff268

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgam_lang-27.4.0-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.12

File hashes

Hashes for amalgam_lang-27.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5412da34fbac4fedd1c6204405d8ae8e13becf914ac4ee2e4a66d730f99c0585
MD5 f915fc185766e1978bcde3c1be66bf76
BLAKE2b-256 7b8ae8760763ace7cfb4a083d15ffa4e62d4a225fab68c3c0c15ea5dbc1c2402

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