Module to communicate to the Mobile Vikings API
Project description
aiomobilevikings
Asynchronous library to communicate with the Mobile Vikings API
Mobile Vikings API Example Script
This example script demonstrates how to utilize the MobileVikingsClient
class from the aiomobilevikings
module to interact with the Mobile Vikings API. It showcases various functionalities available within the client class to retrieve different types of data from the API.
Usage
-
Installation: Ensure the
aiomobilevikings
module is installed. If not, install it usingpip install aiomobilevikings
. -
Configuration: Replace the placeholder details (within the script with actual values.
-
Execution: Run the script, and it will sequentially call these functions, displaying the retrieved data for each function.
Important Notes
- Replace placeholder values (user, password) with your actual Mobile Vikings account details.
- Make sure you have appropriate access rights and permissions for the Mobile Vikings API endpoints being accessed.
Feel free to modify the script as needed, adding error handling, logging, or additional functionalities based on your requirements and the Mobile Vikings API's capabilities.
"""
Example Script: Accessing Mobile Vikings API with aiomobilevikings
Requirements:
- aiomobilevikings library (installed via pip)
Usage:
Run the script and observe the output displaying various data from the Mobile Vikings API.
"""
from aiomobilevikings import MobileVikingsClient
import logging
import asyncio
import json
# Set the logging level to DEBUG for the root logger
logging.basicConfig(level=logging.ERROR)
# Create a logger for the aiomobilevikings module
_LOGGER = logging.getLogger("aiomobilevikings")
_LOGGER.setLevel(logging.DEBUG) # Set the logging level to DEBUG for this logger
async def main():
"""Run the main function."""
# Initialize the MobileVikingsClient with credentials
client = MobileVikingsClient(
username="xxxxxx@xxxxx.com", # Replace with actual username
password="xxxxxxxxxxxxxxxx", # Replace with actual password
)
try:
# Fetch customer information
data = await client.get_data()
print(json.dumps(data, indent=2))
except Exception as e:
print("An error occurred:", e)
finally:
# Close the client session
await client.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aiomobilevikings-0.1.0.tar.gz
.
File metadata
- Download URL: aiomobilevikings-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7690d80a51be61e96ea6ae71a89857ada9c94f5782b470755837645d6960c42 |
|
MD5 | e78c2d8cf90d76d7dd29f00e0f187172 |
|
BLAKE2b-256 | 9069c4adeb82e3692b384a267a5a1e1998af67bb3ade8decdf7a96aa9c75858c |
File details
Details for the file aiomobilevikings-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: aiomobilevikings-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad85527dd8e4a759d6afee2ce0bc056a3e0aff9652faa7257fc487768c38eb77 |
|
MD5 | 4dfac68ba3dc4b934187dd8a705f41a3 |
|
BLAKE2b-256 | 7af66acc2f478ffd60afaf828bbd7cdab58eacc4c4c655e41418f878b24ed85c |