Skip to main content

Quill SDK for Python.

Project description

Quill Python SDK

Quickstart

First, install the quillsql package by running:

$ pip install quillsql

Then, add a /quill endpoint to your existing python server. For example, if you were running a FASTAPI app, you would just add the endpoint like this:

from quillsql import Quill

quill = Quill(
    private_key=os.getenv("QULL_PRIVATE_KEY"),
    database_connection_string=os.getenv("POSTGRES_READ"),
    database_type="postgresql"
)

security = HTTPBearer()

async def authenticate_jwt(token: str = Depends(security)):
    # Your JWT validation logic here
    # Return user object or raise HTTPException
    user = validate_jwt_token(token.credentials)
    return user

@app.post("/quill")
async def quill_post(data: Request, user: dict = Depends(authenticate_jwt)):
    # assuming user fetched via auth middleware has an userId
    user_id = user["user_id"]
    body = await data.json()
    metadata = body.get("metadata")

    result = quill.query(
        tenants=[{"tenantField": "user_id", "tenantIds": [user_id]}],
        metadata=metadata
    )
    return result

Then you can run your app like normally. Pass in this route to our react library on the frontend and you all set!

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

quillsql-2.2.1.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

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

quillsql-2.2.1-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file quillsql-2.2.1.tar.gz.

File metadata

  • Download URL: quillsql-2.2.1.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for quillsql-2.2.1.tar.gz
Algorithm Hash digest
SHA256 373c399c21ad14d91b22dee9af1ebb5c08d9f11cf9abe743d2492c800ba0c0c4
MD5 69c4288b6ca1a878ad9f78d8f8f871b9
BLAKE2b-256 e2ab84438924603d6e75c32eae273fbb82aa60a5b2ab898611b7b457af27311b

See more details on using hashes here.

File details

Details for the file quillsql-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: quillsql-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for quillsql-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77ec54eefb08a19ec08019b95a6d9120c16f0192d6c17afcbc2de3e0cb78c625
MD5 4832448c18542b5bf2484279814ae4b9
BLAKE2b-256 f077933f9cadc292bd47d0687c22b57be8938ffab7508b87c6d9f10553f19bf1

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