Skip to main content

east-py-std

License: BSL 1.1

Standard platform functions for the East programming language in Python.

Python equivalent of @elaraai/east-node - provides platform functions for console I/O, filesystem, HTTP, crypto, time, path manipulation, and random number generation.

Installation

pip install east-py-std

Quick Start

import asyncio
from east.runtime.compiler import compile_async
from east_py_std import python_platform

# Assuming you have East IR from the TypeScript compiler
# compiled_fn = compile_async(ir, python_platform)
# await compiled_fn()

Platform Functions

Console I/O (console_impl)

  • console_log(message: String) -> Null - Write to stdout with newline
  • console_error(message: String) -> Null - Write to stderr with newline
  • console_write(message: String) -> Null - Write to stdout without newline

Cryptography (crypto_impl)

  • crypto_random_bytes(length: Integer) -> Blob - Generate cryptographically secure random bytes
  • crypto_hash_sha256(data: String) -> String - SHA-256 hash of UTF-8 string (hex)
  • crypto_hash_sha256_bytes(data: Blob) -> Blob - SHA-256 hash of binary data
  • crypto_uuid() -> String - Generate UUID v4

HTTP Fetch (fetch_impl)

  • fetch_get(url: String) -> String - HTTP GET request (async)
  • fetch_post(url: String, body: String) -> String - HTTP POST request (async)
  • fetch_request(config: FetchRequestConfig) -> FetchResponse - Custom HTTP request (async)

Filesystem (fs_impl)

  • fs_read_file(path: String) -> String - Read file as UTF-8 text
  • fs_write_file(path: String, content: String) -> Null - Write UTF-8 text to file
  • fs_append_file(path: String, content: String) -> Null - Append text to file
  • fs_delete_file(path: String) -> Null - Delete file
  • fs_exists(path: String) -> Boolean - Check if path exists
  • fs_is_file(path: String) -> Boolean - Check if path is a file
  • fs_is_directory(path: String) -> Boolean - Check if path is a directory
  • fs_create_directory(path: String) -> Null - Create directory (recursive)
  • fs_read_directory(path: String) -> Array<String> - List directory contents
  • fs_read_file_bytes(path: String) -> Blob - Read file as binary
  • fs_write_file_bytes(path: String, content: Blob) -> Null - Write binary to file

Path Manipulation (path_impl)

  • path_join(segments: Array<String>) -> String - Join path segments
  • path_resolve(path: String) -> String - Resolve to absolute path
  • path_dirname(path: String) -> String - Get directory name
  • path_basename(path: String) -> String - Get base name (filename)
  • path_extname(path: String) -> String - Get file extension

Random Numbers (random_impl)

14 random number generation functions using cryptographically secure RNG:

  • random_uniform() -> Float - Uniform [0, 1)
  • random_normal() -> Float - Standard normal N(0, 1)
  • random_range(min: Integer, max: Integer) -> Integer - Uniform integer [min, max]
  • random_exponential(lambda: Float) -> Float - Exponential distribution
  • random_weibull(k: Float) -> Float - Weibull distribution
  • random_bernoulli(p: Float) -> Integer - Bernoulli trial (0 or 1)
  • random_binomial(n: Integer, p: Float) -> Integer - Binomial distribution
  • random_geometric(p: Float) -> Integer - Geometric distribution
  • random_poisson(lambda: Float) -> Integer - Poisson distribution
  • random_pareto(alpha: Float) -> Float - Pareto (power law) distribution
  • random_log_normal(mu: Float, sigma: Float) -> Float - Log-normal distribution
  • random_irwin_hall(n: Integer) -> Float - Sum of n uniform variables
  • random_bates(n: Integer) -> Float - Average of n uniform variables
  • random_seed(seed: Integer) -> Null - Seed RNG (no-op in Python)

Time (time_impl)

  • time_now() -> Integer - Current Unix timestamp in milliseconds (sync)
  • time_sleep(ms: Integer) -> Null - Sleep for milliseconds (async)

Usage

Full Platform (Async)

from east_py_std import python_platform
from east.runtime.compiler import compile_async

# Use all platform functions (includes async operations)
compiled_fn = compile_async(ir, python_platform)
await compiled_fn()

Sync-Only Subset

from east_py_std import python_platform_sync
from east.runtime.compiler import compile

# Use only synchronous platform functions
# Excludes: fetch_*, time_sleep
compiled_fn = compile(ir, python_platform_sync)
compiled_fn()

Individual Modules

from east_py_std import console_impl, fs_impl, crypto_impl

# Use specific platform function groups
platform = [*console_impl, *fs_impl, *crypto_impl]
compiled_fn = compile(ir, platform)

Development

# First-time setup (installs dependencies)
make install

# Development workflow
make test          # Run test suite
make lint          # Run linter (ruff)
make format        # Format code
make typecheck     # Type check with mypy
make check         # Run all checks (lint + typecheck + test)

# Other useful commands
make repl          # Start Python REPL with east_py_std loaded
make coverage      # Generate HTML coverage report
make lint-fix      # Auto-fix linting issues
make clean         # Clean build artifacts

Claude Code plugin

The East ecosystem also ships a Claude Code plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the elaraai marketplace:

