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

Uploaded Python 3Windows x86-64

amalgam_lang-31.0.1-py3-none-manylinux_2_29_x86_64.whl (63.2 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

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

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-31.0.1-py3-none-manylinux_2_28_x86_64.whl (63.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3macOS 12.0+ ARM64

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-31.0.1.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-31.0.1.tar.gz
Algorithm Hash digest
SHA256 9178d7a37de7f9357617241b991f772023447d46e3ab029591fb73d0857e5d7f
MD5 d971fa56d50ff5c22e15fe7f5098f144
BLAKE2b-256 e0848a0e8ac2ffe603c306984675ebe30cf2214cb561733fbc9b27b0448b19b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-31.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c2248a68d428ab5f6fc41f79060705b2d574323c2dc1e7ca0ae536b74b0196e2
MD5 f28be042b2395a7d439722393c11bb09
BLAKE2b-256 282a4c0a8df403f29531833fd04fffd457fcd9ab8a28193adf31888f203c3b35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-31.0.1-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 a9fc92067df79db0315de27c96b2dd62e4c471ce83c3238618ad37efce3c1cff
MD5 fb72b19ffe720c6f32580288bdc138f5
BLAKE2b-256 3672519bdc9d2a8902803210d6124733236f0fc2670dea3a1764cace93582333

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-31.0.1-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 094463fd5b127b90046d4f4f500451395804ca2803b928634c5c198fd848b009
MD5 9c5afd4f8943fb562b9b2815b09bd682
BLAKE2b-256 f07f2cb35e4c70d6c49cc3ddbb0c5da8737658b82d91d94c4f17bf78a5caff68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-31.0.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c16f3c4756f5ac9b06cd52bddb08173a35215ef2629ca92613f1efac2d5266a
MD5 8ce9197e1e5ce30ca3bdc0a093016367
BLAKE2b-256 9bb6cdbb3eb87c6bf0a9cf374d524f6398d82bf4e7a6824cd3ba8b4a3c337a12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-31.0.1-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 732f15476d8ae7320b6b6b5725c2a58be5ff6de3691db73e301f9fe09ab70b5d
MD5 3780c1138ae42b895d884e56224f9686
BLAKE2b-256 5454d188d13621312cd0f149554824ec4d6ed66a34bafe1720572fa7e1365c6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgam_lang-31.0.1-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-31.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3040fbf2c646c8cfb19fe5fa9468b0e9cbc1e5edafae32e7f6b63ce506046b5a
MD5 47c288e7a508cbfef5b33040b8c9e4f3
BLAKE2b-256 51fecf7e12ff6a36730f9f80d56416c584c1fd2148ee98083d8274397679fab5

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