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-15.0.1.tar.gz (66.2 MB view details)

Uploaded Source

Built Distributions

amalgam_lang-15.0.1-py3-none-win_amd64.whl (4.9 MB view details)

Uploaded Python 3 Windows x86-64

amalgam_lang-15.0.1-py3-none-manylinux_2_29_x86_64.whl (47.5 MB view details)

Uploaded Python 3 manylinux: glibc 2.29+ x86-64

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

Uploaded Python 3 manylinux: glibc 2.29+ ARM64

amalgam_lang-15.0.1-py3-none-manylinux_2_28_x86_64.whl (47.6 MB view details)

Uploaded Python 3 manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3 macOS 12.0+ x86-64

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

Uploaded Python 3 macOS 12.0+ ARM64

amalgam_lang-15.0.1-py3-none-any.whl (66.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-15.0.1.tar.gz
  • Upload date:
  • Size: 66.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for amalgam_lang-15.0.1.tar.gz
Algorithm Hash digest
SHA256 ee24bb26ca12de24ea9f73ebf03e67de650b5fc0c09640c82bfcf9541bbf2092
MD5 eb05b3eb2a5e87a429ca090a64994292
BLAKE2b-256 69c6de6189804cf0d09424dc876c4d47d9f9ab34d1c3d3e0bb88c7e5ccf87009

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-15.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d0a0084cca6f8ddcb374584b42bad7f46c3ec65a58867f6400cbace24b0f5507
MD5 67f6ae38b885ff8818f683f290653002
BLAKE2b-256 d7ca7496f59fffc09fb7e7e5b2e9797e331c51d746c35a6397ee7b381c587df8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-15.0.1-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 2458dfcaebac19b2cda7b8c5d4e0203862316652760493204bb8908d53ebeafe
MD5 b56b430c2ed7f5d351343ad001c8dd88
BLAKE2b-256 e66509f52f238cb581910729cd12d85116683122752c171876633c36f11b23f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-15.0.1-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 d47fcf6353f303cdf13e0e499b1ba4b452c757bc154005b4c0df367493a2c3c5
MD5 0fc3f77d83ce2434550a7f841e39a51f
BLAKE2b-256 6a7f39d3f0bcdf3a16cda73269337576535f220f7535f1f21a9f98bf61de9114

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-15.0.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 748d6bfaf0d896dcdfc228e9c526d0f782ab4c6b4d301eca1b38aecebf7376e0
MD5 e3672b4a1be4566c2c7fdfab77996abf
BLAKE2b-256 6671ebe58b86cea9c2abfb3cc404ffb17a0fbebedac21f922be31cf3e14f0bf7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-15.0.1-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 7905bb49feca9ee5552fed338e7d11f0253f37732ffc293d412fdff1d1c7638e
MD5 63b545470e37aba1cbaecb7a84b89e3e
BLAKE2b-256 c90d2872f4913e8debb72ca95b54f8c3dde24392e2b5334fed20ad83cb0784f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-15.0.1-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 baa5e00ef7d949ca910ea2c8fd9b96ec6fb53bebfd07641065c8c7a3a810d387
MD5 aeb074cd2835f074a67e1440e89e4d4e
BLAKE2b-256 1edad5405aedbaa35d5d828c496fd03789a3d68b9119a9de37f97876fb3241cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-15.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b27188f735e4886bbe0714a62eda44f6919b9d45f5de2c2387c967f6b455650
MD5 a864403bf660d75d8d1895ad40daba74
BLAKE2b-256 0121a976ec38fe482d465f1e7b2bf751e0b7bc576eb0575d5730cbdfa11baeed

See more details on using hashes here.

Supported by

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