<h2 align='center'>Salla SDK 📦</h2>
<p align="center">
<a href="https://github.com/9ai-in"><img title="Author" src="https://img.shields.io/badge/Author-9AI--in-black.svg?style=for-the-badge&logo=github"></a>
<p align="center">
<a href="https://github.com/9ai-in/salla-python-sdk/stargazers/"><img title="Stars" src="https://img.shields.io/github/stars/9ai-in/salla-python-sdk?color=black&style=flat-square"></a>
<a href="https://github.com/9ai-in/salla-python-sdk/network/members"><img title="Forks" src="https://img.shields.io/github/forks/9ai-in/salla-python-sdk?color=black&style=flat-square"></a>
</p>
# Installation
```python
$ install python version 3.10
$ pip install salla-python-sdk
$ create a .env and fill all required fields from .env.example.
```
---
# Supported Features
| Feature | Status |
| ----------------------------------------------- | ------ |
| Generate Access Token From Code | ✅ |
| Generate Access Token From Refresh Token | ✅ |
| Retrive Merchant info | ✅ |
| Retrive Store info | ✅ |
| Subscribe to a webhook URL | ✅ |
| Unsubscribe to a webhook by `url` or `id` | ✅ |
| List all `registered` and `available` webhook/s | ✅ |
---
# Examples
```python
import asyncio
from salla import ENV, Refresh_Token_Payload, Salla, Webhook_Events, WebhookPayload
async def main():
s = Salla(ENV.ACCESS_TOKEN)
# Get information about the merchant and print it
await s.get_merchant_info()
# Get information about the store and print it
await s.get_store_info()
# Subscribe to product update events using a webhook
await s.webhook_subscribe(
WebhookPayload(
name="Ryuk-me",
event=Webhook_Events.PRODUCT_UPDATED,
secret=ENV.WEBHOOK_SECRET,
url="https://webhook.site/2453453-123n7bad6va123",
security_strategy="token",
)
)
# Refresh the access token and print the result
await s.get_access_token_from_refresh_token(
Refresh_Token_Payload(
client_id=ENV.CLIENT_ID,
client_secret=ENV.CLIENT_SECRET,
refresh_token=ENV.REFRESH_TOKEN,
)
)
# Get and print a list of active webhooks
await s.get_active_webhooks()
# Get and print a list of available webhook events
await s.get_available_webhook_events()
# Unsubscribe from a specific webhook and print the result
await s.unsubscribe_webhook(url="https://webhook.site/2453453-123n7bad6va123")
asyncio.run(main())
```
---
#### License
MIT © [9AI](https://github.com/9AI-IN)
Raw data
{
"_id": null,
"home_page": "https://github.com/9ai-in/salla-python-sdk/",
"name": "salla-python-sdk",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.10",
"maintainer_email": "",
"keywords": "salla,salla-sdk,salla-api,salla-python",
"author": "9AI",
"author_email": "team@9ai.in",
"download_url": "https://files.pythonhosted.org/packages/d3/0d/b88dc55ee1dd8e2c931d2da7b0d0424e0d786ac886ae807e9bc919526ea7/salla-python-sdk-0.1.2.tar.gz",
"platform": null,
"description": "<h2 align='center'>Salla SDK \u00f0\u0178\u201c\u00a6</h2>\r\n<p align=\"center\">\r\n<a href=\"https://github.com/9ai-in\"><img title=\"Author\" src=\"https://img.shields.io/badge/Author-9AI--in-black.svg?style=for-the-badge&logo=github\"></a>\r\n<p align=\"center\">\r\n<a href=\"https://github.com/9ai-in/salla-python-sdk/stargazers/\"><img title=\"Stars\" src=\"https://img.shields.io/github/stars/9ai-in/salla-python-sdk?color=black&style=flat-square\"></a>\r\n<a href=\"https://github.com/9ai-in/salla-python-sdk/network/members\"><img title=\"Forks\" src=\"https://img.shields.io/github/forks/9ai-in/salla-python-sdk?color=black&style=flat-square\"></a>\r\n</p>\r\n\r\n\r\n# Installation\r\n\r\n```python\r\n$ install python version 3.10\r\n\r\n$ pip install salla-python-sdk\r\n\r\n$ create a .env and fill all required fields from .env.example.\r\n\r\n```\r\n---\r\n\r\n# Supported Features\r\n| Feature | Status |\r\n| ----------------------------------------------- | ------ |\r\n| Generate Access Token From Code | \u00e2\u0153\u2026 |\r\n| Generate Access Token From Refresh Token | \u00e2\u0153\u2026 |\r\n| Retrive Merchant info | \u00e2\u0153\u2026 |\r\n| Retrive Store info | \u00e2\u0153\u2026 |\r\n| Subscribe to a webhook URL | \u00e2\u0153\u2026 |\r\n| Unsubscribe to a webhook by `url` or `id` | \u00e2\u0153\u2026 |\r\n| List all `registered` and `available` webhook/s | \u00e2\u0153\u2026 |\r\n\r\n---\r\n\r\n# Examples\r\n\r\n```python\r\n\r\nimport asyncio\r\n\r\nfrom salla import ENV, Refresh_Token_Payload, Salla, Webhook_Events, WebhookPayload\r\n\r\n\r\nasync def main():\r\n s = Salla(ENV.ACCESS_TOKEN)\r\n\r\n # Get information about the merchant and print it\r\n await s.get_merchant_info()\r\n\r\n # Get information about the store and print it\r\n await s.get_store_info()\r\n\r\n # Subscribe to product update events using a webhook\r\n await s.webhook_subscribe(\r\n WebhookPayload(\r\n name=\"Ryuk-me\",\r\n event=Webhook_Events.PRODUCT_UPDATED,\r\n secret=ENV.WEBHOOK_SECRET,\r\n url=\"https://webhook.site/2453453-123n7bad6va123\",\r\n security_strategy=\"token\",\r\n )\r\n )\r\n\r\n # Refresh the access token and print the result\r\n await s.get_access_token_from_refresh_token(\r\n Refresh_Token_Payload(\r\n client_id=ENV.CLIENT_ID,\r\n client_secret=ENV.CLIENT_SECRET,\r\n refresh_token=ENV.REFRESH_TOKEN,\r\n )\r\n )\r\n\r\n # Get and print a list of active webhooks\r\n await s.get_active_webhooks()\r\n\r\n # Get and print a list of available webhook events\r\n await s.get_available_webhook_events()\r\n\r\n # Unsubscribe from a specific webhook and print the result\r\n await s.unsubscribe_webhook(url=\"https://webhook.site/2453453-123n7bad6va123\")\r\n\r\n\r\nasyncio.run(main())\r\n```\r\n---\r\n\r\n\r\n#### License\r\n\r\nMIT \u00c2\u00a9 [9AI](https://github.com/9AI-IN)\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python SDK for salla integration",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/9ai-in/salla-python-sdk/"
},
"split_keywords": [
"salla",
"salla-sdk",
"salla-api",
"salla-python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d30db88dc55ee1dd8e2c931d2da7b0d0424e0d786ac886ae807e9bc919526ea7",
"md5": "2e3d31585f64bf8472e36274d19f9d72",
"sha256": "05407fc9b47b3a1b0295854bcefa2a2828da2c850ccda95a1d775ebd1da08613"
},
"downloads": -1,
"filename": "salla-python-sdk-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "2e3d31585f64bf8472e36274d19f9d72",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.10",
"size": 9592,
"upload_time": "2023-12-29T10:02:31",
"upload_time_iso_8601": "2023-12-29T10:02:31.462600Z",
"url": "https://files.pythonhosted.org/packages/d3/0d/b88dc55ee1dd8e2c931d2da7b0d0424e0d786ac886ae807e9bc919526ea7/salla-python-sdk-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-29 10:02:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "9ai-in",
"github_project": "salla-python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "salla-python-sdk"
}