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
aiomobilevikingsmodule 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiomobilevikings-0.2.0.tar.gz.
File metadata
- Download URL: aiomobilevikings-0.2.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8316b7ffcfe49527b50a59b40341283eb44d9f94add66496330fe98a535c9b3c
|
|
| MD5 |
d1b904b5d8d1b1f5b5a56277f5d0a652
|
|
| BLAKE2b-256 |
d1631fb01219a9bf45da6c7d6ce4905ccbbf7e7e7aa27155c22a4fc18a267632
|
File details
Details for the file aiomobilevikings-0.2.0-py3-none-any.whl.
File metadata
- Download URL: aiomobilevikings-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bf05ba7a5240573cf8697c51a3bdfd054553ef3b0177e7006a2a997ed4dd061
|
|
| MD5 |
f7165e5cc441ec3f6edd4c0ca127016f
|
|
| BLAKE2b-256 |
b4ba9b29552f588a518cf34c7c39f3ce584c37866d8485a4119ff1cc1c10cd35
|