Skip to main content

WaveAssist Python SDK for storing and retrieving structured data

Project description

Here's the updated README reflecting the new flexible init() behavior, .env support, and auto-resolution flow:


# WaveAssist Python SDK 🌊

WaveAssist makes it simple to store and retrieve data in your WaveAssist.io workflows.

---

## ✨ Features

- 🔐 One-line `init()` to connect with your project
- ⚙️ Automatically works on local and cloud (worker) environments
- 📦 Store and retrieve data (DataFrames, JSON, strings)
- 🧠 LLM-friendly function names (`init`, `store_data`, `fetch_data`)
- 📁 Auto-serialization for common Python objects
- ✅ Built for automation workflows, cron jobs, and AI pipelines

---

## 🚀 Getting Started

### 1. Install

```bash
pip install waveassist

2. Initialize the SDK

import waveassist

# Option 1: Use no arguments (recommended)
waveassist.init()

# Will auto-resolve from:
# 1. Explicit args (if passed)
# 2. .env file (WA_UID, WA_PROJECT_KEY, WA_ENV_KEY)
# 3. Worker-injected credentials (on WaveAssist cloud)

# Option 2: Use explicit arguments
waveassist.init(
    token="your-user-id-or-api-token",
    project_key="your-project-id",
    environment_key="optional-env"  # Defaults to <project_key>_default
)

🛠 Setting up .env (for local runs)

uid=your-user-id
project_key=your-project-key

#optional
environment_key=your-env-key  # optional

This file will be ignored by Git if you use our default .gitignore.


3. Store Data

🧾 Store a string

waveassist.store_data("welcome_message", "Hello, world!")

📊 Store a DataFrame

import pandas as pd

df = pd.DataFrame({"name": ["Alice", "Bob"], "score": [95, 88]})
waveassist.store_data("user_scores", df)

🧠 Store JSON/dict/array

profile = {"name": "Alice", "age": 30}
waveassist.store_data("profile_data", profile)

4. Fetch Data

result = waveassist.fetch_data("user_scores")

# Will return:
# - A DataFrame (if stored as one)
# - A dict/list (if stored as JSON)
# - A string (if stored as text)

🧪 Running Tests

If you’re not using pytest, just run the test script directly:

python tests/run_tests.py

✅ Includes tests for:

  • String roundtrip
  • JSON/dict roundtrip
  • DataFrame roundtrip
  • Error if init() is not called

🛠 Project Structure

WaveAssist/
├── waveassist/
│   ├── __init__.py          # init(), store_data(), fetch_data()
│   ├── _config.py           # Global config vars
│   └── ...
├── tests/
│   └── run_tests.py         # Manual test runner

📌 Notes

  • Data is stored in your WaveAssist backend (e.g. MongoDB) as serialized content
  • store_data() auto-detects the object type and serializes it (CSV/JSON/text)
  • fetch_data() deserializes it back to the right Python object

🧠 Example Use Case

import waveassist
waveassist.init()  # Auto-initialized from .env or worker

# Store GitHub PR data
waveassist.store_data("latest_pr", {
    "title": "Fix bug in auth",
    "author": "alice",
    "status": "open"
})

# Later, fetch it for further processing
pr = waveassist.fetch_data("latest_pr")
print(pr["title"])

🤝 Contributing

Want to add formats, features, or cloud extensions? PRs welcome!


📬 Contact

Need help or have feedback? Reach out at connect@waveassist.io or open an issue.


© 2025 WaveAssist

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

waveassist-0.0.7.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

waveassist-0.0.7-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file waveassist-0.0.7.tar.gz.

File metadata

  • Download URL: waveassist-0.0.7.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for waveassist-0.0.7.tar.gz
Algorithm Hash digest
SHA256 6bb884713a2004d2598b91fca2b38b6805c8a2883929400e85d868f1281a3bab
MD5 7157db5d1912252b764e2a8aa9ac3de4
BLAKE2b-256 338ea8e5dc61f3cadaeef0d6c4e14c3106f83370ae93d6f4b6c2d75d48e5175a

See more details on using hashes here.

Provenance

The following attestation bundles were made for waveassist-0.0.7.tar.gz:

Publisher: python-publish.yml on WaveAssist/WaveAssist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file waveassist-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: waveassist-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for waveassist-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a9a9ec989887ebd82c3b0c5235f7ccdcfcb99fb935be85e7b26a3198a8d0414d
MD5 bd1577c8df39696283c161f376e0843c
BLAKE2b-256 e99211c5ef6dbaacd5f619bbe4bc22a2fa94bc93c337ba76c889bcb1b0bb77d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for waveassist-0.0.7-py3-none-any.whl:

Publisher: python-publish.yml on WaveAssist/WaveAssist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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