Skip to main content

Python SDK and CLI for Meow Meow Scratch APIs, dashboards, and connected projects.

Project description

Meow Meow Scratch

Python SDK for the Meow Meow Scratch® API

Build your own APIs and send data from your Raspberry Pi, Arduino, or any Python project.

PyPI Python License

Docs · Getting Started · API Reference · CLI Reference


Install

pip install meow-sdk

30-second quickstart

from meow_sdk import Meow

# 1. Connect with your API key
api = Meow(api_key="YOUR_PLATFORM_TOKEN")

# 2. Check capacity, then send data
print(api.limits())
api.send("weather-station", "readings", {
    "temperature": 22.5,
    "humidity": 65,
})

# 3. Read it back
data = api.records("weather-station", "readings")
print(data["results"])

Get your API key at meowmeowscratch.com under Account > Platform Tokens.

Read public data (no key needed)

Anyone can read public endpoints using a username:

api = Meow(username="jake")

data = api.get("weather-station", "readings")
print(data)

Your public API lives at: https://meowmeowscratch.com/api/v1/<username>/<app>/<endpoint>/

Raspberry Pi

Read a sensor and send data every 10 seconds:

import time
import adafruit_dht
import board
from meow_sdk import Meow

sensor = adafruit_dht.DHT22(board.D4)
# Use an app API key on a deployed device so it can access only this app.
api = Meow(api_key="YOUR_APP_API_KEY")

while True:
    try:
        api.send("my-pi", "sensors", {
            "temperature": sensor.temperature,
            "humidity": sensor.humidity,
        })
        print(f"{sensor.temperature}°C, {sensor.humidity}%")
    except Exception as e:
        print(f"Sensor error: {e}")

    time.sleep(10)

See the Raspberry Pi guide for more examples (buttons, LEDs, camera, systemd).

Control panels

Build real-time dashboards with interactive widgets:

api = Meow(api_key="YOUR_PLATFORM_TOKEN")

# Create a dashboard
api.create_dashboard("My Room", "my-room")

# Add a light switch
api.create_dashboard_widget(
    "my-room", "home", "settings",
    "lights.on", "toggle", "Bedroom Lights"
)

# Toggle it from your Pi
state = api.dashboard_state("my-room")
widget_uuid = state["widgets"][0]["uuid"]
api.set_dashboard_widget_value("my-room", widget_uuid, True)

Widget types: toggle, slider, color, number, text, select, display.

CLI

The SDK includes a full CLI. Configure it once:

export MEOW_PLATFORM_API_KEY=YOUR_PLATFORM_TOKEN
export MEOW_APP_API_KEY=YOUR_APP_API_KEY
export MEOW_USERNAME=jake

Then use it:

# Send data
meow send weather-station readings temperature=22.5 humidity=65

# Read data
meow get weather-station readings

# List your apps
meow apps

# Export as CSV
meow csv weather-station readings

# Manage dashboards
meow dashboards
meow dashboard-data my-room
meow widget-set my-room WIDGET_UUID true

See the CLI reference for all 55 commands.

Error handling

from meow_sdk import Meow, AuthError, NotFoundError, MeowError

api = Meow(api_key="YOUR_PLATFORM_TOKEN")

try:
    api.send("my-app", "readings", {"value": 42})
except AuthError:
    print("Bad API key")
except NotFoundError:
    print("App or endpoint doesn't exist")
except MeowError as e:
    print(f"API error {e.status_code}: {e}")

What you can do

Feature SDK CLI
Send & read records api.send() / api.send_many() meow send / meow send-batch
Manage apps & endpoints api.create_app() meow create-app
Define field schemas api.create_field() meow create-field
Static payloads api.set_payload() meow payload-set
Proxy endpoints api.set_proxy() meow proxy-set
Control panel dashboards api.set_dashboard_widget_value() meow widget-set
Webhooks api.create_webhook() meow webhook-create
Encryption api.enable_encryption() meow encrypt-enable
Request logs api.request_logs() meow logs
CSV export api.export_csv() meow csv
Aggregations api.aggregate() meow aggregate
API keys api.create_app_key() meow key-create
Platform tokens api.create_platform_token() meow platform-token-create
Plan limits api.limits() meow limits

Links

License

MIT

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

meow_sdk-0.7.0.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

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

meow_sdk-0.7.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file meow_sdk-0.7.0.tar.gz.

File metadata

  • Download URL: meow_sdk-0.7.0.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for meow_sdk-0.7.0.tar.gz
Algorithm Hash digest
SHA256 975d347416b887a9bc6dd2be6843f710be516b2fa1dd98e023fcdb7810d101ec
MD5 c0a8a8a466814f058c2189c71e42be22
BLAKE2b-256 617da32f33c24254d9c8aa16b36bf877ec0c5ea4b6450c464c6d38cef799aff2

See more details on using hashes here.

Provenance

The following attestation bundles were made for meow_sdk-0.7.0.tar.gz:

Publisher: publish.yml on meowmeowscratch/meow-sdk

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

File details

Details for the file meow_sdk-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: meow_sdk-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for meow_sdk-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fe96aac0a5e536b4fa6cf89b045c22eddff60a29d74607a1226c3be84287c62
MD5 bfd059bf0eda38aea7f85a20427bce4e
BLAKE2b-256 f2b47cfc3687c32d08e38f44a105602c63d732a74913bd4d2cde6cb41990b5ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for meow_sdk-0.7.0-py3-none-any.whl:

Publisher: publish.yml on meowmeowscratch/meow-sdk

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