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

Operating Systems

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

amalgam_lang-27.3.0-py3-none-win_amd64.whl (5.5 MB view details)

Uploaded Python 3Windows x86-64

amalgam_lang-27.3.0-py3-none-manylinux_2_29_x86_64.whl (64.0 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ x86-64

amalgam_lang-27.3.0-py3-none-manylinux_2_29_aarch64.whl (6.8 MB view details)

Uploaded Python 3manylinux: glibc 2.29+ ARM64

amalgam_lang-27.3.0-py3-none-manylinux_2_28_x86_64.whl (64.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

amalgam_lang-27.3.0-py3-none-macosx_12_0_arm64.whl (3.9 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

amalgam_lang-27.3.0-py3-none-any.whl (80.1 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for amalgam_lang-27.3.0.tar.gz
Algorithm Hash digest
SHA256 320ad6485af24e825e8bd10aba3de6a67797aa514239b7d9a0919b33ff5a1beb
MD5 94cd30bb014d56586a16c7563220edc8
BLAKE2b-256 0e40dd0aae479fe1eabd5936295b65699b3e56124a62b1ddc0c7ad9f9673b390

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1799c162d9abb5163981205fad74deaa086b73e20d277b1756bb21c3fb6ff7cd
MD5 5dda51e63f67d92b89a97e49a69a433e
BLAKE2b-256 c21886f64300a4e443c42459d23323407dca6350de2fa1696d52b4a335b98885

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.0-py3-none-manylinux_2_29_x86_64.whl
Algorithm Hash digest
SHA256 67561ddf8bb21960831ae07dc7a3c55900af029cef01f3142286128c97779a4c
MD5 ff6e38f39257c3d6358d00ff2468d88b
BLAKE2b-256 f655792d33e83d1ad1286702be9a12cf4b2f7465ef67973740068efdfb8b8a79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.0-py3-none-manylinux_2_29_aarch64.whl
Algorithm Hash digest
SHA256 3050164ecab6c3512b067453f0fd1a2f69ccfcdb727dc952e9f330151998e951
MD5 940100b61312d47d6c54c25f39d34f78
BLAKE2b-256 1a835c3dfed6a9fed4a376f1e24fb7616dce4e5009cff75a2b744da5df8432f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 22ea8ea17767334710fa1bf08bd988096a96c818fca2dd38de0ef187d8c3afda
MD5 66ec03636f312ba154e3905dfe88ba50
BLAKE2b-256 57c2aeed021423337afefc76ebb5e259361c2094da8f7e2be42a9c9657883467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amalgam_lang-27.3.0-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 12b90cb49f778d97e47594e5fd2edbe17154be530435e97286f18955ceeea89e
MD5 dfd0107e99cc7f55027468a8fdafc7cb
BLAKE2b-256 1fde4c015e6fa3e1447551aaee84b26d4e3c58355260446fb8025cb03523e92e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for amalgam_lang-27.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ce7f4d49018f1e3272c13fb76b98dd2aeb9681c30694d2d05fab51110785749
MD5 b01bf54e9e3053aabf5970458241853f
BLAKE2b-256 d4269fa0324bc4af3a319f79dcfe8690062bf908de8b410b0ca646c6bbc189bb

See more details on using hashes here.

Supported by

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