billos (Python)
BillOS from Python: legally valid Israeli tax documents (חשבונית מס, קבלה, זיכוי), the expense ledger, webhooks and the regulatory outputs, over one small client with no dependencies beyond the standard library (Python 3.9+).
pip install billos
from billos import BillOS, BillOSError
billos = BillOS(api_key=os.environ["BILLOS_API_KEY"])
bid = billos.businesses.list()["businesses"][0]["id"]
created = billos.documents.create(bid, {
"docType": 320,
"priceMode": "gross",
"party": {"name": "דנה לוי", "phone": "0521111111"},
"lines": [{"description": "איפור כלה", "quantity": 1, "unitPriceExVat": 120000}],
"payments": [{"method": "card", "amount": 120000}],
}, idempotency_key="order-8812")
issued = billos.documents.issue(bid, created["document"]["id"])
print(issued["document"]["docNumber"])
pdf = billos.documents.print(bid, created["document"]["id"]) # Binary: .bytes, .content_type, .variant
link = billos.documents.share(bid, created["document"]["id"]) # a public URL for the customer
Money is integer agorot everywhere, exactly like the API (₪354.00 is 35400); a foreign-currency document ("currency": "USD") is in that currency's cents. Nothing in the client converts.
What you get
- Every operation in the spec as
namespace.method(snake_case):businesses,parties,documents,recurring,legacy,expenses,exports,files,webhooks,events,keys,usage,requests,sandbox, and for Connect and shared accessaccess,connections,apps.OPERATIONS(method and path per operation) is generated from the OpenAPI spec, and a test checks every operation has a method, so the client cannot lag behind the API. - The conventions handled:
X-Api-Key, the{ok, ...}envelope returned as a dict (plusrequest_id),Idempotency-Keyfromidempotency_key=,Retry-Afterhonoured. api_version="2026-09-08"pins a dated API version (sent asBillOS-Version); the default is the current one.- Retries on 429 / 502 / 503 / 504 and network errors, up to
max_retries(default 2), for GET/DELETE and for POSTs carrying an idempotency key; never for a POST without one. BillOSErrorwithstatus,reason,request_id,body,retryable. Branch onreason.- Binary answers (
documents.preview,documents.print,files.get, a PDF report) come back asBinary(bytes, content_type, variant, request_id). verify_webhook_signature(secret, header, raw_body)for theX-BillOS-Signatureheader.access_token="bkat_…"instead ofapi_key=acts for one business whose owner connected your app (Connect).- A
bk_test_key answers from the sandbox with no change on your side (billos.sandbox.seed()fills it with demo data).
Documentation and the OpenAPI spec: https://docs.billos.co.il. MIT.
Connect: acting for someone else's business
An API key holds the businesses you opened. A Connect token holds one business whose owner connected your app (OAuth 2.0 with PKCE, guide: https://docs.billos.co.il/connect):
merchant = BillOS(access_token=token) # bkat_…, one business, the granted scopes
merchant.documents.list(business_id)
dev = BillOS(api_key=key) # your key sees connected businesses too
dev.apps.create({"name": "My App", "redirectUris": ["https://app.example/cb"], "scopes": ["documents:read"]})
dev.connections.list(business_id) # what an owner connected, and the way out
dev.access.invite(business_id, {"email": "rina@example.com", "role": "accountant"})
What is new in 0.3.0
- Connect:
access_token=for a per-business token, and theappsnamespace to register and manage the app behind it (create,list,get,update,rotate_secret,delete). - Shared access:
access.list/access.invite/access.revokeopen a business to a person by email and role (accountant,bookkeeper,viewer), andconnections.list/connections.revokeare the owner's view of the apps connected to it. - Fine scopes: a refusal names the half it needed (
missing scope: documents:write). A key's coarse scope covers both halves, so nothing you hold changes.
Metadata
Release files for billos 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| billos-0.3.0.tar.gz | 15.1 kB | Without provenance | Details for billos-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| billos-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for billos-0.3.0-py3-none-any.whl |
Total release size: 27.2 kB
Release files / billos-0.3.0.tar.gz
| Download URL | billos-0.3.0.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3316f21e16d7a432ada02b5dfa6e092985c9cd4505e7b386116f13a42b7f7015
|
|
BLAKE2b-256 checksum How to use checksums |
902d46168e9088051474ee5e50c3ca4672f4657e87b9b3f6d9bdb62931dde5e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.5
|
Release files / billos-0.3.0-py3-none-any.whl
| Download URL | billos-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a18e737936bfee4f7cb1b588fe42db68777e70a4b1347651e8ba64f8930695a0
|
|
BLAKE2b-256 checksum How to use checksums |
7b86133591fee85af1646f1983b907f2f4bee4c2dbca2dd4cf104097447e3f32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.5
|
Security for billos 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.