Skip to main content

aiodeta

Build codecov PyPI version

Unofficial client for Deta Clound

Supported functionality

  • Deta Base
  • Deta Drive
  • Decorator for cron tasks

Examples

import asyncio
from aiodeta import Deta

DETA_PROJECT_KEY = "xxx_yyy"


async def go():
    db_name = "users"

    # Initialize Deta client
    deta = Deta(DETA_PROJECT_KEY)

    # Initialize Deta Base client
    base = deta.Base(db_name)

    # Create row in Deta Base
    user = {"username": "steve", "active": False}
    resp = await base.insert(user)
    print(resp)
    user_key = resp["key"]

    # Update row by key
    resp = await base.update(user_key, set={"active": True})
    print(resp)

    # Get row by key
    resp = await base.get(user_key)
    print(resp)

    # Delete row by key
    resp = await base.delete(user_key)
    print(resp)

    # Create multiple rows in one request
    users = [
        {"username": "jeff", "active": True},
        {"username": "rob", "active": False},
        {"username": "joe", "active": True}
    ]
    resp = await base.put(users)
    print(resp)

    # Query data
    query = [{"active": True}, {"username?pfx": "j"}]
    result = await base.query(query=query, limit=10)
    print(result)

    # Close connection
    await deta.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(go())

Release files for aiodeta 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiodeta 0.1.2
File Size Uploaded
aiodeta-0.1.2.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiodeta 0.1.2
File Interpreter ABI Platform
aiodeta-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / aiodeta-0.1.2.tar.gz

Download URL aiodeta-0.1.2.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ad1a2d747349df8ddfffab99a5cfbf09eac64cd29ec50b8ed694e9bb398ff287
BLAKE2b-256 checksum
How to use checksums
35dd590c96f482153262a6becb734e5667332971a4ed7f01a54a5d2bac768639
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.7.7 Darwin/20.6.0

Release files / aiodeta-0.1.2-py3-none-any.whl

Download URL aiodeta-0.1.2-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fba299fd5c754c797a065c241254108fe7353399cd17251c1803f067812fb9b
BLAKE2b-256 checksum
How to use checksums
e492b5c2318ea257adb249d3e1c93107a7337ac3621b7df1ebbdd30c8825dd0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.7.7 Darwin/20.6.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page