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

Uploaded Source

Built Distributions

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

Uploaded Python 3 Windows x86-64

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

Uploaded Python 3 manylinux: glibc 2.29+ x86-64

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

Uploaded Python 3 manylinux: glibc 2.29+ ARM64

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

Uploaded Python 3 manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3 macOS 12.0+ x86-64

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

Uploaded Python 3 macOS 12.0+ ARM64

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgam_lang-13.0.4.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-13.0.4.tar.gz
Algorithm Hash digest
SHA256 5f767bb82f6fe6838a0f3ed3aa8352d3291c6140bf36851af8ee58f260164af3
MD5 49a5e5b30d8cff950c5c781fece4e366
BLAKE2b-256 4d21e282a23c0a810f9879e7e25b4bea04c0ba4011bd79ed0d76cc6b429a825b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-13.0.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cad464cb96bd0fb6a01229d89d4d8e694fbfb8f27223ef66bb1a1627c92893dc
MD5 b53e25f28206176af1b51e7287ef72d9
BLAKE2b-256 e8422331901700964bab9b2d971c56a52a10ea2224636c2ed6d4b415bfb2f249

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-13.0.4-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 c8b3c16285dd8700492651327a3218fd23cf7f0704c6ce4bcfbbdff0f323bc0e
MD5 e4b6687fe6e4cc84e6a0e9bd5c427c89
BLAKE2b-256 1dfe3b152170b55e2508ea3832cbd58634f51e9e234112411999ec90e635d852

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-13.0.4-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 de872f4c994afeea2d9bbf675e244ebe9feb829c8202e40af7bd3e19df80a071
MD5 8b64cc53a4b930ddab8990255385494e
BLAKE2b-256 f074e96396fac44ccf003354836d91419d8eed8db8aadcd91b762fdb80bd84a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-13.0.4-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 daff25949cce073809f3917d53c720bce3a4b22ddde8f9249c158036afcf4db9
MD5 64ffe64cdecd342e72f28c05952a79de
BLAKE2b-256 911fc8c9e9848e31309bd439683fb44972498bfcebb261ffb14de1347abcd2c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-13.0.4-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 f8213928a44d219b8d85720abb367a57cc140e18ad8dd57abb4c48c15d165fd5
MD5 57ba65ca2b33e96c2487cbef78288b5e
BLAKE2b-256 7c4e46243ed98ae24dcdc55b269d8bb8b9150f523ca6c191e403b7ef62a23333

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-13.0.4-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 546db8ef8494efc4f26b3f6b8d810c58fb0531c4bfae39fb3ac190376c48817f
MD5 31d2d2f22b4377aa5b0c9bbb295b1756
BLAKE2b-256 bf44e5cf6d33421ccf7a53a1ffcc153c5e39a1a1afa027e74bb8293a9f9432a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-13.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c7088c3322e10e72818dc51f994cf5c3ebed6fc99768b7fd718275786e9f2af2
MD5 a3d091ff626235d167daabbd7d4bc538
BLAKE2b-256 bbad3d87d427397361157a4d0c2c5a803bc320a4641e61d0e1ec31df0de1d63a

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