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

Uploaded Python 3

File details

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

File metadata

  • Download URL: elaraai_east_py_io-1.0.10.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.10.tar.gz
Algorithm Hash digest
SHA256 d2316b99f7030e6a6da001a9e4f6e1de44e46458abe5e79b298d7352a8317441
MD5 32054921a06ef829174d86265a85c9d0
BLAKE2b-256 2573016d45d67191ed2a2a972838e97384322ce4a968314d7de555d2199f4d3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elaraai_east_py_io-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a2951e4da206777f5e58fcce7b70d31a0056d1e4eea457e2bf54c6693dd834bd
MD5 03ecafda6253a68840097fa78baecec6
BLAKE2b-256 c9e44ef94cb411862bc68ec4914516da05a5979402942e94177237d28f8a2d48

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