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.9, 3.10, 3.11, and 3.12.

Operating Systems

OS x86_64 arm64
Windows Yes No
Linux Yes Yes
MacOS Yes 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-16.1.0.tar.gz (66.5 MB view details)

Uploaded Source

Built Distributions

amalgam_lang-16.1.0-py3-none-win_amd64.whl (4.8 MB view details)

Uploaded Python 3Windows x86-64

amalgam_lang-16.1.0-py3-none-manylinux_2_29_x86_64.whl (47.8 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

amalgam_lang-16.1.0-py3-none-manylinux_2_29_aarch64.whl (5.5 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-16.1.0-py3-none-manylinux_2_28_x86_64.whl (48.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

amalgam_lang-16.1.0-py3-none-macosx_12_0_x86_64.whl (5.5 MB view details)

Uploaded Python 3macOS 12.0+ x86-64

amalgam_lang-16.1.0-py3-none-macosx_12_0_arm64.whl (3.3 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

amalgam_lang-16.1.0-py3-none-any.whl (66.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-16.1.0.tar.gz
  • Upload date:
  • Size: 66.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for amalgam_lang-16.1.0.tar.gz
Algorithm Hash digest
SHA256 f1213b9f95d2f62fe820f4f64aef5351ea9e37ac2fdb05bd1078695478d74211
MD5 564a71faf364b79521f8942c6917024f
BLAKE2b-256 b55fdd4542e3040944a3a9076700f561d934eed3d07c77a74d2e60b6b3191ff4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 13d613ee02b2e0caa949f3031e261fd410c87d39d0f038e6be3acc38f9aaade8
MD5 c7d447db1cbab284c160aea92705a513
BLAKE2b-256 6828193d413ae6e4d46070e78c3b23938e67e601641980fad23a6a1abd0a2e10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.0-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 3e209eeff925acc3aa0cf5ac7923ce981fc9c42f9607ec8616aa70deb122a42f
MD5 3fad1158b39998c1fb75149f20134d70
BLAKE2b-256 5b6f8dee06707fb55aa3ec2c454b4bf40cbb338b527cb93bb0b9825389a8d095

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.0-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 21bc260a557080d420169a0c50ec166dbb2d642312a8ceccf781394a94de0835
MD5 3b5de22d8bb1d49b106525478ae135ac
BLAKE2b-256 98df2961ba21d850f4d9fe265ec53856b845ccdc026d5ffb0edb335c7090b600

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa5a087ad550a00f110f5a0f73902f4c6aef167850c6101ce67a7a3e82f084b2
MD5 5189fc3c23bd3e72a0faf6448b0494cd
BLAKE2b-256 caf57cbc3c674e8a32e1ce59d2592b1970fbaa8f4816413a94a4d1d904343158

See more details on using hashes here.

File details

Details for the file amalgam_lang-16.1.0-py3-none-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for amalgam_lang-16.1.0-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 80ec7f8f5ef162d5515a36a3b40602b73a2d41999a940410158c3eca21126218
MD5 05c6b17072abe94ca13846fd527955c6
BLAKE2b-256 860840df82932739cdb02dd2fa8557e185a645c05faf7e2316f2c78b18255a4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.0-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 183896437cbbef0977a4f025ebcec71115324c8889a740551690a39d5ddb325e
MD5 b5f5c6af26e84abb4f28c44d886464ac
BLAKE2b-256 94f87d5cf2dd29ac5f1f3fa755014ffe804c8ecf9333c918b8be70212709cce6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgam_lang-16.1.0-py3-none-any.whl
  • Upload date:
  • Size: 66.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for amalgam_lang-16.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4729dcb9c239797e1dfb5357dad5b9694ca71498f284bd2d54c5b7f7983f7ff
MD5 3f5557f3fa5c15975337932a9e88eae7
BLAKE2b-256 0181473b261b63cb30e3c46987aa430d82fd475327640ac0a681d48897688be0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page