Skip to main content

A Python package for Altastata data processing and machine learning integration

Project description

Altastata Python Package

Secure, encrypted cloud storage for Python — with fsspec, PyTorch/TensorFlow, LangChain, Databricks, Snowflake, boto3/S3, gRPC, and a bundled Web UI (AltaStata Console).

pip install altastata

What you get

  • Storage: Encrypted files in S3, Azure, IBM COS, etc. (AltaStataFunctions)
  • Pythonic APIs: Standard Python file I/O via fsspec (create_filesystem)
  • ML & AI: Datasets (AltaStataPyTorchDataset, AltaStataTensorFlowDataset)
  • RAG: LangChain document loading (fsspec + DirectoryLoader / TextLoader)
  • Big Data: Databricks / Apache Spark (AltaStata Hadoop FS JAR)
  • Data Warehousing: Snowflake external stages (S3 Gateway) or Snowpark Python (fsspec)
  • AWS Ecosystem: S3 tools like boto3, aws CLI, and s3fs (S3-compatible API on port 9876)
  • Distributed apps: gRPC API (Python client + JS clients via port 9877)
  • Real-time: Real-time share/delete events (gRPC EventsService or Web UI)
  • Web UI: Finder-style file manager in the browser (http://127.0.0.1:9877)

Configure your account

See USER_SETUP_GUIDE.md for create-account (CLI/SDK), inline credentials, and account types.

from altastata import AltaStataFunctions

f = AltaStataFunctions.from_account_dir(
    "~/.altastata/accounts/amazon.rsa.bob123",
    password="your_password",
)

Quick start (gRPC — recommended)

from_account_dir / from_credentials auto-start the bundled Java gateway (Web UI + gRPC + S3).

from altastata import AltaStataFunctions

# RSA / PQC
f = AltaStataFunctions.from_account_dir(
    "/path/to/.altastata/accounts/amazon.rsa.bob123",
    password="your_password",
)

# HPCS / HSM — empty password
f = AltaStataFunctions.from_account_dir(
    "/path/to/.altastata/accounts/amazon.rsa.hpcs.myuser",
    password="",
)

print(f.list_cloud_versions("Public/", True))

Ports

One bundled Java process (altastata-grpc-server / altastata-services) listens on:

  • 9877: gRPC (file ops, auth, events) + Web UI static files
  • 9876: S3-compatible REST API

HPCS in Docker / Jupyter

Mount a populated grep11client.yaml (e.g. /etc/ep11client/grep11client.yaml) and hpcs-privkey.blob. See containers/jupyter/README-Docker.md.


fsspec

from altastata import AltaStataFunctions
from altastata.fsspec import create_filesystem

f = AltaStataFunctions.from_account_dir("/path/to/account", password="secret")
fs = create_filesystem(f, "my_account")

with fs.open("Public/readme.txt", "r") as fh:
    print(fh.read())

Works with pandas, dask, and other fsspec consumers.


LangChain, Databricks, Snowflake

LangChain / RAG

Load encrypted documents without copying them to local disk:

from altastata import AltaStataFunctions
from altastata.fsspec import create_filesystem
from langchain_core.documents import Document

f = AltaStataFunctions.from_account_dir("/path/to/account", password="secret")
fs = create_filesystem(f, "my_account")

with fs.open("Public/docs/policy.txt", "r") as fh:
    docs = [Document(page_content=fh.read(), metadata={"source": "Public/docs/policy.txt"})]

TextLoader, DirectoryLoader, and other LangChain loaders work via the altastata:// fsspec protocol once the filesystem is registered — see examples/fsspec-example/ and full RAG pipelines in examples/rag-example/.

Databricks / Apache Spark

Use the AltaStata Hadoop filesystem implementation so Spark jobs read encrypted paths on cluster storage (altastata://… or configured Hadoop URI). Deploy the altastata-hadoop shadow JAR on Databricks / Spark clusters.

Snowflake

  • External stage via S3: point Snowflake at the bundled S3 Gateway (http://host:9876) as an S3-compatible endpoint for encrypted objects in your backing bucket.
  • Snowpark Python: use fsspec / create_filesystem in Snowpark notebooks to read AltaStata paths with the same account credentials.

S3-compatible API (boto3, aws CLI, s3fs)

f = AltaStataFunctions.from_account_dir("/path/to/account", password="secret")

s3 = f.boto3_s3()   # pip install boto3
s3.put_object(Bucket="altastata-bucket", Key="hello.txt", Body=b"hi")

f.install_aws_env()   # AWS_* for !aws s3 ls in Jupyter

PyTorch & TensorFlow

from altastata import AltaStataFunctions, AltaStataPyTorchDataset
from altastata.altastata_pytorch_dataset import register_altastata_functions_for_pytorch

f = AltaStataFunctions.from_account_dir("/path/to/account", password="secret")
register_altastata_functions_for_pytorch(f, "my_account")
dataset = AltaStataPyTorchDataset("my_account", root_dir="Public/", file_pattern="*.jpg")

See examples/pytorch-example/ and examples/tensorflow-example/.


Event notifications

def on_event(name, data):
    print(name, data)

f = AltaStataFunctions.from_account_dir(
    "/path/to/account",
    password="secret",
)
f.add_event_listener(on_event)

With gRPC / Web UI, SHARE and DELETE events also appear in the browser and via EventsService.Watch.

See examples/event-listener-example/.


Docker Jupyter (optional)

cd containers/jupyter
docker compose -f docker-compose.yml -f docker-compose-ghcr.yml up -d

Images: ghcr.io/altastata/altastata/jupyter-datascience-{arm64,amd64}:latest


Web UI (AltaStata Console)

The wheel ships a browser file manager. Start the gateway:

altastata-grpc-server
# same as: python -m altastata.grpc_server

Open http://127.0.0.1:9877 — Miller-column browser, upload/download, share, generate keys, and live refresh on SHARE/DELETE events.

Sign in: Settings → Choose account folderSign in

  • RSA / PQC: Use your account password.
  • HPCS / HSM: Leave the password blank.

Set ALTASTATA_WEB_UI_DIR= (empty) to disable the UI and run gRPC-only.


More documentation

Questions?

Email contact@altastata.com.

License

Licensed under the Apache License, Version 2.0 — see LICENSE.

The Python / TypeScript sources in this repository are Apache 2.0. Bundled AltaStata Java runtime JARs (when present under altastata/lib/) remain under the Business Source License 1.1. See NOTICE for attribution of bundled components.

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

altastata-1.0.6.6.tar.gz (138.3 MB view details)

Uploaded Source

Built Distribution

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

altastata-1.0.6.6-py3-none-any.whl (138.3 MB view details)

Uploaded Python 3

File details

Details for the file altastata-1.0.6.6.tar.gz.

File metadata

  • Download URL: altastata-1.0.6.6.tar.gz
  • Upload date:
  • Size: 138.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for altastata-1.0.6.6.tar.gz
Algorithm Hash digest
SHA256 e0140507c8c3e301183ad86baf771aa5e6a00d650dfcd82b55cb543aec6549d0
MD5 54d4f1d045410423c66f868d44a0ce10
BLAKE2b-256 8b99eca579650fc90c8a8b0b8610ea58c76e58d3edd14b60b9c4d224af7a0884

See more details on using hashes here.

File details

Details for the file altastata-1.0.6.6-py3-none-any.whl.

File metadata

  • Download URL: altastata-1.0.6.6-py3-none-any.whl
  • Upload date:
  • Size: 138.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for altastata-1.0.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4b62213d8d3e152aad12e04b411b94609bdd770be76bd2264b2cf8bcc403f814
MD5 15a9139fec6630fe54e08dd78f2d9deb
BLAKE2b-256 cb2c0a07bf2ffcbf96f6dce9880bcb09141f92dfc27686fa47b71b7284dbb5a0

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