# p2p-payme package
[![\Telegram\] abdulvoris](https://img.shields.io/badge/Telegram-blue.svg?logo=telegram)](https://t.me/aerkinov1)
## Introduction
p2p_payme is a Python package that provides a simple and convenient way to interact with the Payme API for peer-to-peer (P2P) automation. This package allows users to authenticate, perform various P2P transactions, manage cards, and access transaction history.
## Installation
```
pip install p2p-payme
```
## Authentication
Before using the p2p_payme package, developers need to authenticate to obtain the device_id, which is required for all subsequent interactions with the Payme API. The device_id uniquely identifies the device from which the API requests are being made.
Just write this in the terminal:
```
auth
```
To authenticate, the user needs to run the auth command in the terminal. The user will be prompted to enter their Payme account credentials, including the phone number and password. The provided credentials will be used to log in to the Payme API.
Upon successful authentication, the device_id will be obtained, and the user will be ready to use the PaymeClient to perform various operations.
## PaymeClient Operations
After obtaining the device_id, you can create an instance of PaymeClient by passing the phone number, password, and device_id. The PaymeClient class provides various methods to interact with the Payme API.
For example, you can use the cards property to retrieve all cards associated with the your's account. Each card object contains details such as card name, number, balance, and currency.
Additionally, the transactions method allows you to retrieve incoming transactions for a specific card. By providing the card ID, developers can obtain details of recent transactions, including transaction ID, amount, and description.
## Cards
`cards`
This property returns all cards associated with the user's account.
```
cards = client.cards.all()
```
`cards.filter(**kwargs)`
This method allows filtering cards based on provided attributes (keyword arguments). You can filter cards by card name, number, balance, currency, etc.
```
# Filter cards by card name
filtered_cards = client.cards.filter(name="My Card")
```
## Transactions (Cheques)
`transactions(card_id: str, from_: Optional[datetime] = None, to: datetime = datetime.now())`
This method retrieves incoming transactions for a specific card. You need to provide the card ID for which you want to get transactions. Optionally, you can specify the time range for the transactions using the `from_` and `to` parameters.
Get transactions for a specific card (replace 'card_id' with the actual card ID)
```
card_id = client.cards.first()
transactions = client.transactions(card_id)
```
## Filtering Cards
The `cards.filter()` method allows you to filter cards based on specific attributes. Here are some of the attributes (keyword arguments) that you can use for filtering:
- `name`: Filter cards by their name.
- `number`: Filter cards by their number.
- `balance`: Filter cards by their balance amount.
- `currency`: Filter cards by their currency type.
- `owner`: Filter cards by the owner's name.
You can pass these attributes as keyword arguments to the `cards.filter()` method. For example:
```
# Filter cards by card name and currency
filtered_cards = client.cards.filter(name="My Card", currency="UZS")
```
You can use one or multiple attributes to filter the cards as per your requirements.
## Example
Here's an example that demonstrates how to use some of the methods available in `PaymeClient`:
```
# Import the PaymeClient class and other required modules
from p2p_payme.client.operations import PaymeClient
from datetime import datetime
# Replace with your Payme account credentials and device information
phone_number = "YOUR_PHONE_NUMBER"
password = "YOUR_PASSWORD"
device = "YOUR_DEVICE_INFORMATION"
# Create a PaymeClient instance with authenticated credentials
client = PaymeClient(phone_number, password, device)
# Get all cards associated with the user's account
cards = client.cards.all()
# Print card details
for card in cards:
print(f"Card Name: {card.name}")
print(f"Card Number: {card.number}")
print(f"Balance: {card.balance}")
print("-------")
# Get specific card using get
card = client.cards.get(name="uzcard")
# Get transactions for a specific card (replace 'card_id' with the actual card ID)
card_id = "YOUR_CARD_ID"
transactions = client.transactions(card_id)
# Print transaction details
for transaction in transactions:
print(f"Transaction ID: {transaction.id}")
print(f"Amount: {transaction.amount}")
print(f"Description: {transaction.description}")
print("-------")
# Filter cards by card name and currency
filtered_cards = client.cards.filter(name="My Card", currency="UZS")
# Print filtered card details
for card in filtered_cards:
print(f"Card Name: {card.name}")
print(f"Card Number: {card.number}")
print(f"Balance: {card.balance}")
print("-------")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Abdulvoris101/p2p-payme",
"name": "p2p-payme",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python payme p2p automation",
"author": "Abdulvoris Erkinov",
"author_email": "erkinovabdulvoris101@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7a/b7/1e9149d488312cd61159fb76d5010479c614b548042995eefe8b7b71a657/p2p-payme-0.1.4.tar.gz",
"platform": null,
"description": "# p2p-payme package\n\n[![\\Telegram\\] abdulvoris](https://img.shields.io/badge/Telegram-blue.svg?logo=telegram)](https://t.me/aerkinov1)\n\n## Introduction\n\np2p_payme is a Python package that provides a simple and convenient way to interact with the Payme API for peer-to-peer (P2P) automation. This package allows users to authenticate, perform various P2P transactions, manage cards, and access transaction history.\n\n\n## Installation\n\n```\npip install p2p-payme\n```\n\n## Authentication\nBefore using the p2p_payme package, developers need to authenticate to obtain the device_id, which is required for all subsequent interactions with the Payme API. The device_id uniquely identifies the device from which the API requests are being made.\n\nJust write this in the terminal:\n```\nauth\n```\n\nTo authenticate, the user needs to run the auth command in the terminal. The user will be prompted to enter their Payme account credentials, including the phone number and password. The provided credentials will be used to log in to the Payme API. \n\nUpon successful authentication, the device_id will be obtained, and the user will be ready to use the PaymeClient to perform various operations.\n\n## PaymeClient Operations\n\nAfter obtaining the device_id, you can create an instance of PaymeClient by passing the phone number, password, and device_id. The PaymeClient class provides various methods to interact with the Payme API.\n\nFor example, you can use the cards property to retrieve all cards associated with the your's account. Each card object contains details such as card name, number, balance, and currency.\n\nAdditionally, the transactions method allows you to retrieve incoming transactions for a specific card. By providing the card ID, developers can obtain details of recent transactions, including transaction ID, amount, and description.\n\n## Cards\n\n`cards`\n\nThis property returns all cards associated with the user's account.\n```\ncards = client.cards.all()\n```\n\n`cards.filter(**kwargs)`\n\nThis method allows filtering cards based on provided attributes (keyword arguments). You can filter cards by card name, number, balance, currency, etc.\n\n```\n# Filter cards by card name\nfiltered_cards = client.cards.filter(name=\"My Card\")\n```\n\n## Transactions (Cheques)\n\n`transactions(card_id: str, from_: Optional[datetime] = None, to: datetime = datetime.now())`\n\nThis method retrieves incoming transactions for a specific card. You need to provide the card ID for which you want to get transactions. Optionally, you can specify the time range for the transactions using the `from_` and `to` parameters.\n\nGet transactions for a specific card (replace 'card_id' with the actual card ID)\n```\ncard_id = client.cards.first()\ntransactions = client.transactions(card_id)\n```\n\n## Filtering Cards\n\nThe `cards.filter()` method allows you to filter cards based on specific attributes. Here are some of the attributes (keyword arguments) that you can use for filtering:\n\n- `name`: Filter cards by their name.\n- `number`: Filter cards by their number.\n- `balance`: Filter cards by their balance amount.\n- `currency`: Filter cards by their currency type.\n- `owner`: Filter cards by the owner's name.\n\nYou can pass these attributes as keyword arguments to the `cards.filter()` method. For example:\n```\n# Filter cards by card name and currency\nfiltered_cards = client.cards.filter(name=\"My Card\", currency=\"UZS\")\n```\nYou can use one or multiple attributes to filter the cards as per your requirements.\n\n## Example\nHere's an example that demonstrates how to use some of the methods available in `PaymeClient`:\n```\n# Import the PaymeClient class and other required modules\nfrom p2p_payme.client.operations import PaymeClient\nfrom datetime import datetime\n\n# Replace with your Payme account credentials and device information\nphone_number = \"YOUR_PHONE_NUMBER\"\npassword = \"YOUR_PASSWORD\"\ndevice = \"YOUR_DEVICE_INFORMATION\"\n\n# Create a PaymeClient instance with authenticated credentials\nclient = PaymeClient(phone_number, password, device)\n\n\n# Get all cards associated with the user's account\ncards = client.cards.all()\n\n# Print card details\nfor card in cards:\n print(f\"Card Name: {card.name}\")\n print(f\"Card Number: {card.number}\")\n print(f\"Balance: {card.balance}\")\n print(\"-------\")\n\n# Get specific card using get\ncard = client.cards.get(name=\"uzcard\")\n\n# Get transactions for a specific card (replace 'card_id' with the actual card ID)\ncard_id = \"YOUR_CARD_ID\"\ntransactions = client.transactions(card_id)\n\n# Print transaction details\nfor transaction in transactions:\n print(f\"Transaction ID: {transaction.id}\")\n print(f\"Amount: {transaction.amount}\")\n print(f\"Description: {transaction.description}\")\n print(\"-------\")\n\n# Filter cards by card name and currency\nfiltered_cards = client.cards.filter(name=\"My Card\", currency=\"UZS\")\n\n# Print filtered card details\nfor card in filtered_cards:\n print(f\"Card Name: {card.name}\")\n print(f\"Card Number: {card.number}\")\n print(f\"Balance: {card.balance}\")\n print(\"-------\")\n```\n\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "P2P automation",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/Abdulvoris101/p2p-payme"
},
"split_keywords": [
"python",
"payme",
"p2p",
"automation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b21de27d20d9436361e82a74bee78d6b061f64e06acfd0b2f696e1df565ac8fc",
"md5": "b0e43ddb5cb6079d8314ab15c8d66968",
"sha256": "cbdd3f64cd5eedeb1da2e6e85e64e5f1cd6f9be107eae7784d993cef58f49a68"
},
"downloads": -1,
"filename": "p2p_payme-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b0e43ddb5cb6079d8314ab15c8d66968",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10032,
"upload_time": "2023-07-30T10:14:16",
"upload_time_iso_8601": "2023-07-30T10:14:16.629410Z",
"url": "https://files.pythonhosted.org/packages/b2/1d/e27d20d9436361e82a74bee78d6b061f64e06acfd0b2f696e1df565ac8fc/p2p_payme-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7ab71e9149d488312cd61159fb76d5010479c614b548042995eefe8b7b71a657",
"md5": "4035d31837e52cfdbc7b80ba12c38d8e",
"sha256": "b3059dcf9e69c7a56fc4838eec58853c926e5923efa899003e175bd7c67ecc6e"
},
"downloads": -1,
"filename": "p2p-payme-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "4035d31837e52cfdbc7b80ba12c38d8e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9324,
"upload_time": "2023-07-30T10:14:18",
"upload_time_iso_8601": "2023-07-30T10:14:18.638767Z",
"url": "https://files.pythonhosted.org/packages/7a/b7/1e9149d488312cd61159fb76d5010479c614b548042995eefe8b7b71a657/p2p-payme-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-30 10:14:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Abdulvoris101",
"github_project": "p2p-payme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "p2p-payme"
}