Python package providing an interface to the Gantner Instruments Cloud API
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/
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gimodules-0.3.0.tar.gz.
File metadata
- Download URL: gimodules-0.3.0.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1473102c4ca0ef0163b10ec9392ba6dd9c106c76bec63efcf3cfa9037ffd8876
|
|
| MD5 |
039fcac0adbf5d18d21fd3c331dd8495
|
|
| BLAKE2b-256 |
c0f19ab66b442d565c335556d1266bcf4bf399bf49cc32f8c232cccccadcd534
|
File details
Details for the file gimodules-0.3.0-py3-none-any.whl.
File metadata
- Download URL: gimodules-0.3.0-py3-none-any.whl
- Upload date:
- Size: 40.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c32df23cc30fbab9614e9eae8d38b6a1f3c7c5d7a4ff7fe018359b7d069d4b8c
|
|
| MD5 |
02547618d9beddf8a46600822a150a89
|
|
| BLAKE2b-256 |
b7b897ba458ffca7a1aafc64ed0c1332b7aec8170cca96412992595f8f48fd40
|