===========================================================
pyimaprotect - Python `IMA Protect Alarm`_ *UNOFFICIAL*
===========================================================
.. image:: https://img.shields.io/pypi/v/pyimaprotect.svg
:target: https://pypi.python.org/pypi/pyimaprotect
.. image:: https://img.shields.io/pypi/pyversions/pyimaprotect.svg
:target: https://pypi.python.org/pypi/pyimaprotect
.. image:: https://img.shields.io/travis/pcourbin/pyimaprotect.svg
:target: https://travis-ci.com/pcourbin/pyimaprotect
.. image:: https://readthedocs.org/projects/pyimaprotect/badge/?version=latest
:target: https://pyimaprotect.readthedocs.io/en/latest/?version=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/pcourbin/pyimaprotect/shield.svg
:target: https://pyup.io/repos/github/pcourbin/pyimaprotect/
:alt: Updates
.. image:: https://codecov.io/gh/pcourbin/pyimaprotect/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pcourbin/pyimaprotect
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen
:target: `pre-commit`_
:alt: pre-commit
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: `black`_
:alt: Black
.. image:: https://img.shields.io/badge/maintainer-%40pcourbin-blue.svg
:target: `user_profile`_
:alt: Project Maintenance
.. image:: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg
:target: `buymecoffee`_
:alt: BuyMeCoffee
| Get and set alarm status from your `IMA Protect Alarm`_.
| You can get and set the status, get the list of contacts and download your images.
This work is originally developed for use with `Home Assistant`_ and the *custom component* `imaprotect`_.
* Free software: MIT license
* Documentation: https://pyimaprotect.readthedocs.io.
Features
--------
Since the last update of IMAProtect "API" (05/2021), this plugin allows you to:
- **get the status** of your alarm:
.. code-block:: python
from pyimaprotect import IMAProtect, STATUS_NUM_TO_TEXT
ima = IMAProtect('myusername','mysuperpassword')
print("# Get Status")
imastatus = ima.status
print("Current Alarm Status: %d (%s)" % (imastatus,STATUS_NUM_TO_TEXT[imastatus]))
- **set the status** of your alarm:
.. code-block:: python
from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')
print("# Set Status")
ima.status = 0 # 0 to OFF, 1 to PARTIAL and 2 to On
- **get** the list and information of your **registered contacts**:
.. code-block:: python
from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')
print("# Get Contact List")
contact_list = ima.get_contact_list()
for contact in contact_list:
print(contact)
- **download the images/photos** taken with your connected elements:
.. code-block:: python
from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')
print("# Download Images")
ima.download_images() # Download images to 'Images/' folder. One subfolder per camera.
ima.download_images("MyImages/") # Download images to a defined directory 'MyImages/' folder.
Parameters
==========
- `username`: Username used to connect to https://www.imaprotect.com/
- `password`: Password used to connect to https://www.imaprotect.com/
Methods
=======
- `login()`: open a session with the IMA Protect Alarm website
- `logout()`: close the session with the IMA Protect Alarm website
- `status`: property to get or set the status of your IMA Protect Alarm. See the next table to understand the values.
- `get_contact_list()`: get a JSON with the list and information about your registered contacts.
- `download_images()`: download the images/photos taken with your connected elements.
.. list-table:: List of Alarm status values
:widths: auto
:header-rows: 1
* - Alarm Value
- State
* - `-1`
- `UNKNOWN`
* - `0`
- `OFF`
* - `1`
- `PARTIAL`
* - `2`
- `ON`
Credits
-------
| This work was based on the work of `lplancke`_ and `chris94440`_ for `Jeedom`_.
| This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
.. _`IMA Protect Alarm`: https://www.imaprotect.com/
.. _`Home Assistant`: https://www.home-assistant.io/
.. _`imaprotect`: https://github.com/pcourbin/imaprotect
.. _`lplancke`: https://github.com/lplancke/jeedom_alarme_IMA
.. _`Jeedom`: https://www.jeedom.com
.. _`chris94440`: https://github.com/chris94440
.. _`pre-commit`: https://github.com/pre-commit/pre-commit
.. _`black`: https://github.com/psf/black
.. _`user_profile`: https://github.com/pcourbin
.. _`buymecoffee`: https://www.buymeacoffee.com/pcourbin
=======
History
=======
3.1.6 (2024-03-31)
------------------
* Update RE_ALARM_TOKEN since IMA Protect login page changed again..., thanks to `@Chrilk`_
3.1.5 (2023-02-18)
------------------
* Update login procedure according to new IMAProtect "API", thanks to `@Thesola10`_
3.1.2 (2021-11-05)
------------------
* Update login procedure according to new IMAProtect "API"
* Update download images procedure according to new IMAProtect "API"
3.1.0 (2021-05-22)
------------------
* Add cookie expire usage to reduce the number of login
* Add a logout function
3.0.0 (2021-05-22)
------------------
* Add option to change the alarm (set/get)
* Add function to get the list of contacts
* Add function to download the images
`get_status` has been removed, `status` is now a property to get/set the alarm.
2.0.0 (2021-05-09)
------------------
* Update using new IMAProtect "API"
* No more other info (name, contract, etc.), only alarm status but faster result.
1.0.0 (2021-04-11)
------------------
* First release on PyPI.
.. _`@Thesola10`: https://github.com/Thesola10
.. _`@Chrilk`: https://github.com/Chrilk
Raw data
{
"_id": null,
"home_page": "https://github.com/pcourbin/pyimaprotect",
"name": "pyimaprotect",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": null,
"keywords": "pyimaprotect",
"author": "Pierre COURBIN",
"author_email": "pierre.courbin@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b6/0a/f7bca53f93d50e8931762e3fd0aae632d118327d3255308fe76731671e44/pyimaprotect-3.1.6.tar.gz",
"platform": null,
"description": "===========================================================\npyimaprotect - Python `IMA Protect Alarm`_ *UNOFFICIAL*\n===========================================================\n\n\n.. image:: https://img.shields.io/pypi/v/pyimaprotect.svg\n :target: https://pypi.python.org/pypi/pyimaprotect\n\n.. image:: https://img.shields.io/pypi/pyversions/pyimaprotect.svg\n :target: https://pypi.python.org/pypi/pyimaprotect\n\n.. image:: https://img.shields.io/travis/pcourbin/pyimaprotect.svg\n :target: https://travis-ci.com/pcourbin/pyimaprotect\n\n.. image:: https://readthedocs.org/projects/pyimaprotect/badge/?version=latest\n :target: https://pyimaprotect.readthedocs.io/en/latest/?version=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/pcourbin/pyimaprotect/shield.svg\n :target: https://pyup.io/repos/github/pcourbin/pyimaprotect/\n :alt: Updates\n\n.. image:: https://codecov.io/gh/pcourbin/pyimaprotect/branch/main/graph/badge.svg\n :target: https://codecov.io/gh/pcourbin/pyimaprotect\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen\n :target: `pre-commit`_\n :alt: pre-commit\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: `black`_\n :alt: Black\n\n.. image:: https://img.shields.io/badge/maintainer-%40pcourbin-blue.svg\n :target: `user_profile`_\n :alt: Project Maintenance\n\n.. image:: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg\n :target: `buymecoffee`_\n :alt: BuyMeCoffee\n\n\n| Get and set alarm status from your `IMA Protect Alarm`_.\n| You can get and set the status, get the list of contacts and download your images.\n\nThis work is originally developed for use with `Home Assistant`_ and the *custom component* `imaprotect`_.\n\n\n* Free software: MIT license\n* Documentation: https://pyimaprotect.readthedocs.io.\n\nFeatures\n--------\n\nSince the last update of IMAProtect \"API\" (05/2021), this plugin allows you to:\n\n- **get the status** of your alarm:\n\n.. code-block:: python\n\n from pyimaprotect import IMAProtect, STATUS_NUM_TO_TEXT\n ima = IMAProtect('myusername','mysuperpassword')\n\n print(\"# Get Status\")\n imastatus = ima.status\n print(\"Current Alarm Status: %d (%s)\" % (imastatus,STATUS_NUM_TO_TEXT[imastatus]))\n\n- **set the status** of your alarm:\n\n.. code-block:: python\n\n from pyimaprotect import IMAProtect\n ima = IMAProtect('myusername','mysuperpassword')\n\n print(\"# Set Status\")\n ima.status = 0 # 0 to OFF, 1 to PARTIAL and 2 to On\n\n\n- **get** the list and information of your **registered contacts**:\n\n.. code-block:: python\n\n from pyimaprotect import IMAProtect\n ima = IMAProtect('myusername','mysuperpassword')\n\n print(\"# Get Contact List\")\n contact_list = ima.get_contact_list()\n for contact in contact_list:\n print(contact)\n\n- **download the images/photos** taken with your connected elements:\n\n.. code-block:: python\n\n from pyimaprotect import IMAProtect\n ima = IMAProtect('myusername','mysuperpassword')\n\n print(\"# Download Images\")\n ima.download_images() # Download images to 'Images/' folder. One subfolder per camera.\n ima.download_images(\"MyImages/\") # Download images to a defined directory 'MyImages/' folder.\n\nParameters\n==========\n\n- `username`: Username used to connect to https://www.imaprotect.com/\n- `password`: Password used to connect to https://www.imaprotect.com/\n\nMethods\n=======\n\n- `login()`: open a session with the IMA Protect Alarm website\n- `logout()`: close the session with the IMA Protect Alarm website\n- `status`: property to get or set the status of your IMA Protect Alarm. See the next table to understand the values.\n- `get_contact_list()`: get a JSON with the list and information about your registered contacts.\n- `download_images()`: download the images/photos taken with your connected elements.\n\n.. list-table:: List of Alarm status values\n :widths: auto\n :header-rows: 1\n\n * - Alarm Value\n - State\n * - `-1`\n - `UNKNOWN`\n * - `0`\n - `OFF`\n * - `1`\n - `PARTIAL`\n * - `2`\n - `ON`\n\n\n\nCredits\n-------\n\n| This work was based on the work of `lplancke`_ and `chris94440`_ for `Jeedom`_.\n| This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _`IMA Protect Alarm`: https://www.imaprotect.com/\n.. _`Home Assistant`: https://www.home-assistant.io/\n.. _`imaprotect`: https://github.com/pcourbin/imaprotect\n.. _`lplancke`: https://github.com/lplancke/jeedom_alarme_IMA\n.. _`Jeedom`: https://www.jeedom.com\n.. _`chris94440`: https://github.com/chris94440\n.. _`pre-commit`: https://github.com/pre-commit/pre-commit\n.. _`black`: https://github.com/psf/black\n.. _`user_profile`: https://github.com/pcourbin\n.. _`buymecoffee`: https://www.buymeacoffee.com/pcourbin\n\n\n=======\nHistory\n=======\n\n3.1.6 (2024-03-31)\n------------------\n* Update RE_ALARM_TOKEN since IMA Protect login page changed again..., thanks to `@Chrilk`_\n\n\n3.1.5 (2023-02-18)\n------------------\n* Update login procedure according to new IMAProtect \"API\", thanks to `@Thesola10`_\n\n3.1.2 (2021-11-05)\n------------------\n* Update login procedure according to new IMAProtect \"API\"\n* Update download images procedure according to new IMAProtect \"API\"\n\n3.1.0 (2021-05-22)\n------------------\n* Add cookie expire usage to reduce the number of login\n* Add a logout function\n\n3.0.0 (2021-05-22)\n------------------\n\n* Add option to change the alarm (set/get)\n* Add function to get the list of contacts\n* Add function to download the images\n\n`get_status` has been removed, `status` is now a property to get/set the alarm.\n\n2.0.0 (2021-05-09)\n------------------\n\n* Update using new IMAProtect \"API\"\n* No more other info (name, contract, etc.), only alarm status but faster result.\n\n1.0.0 (2021-04-11)\n------------------\n\n* First release on PyPI.\n\n\n\n.. _`@Thesola10`: https://github.com/Thesola10\n\n.. _`@Chrilk`: https://github.com/Chrilk\n\n\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Get alarm status and informations from the IMA Protect API.",
"version": "3.1.6",
"project_urls": {
"Homepage": "https://github.com/pcourbin/pyimaprotect"
},
"split_keywords": [
"pyimaprotect"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e4c6afcb2ad3f1ff6aa2db959683e228481482ea7586af9cbc2fcd4986b14b35",
"md5": "2a476b1de4118fe4d619e8abb6281362",
"sha256": "a6dfc879814df4cd5760154bbfd36b01c4afab25c00864eb03843b870560737f"
},
"downloads": -1,
"filename": "pyimaprotect-3.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2a476b1de4118fe4d619e8abb6281362",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 7603,
"upload_time": "2024-03-31T12:37:24",
"upload_time_iso_8601": "2024-03-31T12:37:24.012677Z",
"url": "https://files.pythonhosted.org/packages/e4/c6/afcb2ad3f1ff6aa2db959683e228481482ea7586af9cbc2fcd4986b14b35/pyimaprotect-3.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b60af7bca53f93d50e8931762e3fd0aae632d118327d3255308fe76731671e44",
"md5": "291100386c46775bc18785ba28e59d51",
"sha256": "f0c2f1395e551a45aa7e8f74d112358ad7312256778afbaa500d0c20f42afdd3"
},
"downloads": -1,
"filename": "pyimaprotect-3.1.6.tar.gz",
"has_sig": false,
"md5_digest": "291100386c46775bc18785ba28e59d51",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 15433,
"upload_time": "2024-03-31T12:37:25",
"upload_time_iso_8601": "2024-03-31T12:37:25.940068Z",
"url": "https://files.pythonhosted.org/packages/b6/0a/f7bca53f93d50e8931762e3fd0aae632d118327d3255308fe76731671e44/pyimaprotect-3.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-31 12:37:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pcourbin",
"github_project": "pyimaprotect",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "pyimaprotect"
}