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, 3.12, and 3.13.

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

Uploaded Source

Built Distributions

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

Uploaded Python 3Windows x86-64

amalgam_lang-20.1.1-py3-none-manylinux_2_29_x86_64.whl (48.8 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

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

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-20.1.1-py3-none-manylinux_2_28_x86_64.whl (48.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3macOS 12.0+ x86-64

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

Uploaded Python 3macOS 12.0+ ARM64

amalgam_lang-20.1.1-py3-none-any.whl (67.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-20.1.1.tar.gz
  • Upload date:
  • Size: 67.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for amalgam_lang-20.1.1.tar.gz
Algorithm Hash digest
SHA256 ea5e2e6f2579fa749734a5e8a082c79e3f59a178bc8570b7663d655ab62e69d9
MD5 9a63458bcf0bb9b59ff0ad000bbd6394
BLAKE2b-256 42dd07c020e1a9f566d2760373011001446c232fe91be9650f14647d5155b891

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-20.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 281d19e12a7e85bdea1adaee4c358024527b074bf3eeff92cc0ea53e828df96a
MD5 13537eff24cfe8a0abe66edc7504b852
BLAKE2b-256 be2e80980b2d9edbd88cad01d3fa4d296c975dfe729632477bf1788deb69f569

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-20.1.1-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 bcccca75fa07cb18beeb92ae8b32268e261324ade627490e49035835bad54124
MD5 0444193e0d528119ab2a0164b14e042c
BLAKE2b-256 90bd4a4a936717867280748db35b1a4506e3689c8eb958c15a52ada22432ebb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-20.1.1-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 21000237fc1d1afa843ae6e0df3a0cecd5b09a2a1f1ff26fb82f1a72aab36fd5
MD5 b8005d8f18bced1404a8f52429df9366
BLAKE2b-256 dd047086107f54c526496497e380614c0e731b260b949795be39dfd9d76ced4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-20.1.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b1c21ebb6fe21e6610fd6054792057f0c52f9da341e5ab3cf4d75b945d987645
MD5 9806e93201be566f0f26ac5e7a0d1b7a
BLAKE2b-256 1064a66154fd60f9b3ac2dfa28b8e94176769b5fd138eb0786531e6af5bfe721

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-20.1.1-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 0f2b374711205f65c9cc077bca66093972361a822e8b665f1d2fb5a373c642b5
MD5 351afb4607a87e7499791cc3bb8a5cdd
BLAKE2b-256 bda096846b77e6bbf5fda2baacd2f863e5afb80e7cd75f64934cf0e1658148ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-20.1.1-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 b12e9611f3f23c7ecf0fc89e0858e93fbd5c268ef947b06e7127ff193873d3be
MD5 944ceaae61e2e176691357ae53e87cb6
BLAKE2b-256 5f530687c44f1f1778edd972c3ea34d403cd049799c7d3f6e17b12632b0e56e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgam_lang-20.1.1-py3-none-any.whl
  • Upload date:
  • Size: 67.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for amalgam_lang-20.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dae53ca7a1b8f898375058c7e0142e5ca3b5485a77cedf3a80d02de8bbb0f44a
MD5 c3b07765c9516506e31bfd45eb029ddd
BLAKE2b-256 466580d4714e04f4c20ae156a5c97254458fd61c2edf31d864c2f53179562b3e

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