Skip to main content

DEPRECATED (EOL): Use pygidata. Python package providing an interface to the Gantner Instruments Cloud API

Project description

gimodules-python

[!WARNING]

End of Life (EOL): This package is deprecated and no longer actively developed.

Please migrate to pygidata, which is the maintained successor.

Deprecation Notice

  • gimodules is in maintenance-only / end-of-life state.

  • New features will be added to pygidata only.

  • For new projects, use pygidata directly.

Usage

Install from PyPi

pip install gimodules

Import module in python script and call functions.

A detailed description of the package and other APIs can be found in the Gantner Documentation.

from gimodules.cloudconnect.cloud_request import CloudRequest



cloud = CloudRequest()

cloud.login(url='https://example.gi-cloud.io', access_token='TOKEN') # Create a token under Tools -> Monitor

cloud.get_all_stream_metadata()

Development

Information on how to manually distribute this package can be found here

https://packaging.python.org/en/latest/tutorials/packaging-projects/

Hint: If you are debugging the source code with a jupyter notebook, run this code in the first cell to enable autoreloading source code changes.

%load_ext autoreload

%autoreload 2

Distribute with CI / CD

Edit setup.py version number and create a release.

-> Creating a release will trigger the workflow to push the package to PyPi

Tests

run tests locally:

pipenv run test -v

or

pytest

Requirements

When starting to develop you can install the requirements with:

pip install -r requirements.txt

When you add new components and the requirements change,

you can find out what packages are needed by the project and create new requirements:

pipreqs .

To create project all current packages installed in your venv for requirements automatically:

pip3 freeze > requirements.txt

NOTE: Remove the old gimodules version from requirements.txt before pushing (dependency conflict).


Documentation

The documentation is being built as extern script in the GI.Sphinx repository.

The documentation consists of partially generated content.

To generate .rst files from the code package, run the following command from the root directory of the project:

sphinx-apidoc -o docs/source/ gimodules

You need pandoc installed on the system itself first to build:

sudo apt install pandoc

Then, to build the documentation, run the following commands:

cd docs

sudo apt update

pip install -r requirements.txt

make html

Linting / Type hints

This project follows the codestyle PEP8 and uses the linter flake8 (with line length = 100).

You can format and check the code using lint.sh:

./lint.sh [directory/]

Type hints are highly recommended.

Type hints in Python specify the expected data types of variables,

function arguments, and return values, improving code readability,

catching errors early, and aiding in IDE autocompletion.

To include type hints in the check:

mpypy=true ./lint.sh [directory])

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

gimodules-0.3.1.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gimodules-0.3.1-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file gimodules-0.3.1.tar.gz.

File metadata

  • Download URL: gimodules-0.3.1.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for gimodules-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0ce000fa6da4698edbbb6f1b90a2a8485043337815bf2e6e190a3d52486b90e4
MD5 bae8e90491493dc1fad99f4e44dcc27c
BLAKE2b-256 637f3f71cd77be39e45f3a46b92601c35abbf5c90c2dc4e5a54332eac1b035d4

See more details on using hashes here.

File details

Details for the file gimodules-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: gimodules-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for gimodules-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63d284ee2eb715b6ed8efd95eaa281e5971cb66e88a68152d0cdda461e8e206f
MD5 13a161a55ce90a53f34de61175db390b
BLAKE2b-256 a392d1d3825c7d2d2668ec6de5274c5999562eb777c7f2bdf8a97f2ff64d3c01

See more details on using hashes here.

Supported by

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