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. Tarballed for linux-x64 and linux-arm64, attached to each GitHub Release.

    • east-c: Core runtime — type system, IR interpreter, 200+ 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.4.tar.gz (39.2 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.4-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: elaraai_east_py_io-1.0.4.tar.gz
  • Upload date:
  • Size: 39.2 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.4.tar.gz
Algorithm Hash digest
SHA256 39853c4e8859f2a4e11739cb300b9295a19839c24e098de4f6cfe4bf5b1c4d02
MD5 3b8d2938c7a1383c7aa2770a376f2a9d
BLAKE2b-256 788b46f585a5b3c76308baa9a295dd3a06fea1f6f1604df6e95230b5d895a7e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elaraai_east_py_io-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 91b6b08892f5fa2f09efec89376ad1196539373fc267d40ecbf213e2ab59ac2e
MD5 a51e8a8d8a6f4149c5eba1c1b59c65ae
BLAKE2b-256 310b7310cb2063319a2e8a3b21d798ee0b6f9f5100f50dc283f5346aae1656c4

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