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

Uploaded Python 3Windows x86-64

amalgam_lang-27.0.1-py3-none-manylinux_2_29_x86_64.whl (52.8 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

amalgam_lang-27.0.1-py3-none-manylinux_2_29_aarch64.whl (6.0 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-27.0.1-py3-none-manylinux_2_28_x86_64.whl (52.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3macOS 12.0+ ARM64

amalgam_lang-27.0.1-py3-none-any.whl (67.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-27.0.1.tar.gz
  • Upload date:
  • Size: 66.9 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.0.1.tar.gz
Algorithm Hash digest
SHA256 29343cfc5f9bf6c3957dd1620c28268b58afa2a13831885f3bf7bc11e3a50832
MD5 75c79fef72abb63d08ea9296ac8abd68
BLAKE2b-256 26a65b62b95e341f869776598abae52ba97e581730e9b140dfd405f7fab733f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8605eaee8ecbc291496d79eabae48bb9358b370e817131993de6e8b34d4b60a9
MD5 ca4f0af39d6aa50277e407a453558002
BLAKE2b-256 2deee018691722323194782e8f7a55a90525a30b16d301063a3e10b1cf283fbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.0.1-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 f67cad42ea68977f78df02e6eedd593ef13fb6256acd10a9a66c8bcccdc8d361
MD5 499edc20b5eb8f0604857675651f21c2
BLAKE2b-256 9c7fa298f57b056eab64e1fdf517d35bda4ecd5c9a0f3808e3c2882d183bba5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.0.1-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 377bc5ce1634309fa783e4c93d16ead109a5dc92346db1b3edc133ce5f465d8e
MD5 d2cad362307f5845b589d5cf6f0f3a54
BLAKE2b-256 d38ddb779a7831efa1fa45cc4ee5fc87bb02dc4f8fd564a996b89816407d2a4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.0.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bb211d8ece85c5f1e56e8069ec5ef30fb2c74d10201e35cf92c8b0c83a165653
MD5 885951e6e2333e29802c00013f92cd88
BLAKE2b-256 0b0d8558c8b1e065e7b1f191686e8f9c084fe84719b1bfbf5a13f91cb7e9eaef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.0.1-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 71b182d09252a3402b6291ae7857c90211039ee6e97590f0f7b5cbeb30a75a90
MD5 e62943ae59b2a80edfebcd30b41e0753
BLAKE2b-256 13cd4bc6f58bc906fe6821498d08d992008af0eccc1f6397ef539b63b6394bc5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgam_lang-27.0.1-py3-none-any.whl
  • Upload date:
  • Size: 67.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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1070ec396582e210c0063ee5ae440728a17808fc10a9fbb150299b11290ab280
MD5 4dc0b80c022b4d1fa3207d9981bbdd91
BLAKE2b-256 7407bcd73505fff04836e6692821d0add4014ab7da8269981d2982b1427e5423

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