Name | easymobile JSON |
Version |
0.1.12.post0
JSON |
| download |
home_page | None |
Summary | EASYMOBILE Python client library |
upload_time | 2024-08-16 21:45:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <4.0,>=3.7 |
license | MIT |
keywords |
easymobile
easymobile
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# EASYMOBILE PYTHON API
## Overview
`easymobile` is a Python package that provides a simple interface for integrating with the EASYMOBILE API, allowing users to purchase airtime, data, cable subscriptions etc. This package is designed to streamline the process of interacting with the EASYMOBILE API and offers methods to handle various operations such as fetching available services, purchasing services, and checking transaction statuses.
## Available Features
- Airtime Operations
- Data Operations
- Cable Operations
## Installation
To install the EasyB2B package, clone this repository and install:
```bash
pip install easymobile
```
or if you wish to install from the git repo.
```bash
# Install from the main branch
pip install git+https://github.com/Ephraim-Akolo/EASYMOBILE.git
```
## Usage
### Initialization
To use the EASYMOBILE package, you need to initialize the classes with your API key. The API key can be provided during initialization or set in the environmental variable `EASYMOBILE_API_KEY`.
### Account Operations
```python
from easymobile import EasyBase
api_key = 'your_api_key'
client = EasyBase(api_key=api_key)
# Get Account Balance
response = client.get_wallet_balance("admin@email.com")
print(response)
```
### Airtime Operations
```python
from easymobile import EasyAirtime, get_easyb2b_reference
api_key = 'your_api_key'
client = EasyAirtime(api_key=api_key)
# Get Networks
networks = client.get_networks()
print(networks)
# Get Airtime Types
airtime_types = client.get_airtime_types(network=1)
print(airtime_types)
# Get Airtime Rates
airtime_rates = client.get_airtime_rates(network=1, airtimeType='VTU')
print(airtime_rates)
# Purchase Airtime
reference = get_easyb2b_reference() # Generate a unique reference code
response = client.purchase_airtime(reference=reference, network=1, airtimeType='SME', amount='10', phone='08168639124')
print(response)
# Get Transaction Status
status = client.get_transaction_status(ref=reference)
print(status)
```
### Data Operations
```python
from easymobile import EasyData, get_easyb2b_reference
api_key = 'your_api_key'
client = EasyData(api_key=api_key)
# Get Networks
networks = client.get_networks()
print(networks)
# Get Data Types
data_types = client.get_data_types(network=1)
print(data_types)
# Get Data Plans
data_plans = client.get_data_plans(network=1, dataType='SME')
print(data_plans)
# Purchase Data
reference = get_easyb2b_reference() # Generate a unique reference code
response = client.purchase_data(reference=reference, network=1, dataType='SME', planId='1', phone='08168639113')
print(response)
# Get Transaction Status
status = client.get_transaction_status(ref=reference)
print(status)
```
### Cable Operations
```python
from easymobile import EasyCable, get_easyb2b_reference
api_key = 'your_api_key'
client = EasyCable(api_key=api_key)
# Get Cables
cables = client.get_cables()
print(cables)
# Get Cable Packages
packages = client.get_cable_packages(cable_id=1)
print(packages)
# Validate Smartcard/IUC Number
validation = client.validate_smartcard_iuc_number(cable_id=1, smartcard_no='1234567890')
print(validation)
# Purchase Cable Subscription
reference = get_easyb2b_reference() # Generate a unique reference code
response = client.purchase_cable(reference=reference, cable_id='1', package_id='1', smartcard_no='1234567890')
print(response)
# Get Transaction Status
status = client.get_transaction_status(ref=reference)
print(status)
```
### Single Client For All Operations
If you require a client object that is capable of accessing all services, you can instantiate the `EasyMobile` class and use `easy_<service name>` to access any service specific methods.
```python
from easymobile import EasyMobile
api_key = 'your_api_key'
client = EasyMobile(api_key=api_key)
# Get Account Balance
response = client.get_wallet_balance("admin@email.com")
print(response)
# Get Networks (Airtime)
networks = client.easy_airtime.get_networks()
print(networks)
# Get Networks (Data)
networks = client.easy_data.get_networks()
print(networks)
# Get Cables
cables = client.easy_cable.get_cables()
print(cables)
```
## Running Tests
To run the tests for the EASYMOBILE package, create and/or activate a Python virtual environment, ensure the current working directory is the root directory, and follow these steps:
```bash
# Install the test dependencies if not already done
pip install -r requirements-test.txt
# Discover and run tests
python -m unittest
```
## Contributing
Contributions are welcome! Please fork the repository and create a pull request to `dev` branch with your changes.
## License
This project is licensed under the MIT License. See the LICENSE file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "easymobile",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": null,
"keywords": "EASYMOBILE, easymobile",
"author": null,
"author_email": "Ephraim <ephraimakolo2017@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/6d/d4/901266844f0b0fe323e42da06e4b77efef6c98ea0e4a5d410e291910d992/easymobile-0.1.12.post0.tar.gz",
"platform": null,
"description": "# EASYMOBILE PYTHON API\n\n## Overview\n\n`easymobile` is a Python package that provides a simple interface for integrating with the EASYMOBILE API, allowing users to purchase airtime, data, cable subscriptions etc. This package is designed to streamline the process of interacting with the EASYMOBILE API and offers methods to handle various operations such as fetching available services, purchasing services, and checking transaction statuses.\n\n\n## Available Features\n\n- Airtime Operations\n- Data Operations\n- Cable Operations\n\n## Installation\n\nTo install the EasyB2B package, clone this repository and install:\n\n```bash\npip install easymobile\n```\nor if you wish to install from the git repo.\n\n```bash\n# Install from the main branch\npip install git+https://github.com/Ephraim-Akolo/EASYMOBILE.git\n```\n\n## Usage\n\n### Initialization\n\nTo use the EASYMOBILE package, you need to initialize the classes with your API key. The API key can be provided during initialization or set in the environmental variable `EASYMOBILE_API_KEY`.\n\n### Account Operations\n\n```python\nfrom easymobile import EasyBase\n\napi_key = 'your_api_key'\n\nclient = EasyBase(api_key=api_key)\n\n# Get Account Balance\nresponse = client.get_wallet_balance(\"admin@email.com\")\nprint(response)\n```\n\n### Airtime Operations\n\n```python\nfrom easymobile import EasyAirtime, get_easyb2b_reference\n\napi_key = 'your_api_key'\n\nclient = EasyAirtime(api_key=api_key)\n\n# Get Networks\nnetworks = client.get_networks()\nprint(networks)\n\n# Get Airtime Types\nairtime_types = client.get_airtime_types(network=1)\nprint(airtime_types)\n\n# Get Airtime Rates\nairtime_rates = client.get_airtime_rates(network=1, airtimeType='VTU')\nprint(airtime_rates)\n\n# Purchase Airtime\nreference = get_easyb2b_reference() # Generate a unique reference code\nresponse = client.purchase_airtime(reference=reference, network=1, airtimeType='SME', amount='10', phone='08168639124')\nprint(response)\n\n# Get Transaction Status\nstatus = client.get_transaction_status(ref=reference)\nprint(status)\n```\n\n### Data Operations\n\n```python\nfrom easymobile import EasyData, get_easyb2b_reference\n\napi_key = 'your_api_key'\n\nclient = EasyData(api_key=api_key)\n\n# Get Networks\nnetworks = client.get_networks()\nprint(networks)\n\n# Get Data Types\ndata_types = client.get_data_types(network=1)\nprint(data_types)\n\n# Get Data Plans\ndata_plans = client.get_data_plans(network=1, dataType='SME')\nprint(data_plans)\n\n# Purchase Data\nreference = get_easyb2b_reference() # Generate a unique reference code\nresponse = client.purchase_data(reference=reference, network=1, dataType='SME', planId='1', phone='08168639113')\nprint(response)\n\n# Get Transaction Status\nstatus = client.get_transaction_status(ref=reference)\nprint(status)\n```\n\n### Cable Operations\n\n```python\nfrom easymobile import EasyCable, get_easyb2b_reference\n\napi_key = 'your_api_key'\n\nclient = EasyCable(api_key=api_key)\n\n# Get Cables\ncables = client.get_cables()\nprint(cables)\n\n# Get Cable Packages\npackages = client.get_cable_packages(cable_id=1)\nprint(packages)\n\n# Validate Smartcard/IUC Number\nvalidation = client.validate_smartcard_iuc_number(cable_id=1, smartcard_no='1234567890')\nprint(validation)\n\n# Purchase Cable Subscription\nreference = get_easyb2b_reference() # Generate a unique reference code\nresponse = client.purchase_cable(reference=reference, cable_id='1', package_id='1', smartcard_no='1234567890')\nprint(response)\n\n# Get Transaction Status\nstatus = client.get_transaction_status(ref=reference)\nprint(status)\n```\n\n### Single Client For All Operations\n\nIf you require a client object that is capable of accessing all services, you can instantiate the `EasyMobile` class and use `easy_<service name>` to access any service specific methods.\n\n```python\nfrom easymobile import EasyMobile\n\napi_key = 'your_api_key'\n\nclient = EasyMobile(api_key=api_key)\n\n# Get Account Balance\nresponse = client.get_wallet_balance(\"admin@email.com\")\nprint(response)\n\n# Get Networks (Airtime)\nnetworks = client.easy_airtime.get_networks()\nprint(networks)\n\n# Get Networks (Data)\nnetworks = client.easy_data.get_networks()\nprint(networks)\n\n# Get Cables\ncables = client.easy_cable.get_cables()\nprint(cables)\n```\n\n## Running Tests\n\nTo run the tests for the EASYMOBILE package, create and/or activate a Python virtual environment, ensure the current working directory is the root directory, and follow these steps:\n```bash\n# Install the test dependencies if not already done\npip install -r requirements-test.txt\n\n# Discover and run tests\npython -m unittest\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and create a pull request to `dev` branch with your changes.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "EASYMOBILE Python client library",
"version": "0.1.12.post0",
"project_urls": {
"homepage": "https://github.com/jake-ephraim/EASYMOBILE",
"repository": "https://github.com/jake-ephraim/EASYMOBILE"
},
"split_keywords": [
"easymobile",
" easymobile"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "308adb4e9ee29774944a4581f7793e062e7f443bba9f51268203a75bb388c5dc",
"md5": "21bc97ab183b62305169bc0fdac7a637",
"sha256": "34fd6d7a48d7664cbab9542423041fb6ddb92f229fe62260ec2cfebafb5da4b0"
},
"downloads": -1,
"filename": "easymobile-0.1.12.post0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "21bc97ab183b62305169bc0fdac7a637",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 13192,
"upload_time": "2024-08-16T21:45:05",
"upload_time_iso_8601": "2024-08-16T21:45:05.356669Z",
"url": "https://files.pythonhosted.org/packages/30/8a/db4e9ee29774944a4581f7793e062e7f443bba9f51268203a75bb388c5dc/easymobile-0.1.12.post0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6dd4901266844f0b0fe323e42da06e4b77efef6c98ea0e4a5d410e291910d992",
"md5": "5d7dff8087540fa2906951686a99d22a",
"sha256": "7be719e51ff02b2ec4ed522c73746700a933ef062cccc4ea982ddbc8a4a3094c"
},
"downloads": -1,
"filename": "easymobile-0.1.12.post0.tar.gz",
"has_sig": false,
"md5_digest": "5d7dff8087540fa2906951686a99d22a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 14164,
"upload_time": "2024-08-16T21:45:06",
"upload_time_iso_8601": "2024-08-16T21:45:06.992237Z",
"url": "https://files.pythonhosted.org/packages/6d/d4/901266844f0b0fe323e42da06e4b77efef6c98ea0e4a5d410e291910d992/easymobile-0.1.12.post0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-16 21:45:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jake-ephraim",
"github_project": "EASYMOBILE",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "easymobile"
}