Skip to content

[SDK] Python SDK Initial Implementation (v0.1.0) **Difficulty**: Advanced | **Area**: sdks/ | **Package Name**: urbackend #100

Description

@yash-pouranik

Description

Expand the reach of urBackend by creating the first official Python SDK. This will allow Python/Django/Flask developers to use urBackend as their data layer.

Technical Requirements

  • Version: Initial release must be 0.1.0.
  • Package Name: Reserve and use the name urbackend (or urbackend-python if unavailable) on PyPI.
  • Project Structure: Follow the standard pyproject.toml or setup.py layout in a new directory: sdks/urbackend-python.

Key Tasks

  • Implement a urBackendClient class with:
    • connect(api_key, project_id, base_url)
    • db.collection(name).find(query)
    • db.collection(name).insert(data)
    • auth.login(email, password)
  • Documentation: Provide a basic README.md with usage examples in Python.
  • Modeling: Mirror the architecture and method names of the existing TypeScript SDK for consistency.

Acceptance Criteria

  • Successful connection to a live/local urBackend instance.
  • Support for basic Auth and CRUD operations.
  • Fully documented internal methods with Docstrings.
  • Ready for publication to PyPI at version 0.1.0.

Activity

  1. Navyasree-ulava commented on Apr 23, 2026

    @Navyasree-ulava
    Contributor

    Hi @yash-pouranik,

    I would like to work on implementing the Python SDK for urBackend.

    I have reviewed the TypeScript SDK (@urbackend/sdk) and will mirror its architecture and method naming to ensure consistency across SDKs.


    Plan of Approach

    1. Client Design

    Implement a urBackendClient class with the required interface:

    client = urBackendClient()
    client.connect(api_key="YOUR_API_KEY", project_id="YOUR_PROJECT_ID", base_url="https://api.urbackend.com")
    

    2. Auth Module (client.auth)

    Initial methods:

    • login(email, password)

    The client will store the accessToken internally and reuse it for authenticated requests where required.


    3. Database Module (client.db)

    Implement:

    • collection(name) wrapper
    • .find(query)
    • .insert(data)

    These will map to the corresponding backend endpoints and support optional token passing for RLS-enabled collections.


    4. HTTP Layer

    • Use requests or httpx for HTTP communication

    • Implement a centralized request handler for:

      • headers (API key and auth token)
      • response parsing
      • error handling

    5. Project Structure

    sdks/urbackend-python/
    ├── urbackend/
    │   ├── client.py
    │   ├── auth.py
    │   ├── db.py
    │   ├── exceptions.py
    │   └── __init__.py
    ├── pyproject.toml
    └── README.md
    

    6. Packaging

    • Version: 0.1.0
    • Use pyproject.toml
    • Prepare the package for PyPI publishing

    7. Documentation

    • Provide a README with usage examples (auth and CRUD)
    • Add docstrings for all public methods

    Clarifications

    1. API Endpoints

      • Are backend routes identical to those used in the TypeScript SDK?
      • Is there a default base URL for production?
    2. Authentication Handling

      • Should the client automatically store accessToken after login and include it in subsequent requests?
    3. Database Mapping

      • Should .find(query) map directly to getAll with query parameters?
      • Should full query options (filter, sort, limit, page, populate) be supported in v0.1.0?
    4. Error Handling

      • Should we replicate SDK-style exceptions such as AuthError, NotFoundError, and RateLimitError?
    5. Testing

      • Is there a recommended local instance or sandbox environment for testing?
    6. Package Naming

      • Should the package be published as urbackend or urbackend-python on PyPI?

    I will begin with the core features (auth and database operations) once these points are clarified and expand incrementally.

    Thank you.

  2. yash-pouranik commented on Apr 23, 2026

    @yash-pouranik
    MemberAuthor

    just reviewing the Approach @Navyasree-ulava

  3. yash-pouranik commented on Apr 23, 2026

    @yash-pouranik
    MemberAuthor

    @Navyasree-ulava
    The Approach looks solid and AI gen, Thats okay.
    Last check is - urbackend api end point for public apis is - base_url="https://api.ub.bitbros.in"

    u can check everything about urbackend here - https://docs.ub.bitbros.in/
    And before working Go through the product once - and understand what exactly urbackend is then start
    Vibing on this.
    Lets go

    Let me know - Karde assign??

  4. Navyasree-ulava commented on Apr 23, 2026

    @Navyasree-ulava
    Contributor

    Yes, i will go through the project thoroughly and will start working on it, you can assign me this issue

  5. yash-pouranik commented on Apr 23, 2026

    @yash-pouranik
    MemberAuthor

    Done Lets go @Navyasree-ulava

  6. linked a pull request that will close this issueFeature/python sdk #135on Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions