A Python package for Altastata data processing and machine learning integration
Project description
Altastata Python Package
A powerful Python package for secure, encrypted cloud storage with seamless integration for data processing, AI, machine learning, and RAG applications.
Installation
pip install altastata
Features
- fsspec filesystem interface - Use standard Python file operations with encrypted cloud storage
- Real-time Event Notifications - Listen for file share, delete, and create events
- LangChain Integration - Native support for document loaders and vector stores
- PyTorch & TensorFlow Support - Custom datasets for machine learning workflows
- Multi-cloud Support - Works with AWS, Azure, GCP, and more
- End-to-end Encryption - AES-256 encryption with zero-trust architecture
Quick Start
from altastata import AltaStataFunctions, AltaStataPyTorchDataset, AltaStataTensorFlowDataset
from altastata.altastata_tensorflow_dataset import register_altastata_functions_for_tensorflow
from altastata.altastata_pytorch_dataset import register_altastata_functions_for_pytorch
# Configuration parameters
user_properties = """#My Properties
#Sun Jan 05 12:10:23 EST 2025
AWSSecretKey=*****
AWSAccessKeyId=*****
myuser=bob123
accounttype=amazon-s3-secure
................................................................
region=us-east-1"""
private_key = """-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3,F26EBECE6DDAEC52
poe21ejZGZQ0GOe+EJjDdJpNvJcq/Yig9aYXY2rCGyxXLGVFeYJFg7z6gMCjIpSd
................................................................
wV5BUmp5CEmbeB4r/+BlFttRZBLBXT1sq80YyQIVLumq0Livao9mOg==
-----END RSA PRIVATE KEY-----"""
# Create an instance of AltaStataFunctions
altastata_functions = AltaStataFunctions.from_credentials(user_properties, private_key)
altastata_functions.set_password("my_password")
PyTorch & TensorFlow Integration
# Register the altastata functions for PyTorch or TensorFlow as a custom dataset
register_altastata_functions_for_pytorch(altastata_functions, "my_account")
register_altastata_functions_for_tensorflow(altastata_functions, "my_account")
# For PyTorch application use
torch_dataset = AltaStataPyTorchDataset(
"my_account",
root_dir=root_dir,
file_pattern=pattern,
transform=transform
)
# For TensorFlow application use
tensorflow_dataset = AltaStataTensorFlowDataset(
"my_account",
root_dir=root_dir,
file_pattern=pattern,
preprocess_fn=preprocess_fn
)
fsspec Integration
Altastata implements the fsspec interface, making it compatible with any Python library that uses standard file operations:
from altastata import AltaStataFunctions
from altastata.fsspec import create_filesystem
# Create AltaStata connection
altastata_functions = AltaStataFunctions.from_account_dir('/path/to/account')
altastata_functions.set_password("your_password")
# Create fsspec filesystem
fs = create_filesystem(altastata_functions, "my_account")
# Use it like any Python file system
files = fs.ls("Public/")
with fs.open("Public/Documents/file.txt", "r") as f:
content = f.read()
print(content)
This means you can use Altastata with pandas, dask, xarray, and hundreds of other libraries without any special configuration.
Event Listener
Get real-time notifications when file operations occur:
from altastata import AltaStataFunctions
# Event handler
def event_handler(event_name, data):
print(f"📢 Event: {event_name}, Data: {data}")
if event_name == "SHARE":
print("File was shared!")
elif event_name == "DELETE":
print("File was deleted!")
# Initialize with callback server
altastata = AltaStataFunctions.from_account_dir(
'/path/to/account',
enable_callback_server=True,
callback_server_port=25334
)
altastata.set_password("your_password")
# Register listener
listener = altastata.add_event_listener(event_handler)
# Events will now be delivered in real-time!
# See examples/event-listener-example/ for complete demos
Perfect for:
- Data sharing among the users
- Audit logging and compliance
- Workflow automation
See examples/event-listener-example/ for complete documentation and working examples.
LangChain Integration
Use Altastata as a document source for LangChain applications:
from langchain.document_loaders import DirectoryLoader
from altastata.fsspec import create_filesystem
from altastata import AltaStataFunctions
# Create AltaStata connection
altastata_functions = AltaStataFunctions.from_account_dir('/path/to/account')
altastata_functions.set_password("your_password")
# Create fsspec filesystem
fs = create_filesystem(altastata_functions, "my_account")
# Use with LangChain document loaders
loader = DirectoryLoader("Public/Documents/", filesystem=fs)
documents = loader.load()
# Use with vector stores
from langchain.vectorstores import FAISS
from langchain.embeddings import OpenAIEmbeddings
vectorstore = FAISS.from_documents(documents, OpenAIEmbeddings())
Perfect for:
- RAG (Retrieval-Augmented Generation) applications
- Document processing pipelines
- Knowledge base construction
- Multi-modal AI applications
See the full documentation for more examples and advanced usage.
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file altastata-0.1.26.tar.gz.
File metadata
- Download URL: altastata-0.1.26.tar.gz
- Upload date:
- Size: 130.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cec6ec79840ce07fdfdf75c51dd8c4d69deff67ad53812d2390fdf9e3d44a10
|
|
| MD5 |
19180ec3527e0e4536873ecc727dc2dd
|
|
| BLAKE2b-256 |
2511549ce47a32edcc9706ff992bf9ff0c7fc3f6b10b5d258b21e375d3bee521
|
File details
Details for the file altastata-0.1.26-py3-none-any.whl.
File metadata
- Download URL: altastata-0.1.26-py3-none-any.whl
- Upload date:
- Size: 130.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f17c184489799686f2b2b4fb5e1a3fb5720320cbeabaf17ec7cf4f42b4839e23
|
|
| MD5 |
1e053bd86dd0c4e2f1355dcfea99371e
|
|
| BLAKE2b-256 |
2416a38c2e66a357a323550a2a54a266957b9059c79832a1a161ad7adc98ba86
|