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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for aiomobilevikings-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e7690d80a51be61e96ea6ae71a89857ada9c94f5782b470755837645d6960c42
MD5 e78c2d8cf90d76d7dd29f00e0f187172
BLAKE2b-256 9069c4adeb82e3692b384a267a5a1e1998af67bb3ade8decdf7a96aa9c75858c

See more details on using hashes here.

File details

Details for the file aiomobilevikings-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aiomobilevikings-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad85527dd8e4a759d6afee2ce0bc056a3e0aff9652faa7257fc487768c38eb77
MD5 4dfac68ba3dc4b934187dd8a705f41a3
BLAKE2b-256 7af66acc2f478ffd60afaf828bbd7cdab58eacc4c4c655e41418f878b24ed85c

See more details on using hashes here.

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