Skip to main content

A Inim Cloud API client

Project description

Library Documentation

Simple API that provides "easy" access to INIM web services

Usage

python3 -m venv venv
source venv/bin/activate.fish
python3 -m pip install aiohttp==3.9.5
# python3 -m pip install python-dotenv==1.0.1

# deprecated:
#python3 -m pip install --index-url https://test.pypi.org/simple/ pyinim-nidble==0.0.x
# python3 -m pip uninstall pyinim-nidble

python3 -m pip install pyinim==0.0.x
python3 -m pip uninstall pyinim

Development

Environment preparation

python3 -m pip install pipenv
pipenv install --dev #this generate Pipfile.lock

Running

export PYTHONPATH="${PYTHONPATH}:$PWD" # or set --export PYTHONPATH ./src
pipenv run python src/pyinim/examples/poc.py

Adding new lib

pipenv install python-dotenv

Building the package

Environment preparation

pip3 install --upgrade setuptools

# NO:
pip install --upgrade build
# Yes:
python3 -m pip install build # see https://stackoverflow.com/questions/73987135/python3-m-build-gives-modulenotfounderror-no-module-named-pathlib2

Publishing Pipenv way

pipenv run pip install --upgrade build
pipenv run python -m build --wheel

Publishing Classical way

pip install --upgrade build
python -m build --wheel # for only wheel (this not produce tarball)
python3 -m build # for wheel and tarball

Publishing

ref

python3 -m pip install --upgrade twine
python3 -m twine upload --repository testpypi dist/*

Publishing & Publishing

rm -rf ./dist && python3 -m build && python3 -m twine upload --repository testpypi dist/*

Some useful resources

Disclaimer

Pyinim is an unofficial module for achieving interoperability with Inim RESTful API.

Author is in no way affiliated with Inim.

All the api requests used within the library are available and published on the internet (examples linked above) and this module is purely just a wrapper around those https requests.

Author does not guarantee functionality of this library and is not responsible for any damage.

All product names, trademarks and registered trademarks in this repository, are property of their respective owners.

Inim CLI

You can use this small script to interact with your InimAlarm and list various components.

Install the CLI

git clone https://github.com/nidble/pyinim
cd pyinim
python3 -m pip install pipenv
pipenv install --dev
export PYTHONPATH="${PYTHONPATH}:$PWD/src" # or set --export PYTHONPATH ./src
pipenv run python tools/inim_cli.py

Read the Help for the usage:

❯ pipenv run python tools/inim_cli.py --help
usage: inim_cli.py [-h] [--username USERNAME] [--password PASSWORD] [--client_id CLIENT_ID] --list {deviceid,areas,scenarios} [--deviceid DEVICEID] [--dump filename]

options:
  -h, --help            show this help message and exit
  --username USERNAME   Inim User Name
  --password PASSWORD   Inim Password
  --client_id CLIENT_ID
                        Inim Client ID
  --list {deviceid,areas,scenarios}
                        Specify whether to list 'deviceid', 'areas', or 'scenarios'
  --deviceid DEVICEID   Optional device ID to filter results for 'areas' and 'scenarios'
  --dump filename       Dump the raw JSON response to the specified file

Discover your devices ID

pipenv run python tools/inim_cli.py --username <YOUR_INIM_USERNAME> --password <YOUR_INIM_PASSWORD> --list deviceid

Discover your Areas ID

pipenv run python tools/inim_cli.py --username <YOUR_INIM_USERNAME> --password <YOUR_INIM_PASSWORD> --list areas

Discover your Scenarios ID

pipenv run python tools/inim_cli.py --username <YOUR_INIM_USERNAME> --password <YOUR_INIM_PASSWORD> --list scenarios

TroubleShooting Info and Debug

To debug your Alarm you can dump the status via --dump

pipenv run python tools/inim_cli.py --username <YOUR_INIM_USERNAME> --password <YOUR_INIM_PASSWORD> --dump=debug.json

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

pyinim-0.0.19.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

pyinim-0.0.19-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file pyinim-0.0.19.tar.gz.

File metadata

  • Download URL: pyinim-0.0.19.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for pyinim-0.0.19.tar.gz
Algorithm Hash digest
SHA256 5923571176042d9d32158bf28dae340bb7d6f9dc6c4608e3488b7ea961bdb3ff
MD5 aa2aa08b6238e5c0d9532ba9ecdebf54
BLAKE2b-256 e193e47c7595828cca2499f21a322bd34fcb7ca6be9888ba9c3b4137fd832104

See more details on using hashes here.

File details

Details for the file pyinim-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: pyinim-0.0.19-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for pyinim-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 da6115611e72510395735ac3d8ce1a9e1a9925d9019dcd966be7d4d98f201bda
MD5 da578e7cf6b142b83f67fca0f9afed36
BLAKE2b-256 a2758f8afcdf33ca5a63f8a9659d1050f5df2e675cdfff90dbb14ef3e92b3cbf

See more details on using hashes here.

Supported by

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