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.6.tar.gz (23.6 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.6-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for quillsql-2.2.6.tar.gz
Algorithm Hash digest
SHA256 c05b03f4bc2ddda93d698f451d1a4a075caec4443ba920e13c9d99855c173467
MD5 e5aee01b1f5a5d81d930062b97cebc62
BLAKE2b-256 a598fcadede6aebfe86ad10c3dba63b2e2c438dd20a2f6c4d072d87093b064d3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for quillsql-2.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 21d3ba97912afc9e6ce0d094c21f74063c1681552a0dd850202827bdda9f586d
MD5 8d861984cc8618281b4d1efd417e3110
BLAKE2b-256 530a38f87b9839ac3a1e1efb105700f9c9b25a2f510891c279e9b6cc28f16074

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