Skip to main content

Python admin SDK for EdgeBase service-key workloads

Project description

EdgeBase Logo

edgebase-admin

Server-only Python admin SDK for EdgeBase.

Use edgebase-admin from trusted environments that hold a Service Key, such as backend APIs, cron jobs, workers, and operational tooling. It exposes admin auth, service-key database access, storage management, raw SQL, functions, analytics, push, and native Cloudflare resources.

If you want the broader umbrella package that also includes the higher-level EdgeBaseServer entry point and room helpers, use edgebase from this repository or your internal build flow. The current public PyPI install path is edgebase-admin.

EdgeBase is the open-source edge-native BaaS that runs on Edge, Docker, and Node.js.

This package is one part of the wider EdgeBase platform. For the full platform, CLI, Admin Dashboard, server runtime, docs, and all public SDKs, see the main repository: edge-base/edgebase.

Documentation Map

Use this README for the fast overview, then jump into the docs when you need depth:

For AI Coding Assistants

This package includes an llms.txt file for AI-assisted development.

Use it when you want an agent or code assistant to:

  • use the right Python admin method signatures
  • remember which surfaces are properties vs methods
  • avoid copying JavaScript or Go API shapes into Python
  • choose edgebase-admin instead of the broader edgebase package when only admin features are needed

You can find it:

  • in this repository: llms.txt
  • in your environment after install, inside the edgebase_admin package directory as llms.txt

Installation

pip install edgebase-admin

Quick Start

import os

from edgebase_admin import create_admin_client

admin = create_admin_client(
    "https://your-project.edgebase.fun",
    service_key=os.environ["EDGEBASE_SERVICE_KEY"],
)

users = admin.admin_auth.list_users(limit=20)

posts = (
    admin.db("shared")
    .table("posts")
    .where("published", "==", True)
    .order_by("createdAt", "desc")
    .limit(10)
    .get_list()
)

rows = admin.sql(
    "shared",
    None,
    "SELECT COUNT(*) AS total FROM posts WHERE published = ?",
    [1],
)

bucket = admin.storage().bucket("avatars")
signed = bucket.create_signed_url("user-1.jpg", expires_in="1h")

print(len(users.get("users", [])), len(posts.items), rows, signed.url)

Core API

  • AdminClient(base_url, service_key=...) Main admin entry point
  • create_admin_client(base_url, service_key=...) Convenience helper matching the public docs
  • admin.admin_auth Admin user management
  • admin.db(namespace="shared", instance_id=None).table(name) Service-key database access
  • admin.storage() Storage bucket access
  • admin.sql(namespace="shared", instance_id=None, query="", params=None) Raw SQL
  • admin.functions() Call app functions from trusted code
  • admin.analytics() Query request metrics and track custom events
  • admin.push() Send push notifications and inspect logs
  • admin.kv(namespace), admin.d1(database), admin.vector(index) / admin.vectorize(index) Native Cloudflare resources

Requirements

  • Python 3.10+
  • edgebase-core>=0.2.4,<0.3.0
  • A valid EdgeBase Service Key

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

edgebase_admin-0.2.4.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

edgebase_admin-0.2.4-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file edgebase_admin-0.2.4.tar.gz.

File metadata

  • Download URL: edgebase_admin-0.2.4.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for edgebase_admin-0.2.4.tar.gz
Algorithm Hash digest
SHA256 d9163c514ed02c15868364e1c253a8ab745d8d75c0aee8863f1ac7611bf8d85d
MD5 d5974b5e7f84085463b26016ff659b9c
BLAKE2b-256 1e230efca7b44eddaed2f11dd2ac2e9f78ae75802d5c0b15b9b231ba133c3b62

See more details on using hashes here.

File details

Details for the file edgebase_admin-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: edgebase_admin-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for edgebase_admin-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 874c13a16b175952b2c6c0428bc67975790584ae7ba5b3303a35e07e718310f5
MD5 90e4525b5bdcba2126f32a0fd37bdd5e
BLAKE2b-256 7aa760edfde7b678e8ba8d941835e25b7d5d757e7e29db8ad33e6cbf074c864f

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