Skip to main content

Module to communicate to the Mobile Vikings API

Project description

aiomobilevikings

Asynchronous library to communicate with the Mobile Vikings API

maintainer buyme_coffee discord

MIT License

GitHub issues Average time to resolve an issue Percentage of issues still open PRs Welcome

Python

github release github release date github last-commit github contributors github commit activity

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

  1. Installation: Ensure the aiomobilevikings module is installed. If not, install it using pip install aiomobilevikings.

  2. Configuration: Replace the placeholder details (within the script with actual values.

  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiomobilevikings-0.1.0.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

aiomobilevikings-0.1.0-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page