Skip to main content

I/O platform functions for East programming language (Python)

Project description

east-py-io

License: BSL 1.1

I/O platform functions for the East programming language in Python.

Python equivalent of @elaraai/east-node-io - provides platform functions for S3 object storage and SQLite database operations.

Installation

pip install east-py-io

Quick Start

import asyncio
from east.runtime.compiler import compile_async
from east_py_io import python_io_platform

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

Platform Functions

S3 Operations (s3_impl)

6 functions for AWS S3 and S3-compatible object storage (MinIO, Backblaze, etc.):

  • s3_put_object(config: S3Config, key: String, data: Blob) -> Null - Upload object (async)
  • s3_get_object(config: S3Config, key: String) -> Blob - Download object (async)
  • s3_head_object(config: S3Config, key: String) -> S3ObjectMetadata - Get metadata without downloading (async)
  • s3_delete_object(config: S3Config, key: String) -> Null - Delete object, idempotent (async)
  • s3_list_objects(config: S3Config, prefix: String, maxKeys: Integer) -> S3ListResult - List with pagination (async)
  • s3_presign_url(config: S3Config, key: String, expiresIn: Integer) -> String - Generate presigned URL (async)

S3Config structure:

{
  region: String,
  bucket: String,
  accessKeyId: Option<String>,
  secretAccessKey: Option<String>,
  endpoint: Option<String>  // For S3-compatible services
}

S3ObjectMetadata structure:

{
  key: String,
  size: Integer,
  lastModified: DateTime,
  contentType: Option<String>,
  etag: Option<String>
}

S3ListResult structure:

{
  objects: Array<S3ObjectMetadata>,
  isTruncated: Boolean,
  continuationToken: Option<String>
}

SQLite Database (sqlite_impl)

4 functions for SQLite database operations with connection pooling:

  • sqlite_connect(config: SqliteConfig) -> ConnectionHandle - Connect to database, returns handle (async)
  • sqlite_query(handle: ConnectionHandle, sql: String, params: Array<SqlParameter>) -> SqlResult - Execute parameterized query (async)
  • sqlite_close(handle: ConnectionHandle) -> Null - Close connection (async)
  • sqlite_close_all() -> Null - Close all connections, useful for cleanup (async)

SqliteConfig structure:

{
  path: String,
  readOnly: Option<Boolean>,
  memory: Option<Boolean>
}

SqlParameter variant:

String(String) | Integer(Integer) | Float(Float) | Boolean(Boolean) |
Null(Null) | Blob(Blob) | DateTime(DateTime)

SqlResult variant:

select({ rows: Array<Dict<String, SqlParameter>> }) |
insert({ rowsAffected: Integer, lastInsertId: Option<Integer> }) |
update({ rowsAffected: Integer }) |
delete({ rowsAffected: Integer })

Usage

Full Platform (Async)

from east_py_io import python_io_platform
from east.runtime.compiler import compile_async

# Use all I/O platform functions (all are async)
compiled_fn = compile_async(ir, python_io_platform)
await compiled_fn()

Individual Modules

from east_py_io import s3_impl, sqlite_impl

# Use specific platform function groups
platform = [*s3_impl, *sqlite_impl]
compiled_fn = compile_async(ir, platform)

# Or just one module
platform = [*sqlite_impl]
compiled_fn = compile_async(ir, platform)

Type Definitions

from east_py_io import (
    S3ConfigType,
    S3ObjectMetadataType,
    S3ListResultType,
    SqliteConfigType,
    SqlParameterType,
    SqlResultType,
)

# Use type definitions in your platform functions

Development

# First-time setup (installs dependencies)
make install

# Development workflow
make test          # Run test suite (17 tests)
make lint          # Run linter (ruff)
make lint-fix      # Auto-fix linting issues
make typecheck     # Type check with mypy
make check         # Run all checks (lint + typecheck + test)

# Other useful commands
make coverage      # Generate HTML coverage report
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

Project details


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_io-1.0.11.tar.gz (48.8 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_io-1.0.11-py3-none-any.whl (68.3 kB view details)

Uploaded Python 3

File details

Details for the file elaraai_east_py_io-1.0.11.tar.gz.

File metadata

  • Download URL: elaraai_east_py_io-1.0.11.tar.gz
  • Upload date:
  • Size: 48.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for elaraai_east_py_io-1.0.11.tar.gz
Algorithm Hash digest
SHA256 eeff27a6822d5de8249ef873d16ddd9f71bef55c8a3705246b778027a5f5ae50
MD5 2135a9b6802d48af195328e43b37b789
BLAKE2b-256 8db7a796f33d9442fc594f794272450c2297b333aa277c59ec3962b33b2c914c

See more details on using hashes here.

File details

Details for the file elaraai_east_py_io-1.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for elaraai_east_py_io-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a7e837e34fd02dad788f682ea998268efc222fc8ca226cdb7fadc764794ce082
MD5 810bd7d6c95780ec9d82d9de25071db6
BLAKE2b-256 1aca82e9daa737bd1853038083f0e2737257747362673572eb8e784de8dbacd6

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