# Sawalni Python SDK
This is the official Python SDK for the Sawalni API, providing easy access to language-related services such as embedding generation, language identification, and translation. Sawalni API is developed by [Omneity Labs](https://sawalni.com/developers), and provides unique multilingual models and NLP capabilities, including pioneering Moroccan Darija support.
## Installation
Install the package using pip:
```bash
pip install sawalni
```
## Quick Start
To use the Sawalni SDK, you'll need an API key. You can set it as an environment variable or pass it directly to the client:
```py
from sawalni import Sawalni
client = Sawalni(api_key='your_api_key_here')
# or specify the key via SAWALNI_API_KEY in the environment
```
## Features
The SDK supports both synchronous and asynchronous operations for the following services:
1. Generate Embeddings (languages depend on the model)
2. Identify Language (35 languages supported)
3. Translate Text (13 languages supported)
### Generate Embeddings
```py
embeddings = client.embed("Hello, world!")
```
### Identify Language
```py
language = client.identify("Bonjour le monde")
```
### Translate Text
```py
translation = client.translate("Hello", source="eng_Latn", target="ary_Latn")
```
## Asynchronous Usage
For asynchronous operations, use the SawalniAsync client:
```py
from sawalni import SawalniAsync
async_client = SawalniAsync(api_key='your_api_key_here')
embeddings = await async_client.embed("Hello, world!")
```
## Documentation
For detailed information about available models, parameters, languages and and response formats, please refer to the complete API documentation at https://api.sawalni.com.
## Support
If you encounter any issues or have questions, please contact api@sawalni.com.
Raw data
{
"_id": null,
"home_page": null,
"name": "sawalni",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "nlp language processing embedding translation identification api sdk moroccan darija arabic multilingual low-resource languages",
"author": "Omar Kamali",
"author_email": "api@sawalni.com",
"download_url": "https://files.pythonhosted.org/packages/20/2d/98ba64b091fe96539b040c70385b64741ec0a6a87bdbb567bac19d0b85b8/sawalni-0.1.6.tar.gz",
"platform": null,
"description": "# Sawalni Python SDK\n\nThis is the official Python SDK for the Sawalni API, providing easy access to language-related services such as embedding generation, language identification, and translation. Sawalni API is developed by [Omneity Labs](https://sawalni.com/developers), and provides unique multilingual models and NLP capabilities, including pioneering Moroccan Darija support.\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install sawalni\n```\n\n## Quick Start\n\nTo use the Sawalni SDK, you'll need an API key. You can set it as an environment variable or pass it directly to the client:\n\n```py\nfrom sawalni import Sawalni\n\nclient = Sawalni(api_key='your_api_key_here') \n# or specify the key via SAWALNI_API_KEY in the environment\n```\n\n## Features\n\nThe SDK supports both synchronous and asynchronous operations for the following services:\n\n1. Generate Embeddings (languages depend on the model)\n2. Identify Language (35 languages supported)\n3. Translate Text (13 languages supported)\n\n### Generate Embeddings\n\n```py\nembeddings = client.embed(\"Hello, world!\")\n```\n\n### Identify Language\n\n```py\nlanguage = client.identify(\"Bonjour le monde\")\n```\n\n### Translate Text\n\n```py\ntranslation = client.translate(\"Hello\", source=\"eng_Latn\", target=\"ary_Latn\")\n```\n\n## Asynchronous Usage\n\nFor asynchronous operations, use the SawalniAsync client:\n\n```py\nfrom sawalni import SawalniAsync\n\nasync_client = SawalniAsync(api_key='your_api_key_here')\nembeddings = await async_client.embed(\"Hello, world!\")\n```\n\n## Documentation\n\nFor detailed information about available models, parameters, languages and and response formats, please refer to the complete API documentation at https://api.sawalni.com.\n\n## Support\n\nIf you encounter any issues or have questions, please contact api@sawalni.com.\n",
"bugtrack_url": null,
"license": null,
"summary": "Official Python SDK for the Sawalni API",
"version": "0.1.6",
"project_urls": null,
"split_keywords": [
"nlp",
"language",
"processing",
"embedding",
"translation",
"identification",
"api",
"sdk",
"moroccan",
"darija",
"arabic",
"multilingual",
"low-resource",
"languages"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8c5b8266209f4de92835fe8c470981de5fbfd44176cce84c0d234e0599ab3760",
"md5": "57c973b556abd41e028f5821ebc1369e",
"sha256": "75d1a08ebb410da56f95d6db0f1b17be9d5e826dcfe93748775af3b07a14e1f8"
},
"downloads": -1,
"filename": "sawalni-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "57c973b556abd41e028f5821ebc1369e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3491,
"upload_time": "2024-09-12T03:41:34",
"upload_time_iso_8601": "2024-09-12T03:41:34.415193Z",
"url": "https://files.pythonhosted.org/packages/8c/5b/8266209f4de92835fe8c470981de5fbfd44176cce84c0d234e0599ab3760/sawalni-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "202d98ba64b091fe96539b040c70385b64741ec0a6a87bdbb567bac19d0b85b8",
"md5": "84f862f72e6c77c7d5ad93a741b5a5ec",
"sha256": "fb74b136f03b326d5a918edc2ae11c6da2600326eda651427235d43450001a82"
},
"downloads": -1,
"filename": "sawalni-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "84f862f72e6c77c7d5ad93a741b5a5ec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 3374,
"upload_time": "2024-09-12T03:41:35",
"upload_time_iso_8601": "2024-09-12T03:41:35.874896Z",
"url": "https://files.pythonhosted.org/packages/20/2d/98ba64b091fe96539b040c70385b64741ec0a6a87bdbb567bac19d0b85b8/sawalni-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-12 03:41:35",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "sawalni"
}