Njiwa for Python
pip install njiwa
from njiwa import Njiwa
njiwa = Njiwa("sk_live_...")
njiwa.send("254712345678", document="invoice.pdf", caption="Your invoice")
A local file path uploads automatically. A URL passes through. A med_ id
passes through. You do not have to know which is happening.
njiwa.send("0712345678", text="Hello") # local number, fine
njiwa.send("254712345678", image="https://example.com/a.jpg")
njiwa.send("254712345678", location={"lat": -1.29, "lng": 36.82})
result = njiwa.send("254712345678", text="Hi", wait=True) # block for the outcome
print(result["status"])
Anything that must not happen twice takes an idempotency key:
njiwa.send("254712345678", document="invoice.pdf", idempotency_key="invoice-4417")
Verifying a webhook:
if not Njiwa.verify_webhook(secret, request.body, request.headers["X-Njiwa-Signature"]):
return 400
Errors carry a stable code and a link to the page explaining the fix:
from njiwa import NjiwaError
try:
njiwa.send("254712345678", document="huge.pdf")
except NjiwaError as e:
print(e.code, e, e.docs)
Docs at https://docs.njiwa.upeo.ai UPEO.AI. 0116888777 on WhatsApp. hello@upeo.ai
Metadata
Release files for njiwa 0.1.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 |
|---|---|---|---|---|
| njiwa-0.1.0.tar.gz | 4.3 kB | Without provenance | Details for njiwa-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| njiwa-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for njiwa-0.1.0-py3-none-any.whl |
Total release size: 9.3 kB
Release files / njiwa-0.1.0.tar.gz
| Download URL | njiwa-0.1.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32e1be35722bb7dd666976c80a6c1f3add0a4fb3f3c35b5184f9c9c2c8d49112
|
|
BLAKE2b-256 checksum How to use checksums |
86457d42b2c91da477d0743adeef534786c79fd2bf06f63745ec5a1bf2a4791b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / njiwa-0.1.0-py3-none-any.whl
| Download URL | njiwa-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1d1d80a32c9c5d18f3699ac182ea844886ae0ce8fe1882abd27b2147f667f89
|
|
BLAKE2b-256 checksum How to use checksums |
e80f53272789bba4bdec23e67e90eee055c444b5fddd5a50536bf7fd1c34beb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for njiwa 0.1.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.