Etelemetry python client API
Project description
Etelemetry-client
A lightweight python client to communicate with the etelemetry server
Installation
pip install etelemetry
Usage
import etelemetry
etelemetry.get_project("nipy/nipype")
{'version': '1.4.2', 'bad_versions': ['1.2.1', '1.2.3', '1.3.0']}
or to take advantage of comparing and checking for bad versions, you can use the following form
import etelemetry
etelemetry.check_available_version("nipy/nipype", "1.2.1") # github_org/project
A newer version (1.4.2) of nipy/nipype is available. You are using 1.2.1
You are using a version of nipy/nipype with a critical bug. Please use a different version.
returns: {'version': '1.4.2', 'bad_versions': ['1.2.1', '1.2.3', '1.3.0']}
Adding etelemetry to your project
You can include etelemetry in your project by adding etelemetry
package to your setup process
and by adding the following snippet to your __init__.py
. The code snippet below assumes you
have a __version__
and usemylogger
(logger) variables available. The check takes the form
of github_org/project
.
# Run telemetry on import for interactive sessions, such as IPython, Jupyter
# notebooks, Python REPL
import __main__
if not hasattr(__main__, "__file__"):
import etelemetry
etelemetry.check_available_version("dandi/dandi-cli", __version__, lgr=usemylogger)
To add support checking for bad versions you will need to add a file named
.et
to your github project containing a simple json snippet.
{ "bad_versions" : []
}
Here is an example: https://github.com/nipy/nipype/blob/master/.et
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file etelemetry-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: etelemetry-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78febd59a22eb53d052d731f10f24139eb2854fd237348fba683dd8616fb4a67 |
|
MD5 | 6abaac3222f16eb67778676fcd552de8 |
|
BLAKE2b-256 | 8b1ba13fd41742cf2ed2498e90e5cdb27239e1115a788114aed0625dbf16737c |