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.20.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

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

pyinim-0.0.20-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyinim-0.0.20.tar.gz
Algorithm Hash digest
SHA256 27f5c3aef7ed94dbfca6b619145d17b00bd97885cd1b616aeae8fb3182a11fe6
MD5 c37edf4d91dfb72f031aa410c3477a58
BLAKE2b-256 5599c317934a783a1043a26445b9180a4c14fa9f87533ce9fec7b34c01b6a986

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyinim-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyinim-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 87d315e8ca3898134f78787b62ad5246e21bd917bdfeca127c6e438a22085097
MD5 10954a58250ed079976f4a10cbc48011
BLAKE2b-256 a4ad4e8babb963d9705cc1aa8e06657b3951558d6a8db0921d5519a0f7cd990b

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