# Inside Claude Code
/plugin marketplace add elaraai/east-workspace
/plugin install east@elaraai
# From a terminal
claude plugin marketplace add elaraai/east-workspace
claude plugin install east@elaraai

License

BSL 1.1 (Business Source License):

  • Non-production use (evaluation, testing, development) is free
  • Production use by or on behalf of for-profit entities requires a commercial license
  • Code becomes AGPL-3.0 four years after each release

See LICENSE.md for full details.

Commercial licensing: support@elara.ai

Ecosystem

  • East: Statically typed, expression-based language with serializable IR. Run portable logic across TypeScript, Python, C, and other runtimes.

    • @elaraai/east: Core language SDK with type system, expressions, and reference JS compiler
  • East Node: Node.js platform functions for I/O, databases, and system operations.

  • East C: C11 native runtime for executing East IR. Distributed via npm (launcher + per-platform optional dependencies) and as tarballs on each GitHub Release.

    • @elaraai/east-c-cli: npm launcher — installs the matching native binary as an optional dependency
    • east-c: Core runtime — type system, IR interpreter, builtins, serialization (Beast2, JSON, CSV, East text)
    • east-c-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-c-cli: CLI for running East IR programs natively
  • East Python: Python runtime, standard platform, I/O, and data-science platform functions. Published to PyPI.

    • east-py: Core Python runtime — type system, IR compiler, 212+ builtins, Cython-accelerated hot paths
    • east-py-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-py-io: SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
    • east-py-cli: CLI for running East IR programs in Python
    • east-py-datascience (PyPI) + @elaraai/east-py-datascience (npm): Optimization (MADS, Optuna, ALNS, GoogleOR), ML (XGBoost, LightGBM, NGBoost, PyTorch, Lightning, GP), Bayesian inference (PyMC), explainability (SHAP), conformal prediction (MAPIE)
  • East UI: Typed UI component definitions and React renderer, plus VS Code preview.

  • e3 — East Execution Engine: Durable execution engine for running East pipelines at scale. Git-like content-addressable storage, automatic memoization, reactive dataflow, real-time monitoring.

Links

About Elara

East is developed by Elara AI Pty Ltd, an AI-powered platform that creates economic digital twins of businesses that optimize performance. Elara combines business objectives, decisions and data to help organizations make data-driven decisions across operations, purchasing, sales and customer engagement, and project and investment planning. East powers the computational layer of Elara solutions, enabling the expression of complex business logic and data in a simple, type-safe and portable language.


Developed by Elara AI Pty Ltd.


Developed by Elara AI Pty Ltd

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elaraai_east_py_std-1.0.57.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

elaraai_east_py_std-1.0.57-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file elaraai_east_py_std-1.0.57.tar.gz.

File metadata

  • Download URL: elaraai_east_py_std-1.0.57.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for elaraai_east_py_std-1.0.57.tar.gz
Algorithm Hash digest
SHA256 ce4718a034ed6e12df2c8a223e32b2b214351b0769f37120472df86912331315
MD5 edd753856dffe3c6908f8b9537c5c5a4
BLAKE2b-256 d9f191a1ef7833c1e51e0fcdd276637a2b10e6e673121dce6ccecb0c325f69fd

See more details on using hashes here.

File details

Details for the file elaraai_east_py_std-1.0.57-py3-none-any.whl.

File metadata

File hashes

Hashes for elaraai_east_py_std-1.0.57-py3-none-any.whl
Algorithm Hash digest
SHA256 9c6c770c033e2948d90b7f9327e1692b631263c3289456d4706f6efc669291ea
MD5 46c79cdd7486a7615f72d13361a28125
BLAKE2b-256 79ee59b7baf1b2d986826fd9cd6abc54bdb1aaae52b0502aa7af9a8faf2c911a

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.75

2 files

1.0.74

2 files

1.0.73

2 files

1.0.72

2 files

1.0.71

2 files

1.0.70

2 files

1.0.69

2 files

1.0.68

2 files

1.0.67

2 files

1.0.66

2 files

1.0.65

2 files

1.0.64

2 files

1.0.63

2 files

1.0.62

2 files

1.0.61

2 files

1.0.60

2 files

1.0.59

2 files

1.0.58

2 files

This release

1.0.57 This release

2 files

1.0.56

2 files

1.0.55

2 files

1.0.54

2 files

1.0.53

2 files

1.0.52

2 files

1.0.51

2 files

1.0.50

2 files

1.0.49

2 files

1.0.48

2 files

1.0.47

2 files

1.0.46

2 files

1.0.45

2 files

1.0.44

2 files

1.0.43

2 files

1.0.42

2 files

1.0.41

2 files

1.0.40

2 files

1.0.39

2 files

1.0.38

2 files

1.0.37

2 files

1.0.36

2 files

1.0.35

2 files

1.0.34

2 files

1.0.33

2 files

1.0.32

2 files

1.0.31

2 files

1.0.30

2 files

1.0.29

2 files

1.0.28

2 files

1.0.27

2 files

1.0.26

2 files

1.0.25

2 files

1.0.24

2 files

1.0.23

2 files

1.0.22

2 files

1.0.21

2 files

1.0.20

2 files

1.0.19

2 files

1.0.18

2 files

1.0.17

2 files

1.0.16

2 files

1.0.15

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page