Skip to main content

Python package to deliver a Gantner cloud interface

Project description

gimodules-python

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/

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

To build the documentation, run the following command:

cd docs
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])

TODO

  1. lint.sh diff between black and flake8 etc
  2. Usage with python 3.12
  3. Doc requirements

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.2.0.tar.gz (36.2 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.2.0-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gimodules-0.2.0.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for gimodules-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dc9620976ee3def20d4762956337320e3d3352af2d25f55454c8bc2656087980
MD5 5cd1688ce87fcfed1b9fc9a9b7124c9b
BLAKE2b-256 c899817f3e0f0050fe6c600c9e86892ea9b5a9b618183e942c57afabc4f7f948

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gimodules-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for gimodules-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd62107dd715ea3d984e2eb82f11d32330e361c1bdd4779ec8ef2a73d7e5e26a
MD5 5466fbb05e7500d76ed128bbda4485b5
BLAKE2b-256 244f4badba1c7172b2167408f2a264e202b4a46fa37284c617b9a942bc45dd79

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