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.9.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.9-py3-none-any.whl (68.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: elaraai_east_py_io-1.0.9.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.9.tar.gz
Algorithm Hash digest
SHA256 92f4bc5725a4e594c77156ed61ee3ebc735c78f8fe184302f122a9f3464c60cf
MD5 3243b17e972b5fdae92935b8a2518cb4
BLAKE2b-256 d5fdc271c24e442e374f3928d08b0cd8c90514b77d6138f9444eb43a00228145

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elaraai_east_py_io-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 86bedf3977576fced3479cffcccbf185ef10e348e76fae012c593b8638557568
MD5 101e2012843d5a4e128a279cc9f3f9d1
BLAKE2b-256 3152a43d73eceb6b3dc60d3161fa9187a1ee434032447b2eb99c8c134f1a5b45

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