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

Uploaded Source

Built Distributions

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

Uploaded Python 3 Windows x86-64

amalgam_lang-16.1.1-py3-none-manylinux_2_29_x86_64.whl (48.0 MB view details)

Uploaded Python 3 manylinux: glibc 2.29+ x86-64

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

Uploaded Python 3 manylinux: glibc 2.29+ ARM64

amalgam_lang-16.1.1-py3-none-manylinux_2_28_x86_64.whl (48.2 MB view details)

Uploaded Python 3 manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3 macOS 12.0+ x86-64

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

Uploaded Python 3 macOS 12.0+ ARM64

amalgam_lang-16.1.1-py3-none-any.whl (67.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-16.1.1.tar.gz
  • Upload date:
  • Size: 66.7 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.1.tar.gz
Algorithm Hash digest
SHA256 cc2c8990f630f3c38dcec809e6d417f0397c4976838f998e6653f847557a0e27
MD5 af9f8c4acdd86a5d62ab606543a5faa1
BLAKE2b-256 db4d8d088589b563834904fe630c78bd6d7c475c1355adc605db1c5f524449aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8fa4660f945696815fd279f0cbaeefd5eb28b13c043875726a2683cfaf7e0419
MD5 fc7f41e0ea30839decd92702e95f7ebc
BLAKE2b-256 7d5954a8869248d0d7925bcc99c8396fe2a5a72f0e1bc08f182e3978c2a4103f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.1-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 a41badadf3b5f07f4fa513dac85a910d9aec6c0622faa1b57bcdfd88fc7982cf
MD5 7656571be15836a90037028f9ffe040c
BLAKE2b-256 95c3c626a1ac947e280e302c184f1afedbfcfedc6c7f219d52dbd29e929c4af0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.1-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 e206eaba497551f0226359dd77ff03b0bae6ae5e9683ed875734407eb726135e
MD5 823c6b1c63931825337577620637aa30
BLAKE2b-256 fe3ba39942a4045d36583d0df855aa445c0e25996188e8ef63eb0971e5ceb3d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 feda85f5698897ca77f9ce3b7b6404f71e16eccb779586603275c5ca21810d68
MD5 7321666329d762a7626673350f20cdbb
BLAKE2b-256 3d5b04ab761e39f5e651c95152967f5732a9606f5f8cc21103fa184219c86b39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.1-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 a30e720d4f2cf54b24ebd0aabea696a2f0d7b53f6739466711e53f623d0ec876
MD5 5dd3bcd580117c670449736db4cd4372
BLAKE2b-256 eda0db4a4f8349d0f6761a3c94c47db6a5f89acc464333015877d8e651aa3194

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.1-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 96eb293e77d4e17ecc37a2b11bf6c3187345575e897282bd4042d8fc61f14984
MD5 a1fc66ffeb6ef1ecd7ee0f7beb549da9
BLAKE2b-256 561a025af58a72809c7410b5d6162d35c5c4994f2add97e1eda2bb0431fc4bc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-16.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dad2afe7def156c1be136eae91ac892b5ddd74be0c6964d14345f9114d9bd42e
MD5 262bc293bf4cd5168ceb74aa13a08764
BLAKE2b-256 b3a29e1d941fec2a25c615576768fcb221fdec6c0e398793b44b8db259a1f5be

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page