Name | partnero JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | A Python SDK designed to wrap around the Partnero API. |
upload_time | 2024-05-11 01:49:29 |
maintainer | None |
docs_url | None |
author | Your Name |
requires_python | <4.0,>=3.10 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Partnero SDK
The Partnero SDK provides a simple and powerful Python interface to the Partnero API, allowing developers to manage customers, partners, transactions, webhooks, coupons, and promotion codes programmatically.
[Partnero API Documentation](https://developers.partnero.com/reference/general.html)
## Installation
To install the Partnero SDK, run the following command:
```bash
pip install partnero
```
## Configuration
Before using the SDK, you need to set up authentication:
```python
from partnero import Authentication
# Replace 'your_api_token_here' with your actual API token
auth = Authentication.configure(api_token='your_api_token_here')
```
## Usage
Here's how you can use different components of the SDK:
### Customer Management
**List Customers**
```python
from partnero import CustomerAPI
customer_api = CustomerAPI()
customers = customer_api.list_customers(limit=10, page=1)
print(customers)
```
**Create a New Customer**
```python
new_customer = customer_api.create_customer(
partner_key='your_partner_key',
customer_key='unique_customer_key',
email='customer@example.com',
name='Customer Name'
)
print(new_customer)
```
### Partner Management
**List Partners**
```python
from partnero import PartnerAPI
partner_api = PartnerAPI()
partners = partner_api.list_partners(limit=5, page=1)
print(partners)
```
**Register a New Partner**
```python
new_partner = partner_api.create_partner(
email='newpartner@example.com',
name='New Partner',
password='securepassword123'
)
print(new_partner)
```
### Transaction Management
**List Transactions**
```python
from partnero import TransactionAPI
transaction_api = TransactionAPI()
transactions = transaction_api.list_transactions(limit=5, page=1)
print(transactions)
```
**Create a Transaction**
```python
new_transaction = transaction_api.create_transaction(
customer_key='customer_key',
transaction_key='unique_transaction_key',
amount=39.99,
product_id='product_id',
product_type='type',
action='purchase'
)
print(new_transaction)
```
### Webhook Management
**List Webhooks**
```python
from partnero import WebhookAPI
webhook_api = WebhookAPI()
webhooks = webhook_api.list_webhooks(limit=5, page=1)
print(webhooks)
```
**Create a Webhook**
```python
new_webhook = webhook_api.create_webhook(
name='Order Placed',
url='https://yourdomain.com/webhooks/order_placed',
events=['order_placed'],
is_active=True
)
print(new_webhook)
```
## Contributions
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.
## License
This SDK is released under the MIT License. See the LICENSE file for more details.
```
This README includes basic examples of how to use each part of your SDK. It also guides the user on error handling and encourages community contributions, which are important aspects of maintaining an open-source project.
**Suggestions for your next steps:**
- **a.** Consider adding a `Contributing.md` file to guide potential contributors on how to help develop the SDK further.
- **b.** Regularly update the documentation as you add features or make changes to the SDK.
Raw data
{
"_id": null,
"home_page": null,
"name": "partnero",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/42/fe/7b489e1eb648cb6e2367728d6020a4f54cb08ca41d6a121f053f7a2fbd7e/partnero-0.2.0.tar.gz",
"platform": null,
"description": "# Partnero SDK\n\nThe Partnero SDK provides a simple and powerful Python interface to the Partnero API, allowing developers to manage customers, partners, transactions, webhooks, coupons, and promotion codes programmatically.\n[Partnero API Documentation](https://developers.partnero.com/reference/general.html)\n## Installation\n\nTo install the Partnero SDK, run the following command:\n\n```bash\npip install partnero\n```\n\n## Configuration\n\nBefore using the SDK, you need to set up authentication:\n\n```python\nfrom partnero import Authentication\n\n# Replace 'your_api_token_here' with your actual API token\nauth = Authentication.configure(api_token='your_api_token_here')\n```\n\n## Usage\n\nHere's how you can use different components of the SDK:\n\n### Customer Management\n\n**List Customers**\n\n```python\nfrom partnero import CustomerAPI\n\ncustomer_api = CustomerAPI()\ncustomers = customer_api.list_customers(limit=10, page=1)\nprint(customers)\n```\n\n**Create a New Customer**\n\n```python\nnew_customer = customer_api.create_customer(\n partner_key='your_partner_key',\n customer_key='unique_customer_key',\n email='customer@example.com',\n name='Customer Name'\n)\nprint(new_customer)\n```\n\n### Partner Management\n\n**List Partners**\n\n```python\nfrom partnero import PartnerAPI\n\npartner_api = PartnerAPI()\npartners = partner_api.list_partners(limit=5, page=1)\nprint(partners)\n```\n\n**Register a New Partner**\n\n```python\nnew_partner = partner_api.create_partner(\n email='newpartner@example.com',\n name='New Partner',\n password='securepassword123'\n)\nprint(new_partner)\n```\n\n### Transaction Management\n\n**List Transactions**\n\n```python\nfrom partnero import TransactionAPI\n\ntransaction_api = TransactionAPI()\ntransactions = transaction_api.list_transactions(limit=5, page=1)\nprint(transactions)\n```\n\n**Create a Transaction**\n\n```python\nnew_transaction = transaction_api.create_transaction(\n customer_key='customer_key',\n transaction_key='unique_transaction_key',\n amount=39.99,\n product_id='product_id',\n product_type='type',\n action='purchase'\n)\nprint(new_transaction)\n```\n\n### Webhook Management\n\n**List Webhooks**\n\n```python\nfrom partnero import WebhookAPI\n\nwebhook_api = WebhookAPI()\nwebhooks = webhook_api.list_webhooks(limit=5, page=1)\nprint(webhooks)\n```\n\n**Create a Webhook**\n\n```python\nnew_webhook = webhook_api.create_webhook(\n name='Order Placed',\n url='https://yourdomain.com/webhooks/order_placed',\n events=['order_placed'],\n is_active=True\n)\nprint(new_webhook)\n```\n\n## Contributions\n\nContributions are welcome! For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis SDK is released under the MIT License. See the LICENSE file for more details.\n```\n\nThis README includes basic examples of how to use each part of your SDK. It also guides the user on error handling and encourages community contributions, which are important aspects of maintaining an open-source project.\n\n**Suggestions for your next steps:**\n- **a.** Consider adding a `Contributing.md` file to guide potential contributors on how to help develop the SDK further.\n- **b.** Regularly update the documentation as you add features or make changes to the SDK.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python SDK designed to wrap around the Partnero API.",
"version": "0.2.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "34d184dc4cdeb8e6fb2a2b1e3fd2bfb20d6dcfd3b6fbff7f97ec1343b93b10b8",
"md5": "157f81088ccd46e87f410b651e017613",
"sha256": "2a30e2f0477b6682a384d90849fd288c91e8aad3f8faeee74b7d7c9ed8827e7a"
},
"downloads": -1,
"filename": "partnero-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "157f81088ccd46e87f410b651e017613",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 7968,
"upload_time": "2024-05-11T01:49:28",
"upload_time_iso_8601": "2024-05-11T01:49:28.408835Z",
"url": "https://files.pythonhosted.org/packages/34/d1/84dc4cdeb8e6fb2a2b1e3fd2bfb20d6dcfd3b6fbff7f97ec1343b93b10b8/partnero-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "42fe7b489e1eb648cb6e2367728d6020a4f54cb08ca41d6a121f053f7a2fbd7e",
"md5": "5ca05194f369a6b32d1f2bf2f005fd9e",
"sha256": "8f0e1278a64178893a8a2836679c148222f6ac73c426b136d68234cd551b5c8c"
},
"downloads": -1,
"filename": "partnero-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5ca05194f369a6b32d1f2bf2f005fd9e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 6240,
"upload_time": "2024-05-11T01:49:29",
"upload_time_iso_8601": "2024-05-11T01:49:29.883453Z",
"url": "https://files.pythonhosted.org/packages/42/fe/7b489e1eb648cb6e2367728d6020a4f54cb08ca41d6a121f053f7a2fbd7e/partnero-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-11 01:49:29",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "partnero"
}