Skip to main content

a3rbly

A small Python client for the A3rbly Arabic grammar parsing and diacritization API. It uses the standard library and works with Python 3.9 and newer.

Get an API key

Get your API key from a3rbly.com. Keep it private; do not commit it to source control or place it in client-side code.

Install

On Debian or Ubuntu, install into a virtual environment rather than the system Python:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install a3rbly

Quick start

Pass the key to the client:

from a3rbly import A3rblyClient

client = A3rblyClient(api_key="YOUR_A3RBLY_API_KEY")

parsed = client.parse("قرأ الطالب الكتاب")
print(parsed)

vocalized = client.diacritize("قرأ الطالب الكتاب")
print(vocalized)

Or set an environment variable so the key stays out of your source code:

export A3RBLY_API_KEY="YOUR_A3RBLY_API_KEY"
from a3rbly import A3rblyClient

client = A3rblyClient()
print(client.i3rab("قرأ الطالب الكتاب"))

API methods

Python method HTTP request Description
client.parse(sentence) POST /i3rab Parses a sentence. Sends {"prompt": "..."}.
client.i3rab(sentence) POST /i3rab Alias for parse.
client.diacritize(text) GET /diacritize?text=... Adds diacritics to Arabic text.

The base URL defaults to https://api.a3rbly.com. Each method returns the decoded JSON response as a Python dictionary. The client sends the key in both the x-api-key and Authorization: Bearer ... headers.

Errors

All client errors derive from A3rblyError:

  • A3rblyAuthenticationError for HTTP 401 or 403
  • A3rblyRateLimitError for HTTP 429
  • A3rblyAPIError for other unsuccessful or malformed API responses
  • A3rblyConnectionError when the API cannot be reached
from a3rbly import A3rblyAPIError, A3rblyClient

client = A3rblyClient()  # Reads A3RBLY_API_KEY from the environment

try:
    result = client.parse("الطالب مجتهد")
except A3rblyAPIError as error:
    print(error.status_code, error.code, error)

The request timeout defaults to 30 seconds and can be changed when creating the client: A3rblyClient(timeout=10).

Build for PyPI

From this directory, build the wheel and source archive with:

python -m pip install build
python -m build

Choose the package license and PyPI account credentials before publishing the generated files in dist/.

API reference

The live API schema is available at api.a3rbly.com/openapi.json.

Metadata

Release files for a3rbly 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a3rbly 0.1.0
File Size Uploaded Provenance Actions
a3rbly-0.1.0.tar.gz 4.7 kB Without provenance Details for a3rbly-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for a3rbly 0.1.0
File Interpreter ABI Platform Actions
a3rbly-0.1.0-py3-none-any.whl Python 3 none any Details for a3rbly-0.1.0-py3-none-any.whl

Total release size: 10.0 kB

Release files / a3rbly-0.1.0.tar.gz

Download URL a3rbly-0.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
61a4738ba1e59067124bf3ebe93d78872a1d95c7e73f61d9fcd30c2b2173cccb
BLAKE2b-256 checksum
How to use checksums
b1a25e1d83cb5674bc6f72bcf411a3577daecb868061752494fbcd272c37fa7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / a3rbly-0.1.0-py3-none-any.whl

Download URL a3rbly-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d006f43ee73a807f40d6783a3689c72bce9929aaf3087067386fd88d5e2d5148
BLAKE2b-256 checksum
How to use checksums
7baada6e0e83b37ae3901c89f9880e93e93cf1920e1aa557ace93ec3334343e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for a3rbly 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page