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.1.tar.gz (79.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-32.0.1-py3-none-win_amd64.whl (5.7 MB view details)

Uploaded Python 3Windows x86-64

amalgam_lang-32.0.1-py3-none-manylinux_2_29_x86_64.whl (63.8 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

amalgam_lang-32.0.1-py3-none-manylinux_2_29_aarch64.whl (6.7 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-32.0.1-py3-none-manylinux_2_28_x86_64.whl (64.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

amalgam_lang-32.0.1-py3-none-macosx_12_0_arm64.whl (4.0 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

amalgam_lang-32.0.1-py3-none-any.whl (80.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-32.0.1.tar.gz
  • Upload date:
  • Size: 79.7 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.1.tar.gz
Algorithm Hash digest
SHA256 fbd1eb982e4b551de22a6cc17000d01ce21eaa27ddc1ede7a654911ebf0eecea
MD5 c45151956d8cfff080285217ae02ddae
BLAKE2b-256 b56794d97690b1090cf1dc6627a4e0d0ba4bff09453e9f5553175b2881059fa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bda82e151db9698a06d54922dd15984cde6fcd1a029640c6052d92f9e3bd287c
MD5 db24086e86116ebcab70b752adc364ec
BLAKE2b-256 0bc9f7cbace0596cbeb666623886c47ff05d89198bc45569a6275ae8febcaa2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.1-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 e01a7e1f226db82b3c425bb170ae2a5af1e6d28a734f3c3b96ffc4c87954ef7e
MD5 8187d5ccfdb4378107b66219eeef6745
BLAKE2b-256 ead5a64756530a0e9b6a083f6073481a7f0344ab409105b377515bc533d64291

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.1-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 8e61addf3a0ae60f9287d8bbd8ad0dc79856bc228c422f0bdc16e233d5c803a6
MD5 86a022cd0914c2cbfc4d4e09439790b9
BLAKE2b-256 770fab41c325fcd4b93b16ce36e3028bc08e2670f8ea023154547cf36e7c2e01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 82415db22d2187a35b14d9aea13b845335b03bb2532f80464bffd19e6ba0e398
MD5 d797526862859adab8529bc2192ddfbf
BLAKE2b-256 2f04b6aa84da1fac7401027a93717d90a957ba8b5b9b713aa7515b69e3c6bba1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-32.0.1-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 5dc3859c11721890ce2b75006c1b10d60bc919619cc82672ae7be6e24c77c6ed
MD5 2fe1f00a534a503e9b076cc4a77b8054
BLAKE2b-256 c988149ccf1f8aa120293f8e50fd02d970022325e096f73aa1b8d9969781f800

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgam_lang-32.0.1-py3-none-any.whl
  • Upload date:
  • Size: 80.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0b342bc96319de3cac069074b19eb02d20ee6650724194c9d190ddf9154e261
MD5 4ea4d819b401af17bc3963435b74b4a6
BLAKE2b-256 691124d57f240b0b92f185cdbf42ce8cd7e8a8884574284bbc02254e5828eb44

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