Skip to main content

Migas Python client

Project description

Migas Client

A Python package to communicate with a migas server.

About

migas (mee-gahs) is a Python client to facilitate communication with a migas server.

API

migas includes the following functions to communicate with the telemetry server:

migas.add_project()

Send a breadcrumb with usage information to the server. Usage information includes:

  • application
  • application version
  • python version
  • operating system
  • application status

The server will attempt to return version information about the project.

add_project example
>>> add_project('mgxd/migas-py', '0.0.1')
{'bad_versions': [],
 'cached': True,
 'latest_version': '0.0.4',
 'message': '',
 'success': True}

migas.get_usage()

Check number of uses a project has received from a start date, and optionally an end date. If no end date is specified, the current datetime is used.

get_usage example
>>> get_usage('mgxd/migas-py', '2022-07-01')
{'hits': 7, 'message': '', 'unique': False}

Customization

By default, migas-py will communicate with our hosted migas server, however it can easily be configured to communicate with any migas server.

To configure the client:

import migas; migas.setup(endpoint='your-custom-endpoint-here', force=True)

Environmental variables

To enable migas, you must have a non-empty environmental variable ENABLE_MIGAS set. Additionally, you may control the request timeout by setting MIGAS_TIMEOUT.

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

migas-0.1.1.tar.gz (30.6 kB view hashes)

Uploaded Source

Built Distribution

migas-0.1.1-py3-none-any.whl (14.4 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