WhiteBooks Python SDK

PyPI-published SDK for Python 3.10+. Both synchronous (whitebooks) and async (whitebooks.aio) interfaces ship in the same package. Works with Django, FastAPI, Flask, or plain scripts.

Installation

pip install whitebooks
# or
poetry add whitebooks
# or
uv add whitebooks

Quickstart — sync

import os
from whitebooks import WhiteBooks

wb = WhiteBooks(
    client_id=os.environ['WB_CLIENT_ID'],
    client_secret=os.environ['WB_CLIENT_SECRET'],
    env='sandbox',     # or 'production'
)

gstr2b   = wb.gst.gstr2b.fetch(gstin='29AAAAA0000A1Z5', month='04', year='2026')
irn      = wb.einvoice.generate_irn({...})
ewb      = wb.eway.generate({...})
clear    = wb.ksa_einvoice.clearance({...})

Quickstart — async (FastAPI / asyncio)

from whitebooks.aio import WhiteBooks

async def main():
    async with WhiteBooks(client_id=..., client_secret=..., env='sandbox') as wb:
        gstr2b = await wb.gst.gstr2b.fetch(gstin='29AAAAA0000A1Z5', month='04', year='2026')

Features

Part of the WhiteBooks developer documentation cluster. See /llms.txt for the full machine-readable site index. Last updated 27 May 2026.