pyzm: a python wrapper (leverages 1.34 features)

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
User avatar
asker
Posts: 1261
Joined: Sun Mar 01, 2015 12:12 pm

pyzm: a python wrapper (leverages 1.34 features)

Post by asker » Sat Jan 18, 2020 5:22 am

Hi folks,
The mainline ZM API docs have been updated to point to pyzm, a python module that provides access to:
  • ZM 1.34's new token system
  • ZM's shared memory (for real time monitor state access)
  • ZM's logging function
  • ZM's APIs
  • The Event Server
The goal is to do what ZM's perl modules do for Python (Memory/Logger/SHM) and more (APIs and Event Server access). There is proper documentation as well including a working example


I would strongly recommend 3rd party users to start using pyzm instead of their own legacy wrappers as it offers better integration, more secure access to ZM (tokens) and will be maintained. It's an early release, so I'd welcome PRs/contributions.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

User avatar
snake
Posts: 333
Joined: Sat May 21, 2016 2:20 am

Re: pyzm: a python wrapper (leverages 1.34 features)

Post by snake » Tue Jan 21, 2020 6:44 pm

asker wrote:
Sat Jan 18, 2020 5:22 am
I would strongly recommend 3rd party users to start using pyzm instead of their own legacy wrappers as it offers better integration, more secure access to ZM (tokens) and will be maintained. It's an early release, so I'd welcome PRs/contributions.
Good to hear there will be more options, but I have some hardware which uses ZMTrigger, so hopefully there isn't a master plan to deprecate old functionality, just because it's old. I'd like to see backwards compatibility kept for old stuff. Well, maybe not backwards compatibility, but just don't remove zmtrigger, or X10... Those are optional by default, and 'just work' in a private LAN.

User avatar
asker
Posts: 1261
Joined: Sun Mar 01, 2015 12:12 pm

Re: pyzm: a python wrapper (leverages 1.34 features)

Post by asker » Wed Jan 22, 2020 1:09 am

Absolutely no plans to retire. These are wrappers so they will wrap around core ZM functionality (triggers are core). A good example of who may use this is Home Assistant. After 1.33 change login their plugin broke and we started receiving help requests on this issue.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

ruffledrooster
Posts: 4
Joined: Mon Mar 06, 2017 6:20 pm

Re: pyzm: a python wrapper (leverages 1.34 features)

Post by ruffledrooster » Thu Mar 26, 2020 1:42 pm

Not sure if this is the right place to do this or not but I couldn't find any other area that seemed more fitting. First off, I have done some testing and using this python module is awesome! Have used python now for a few years and this module makes it so much easier to connect to my zm instances and get the data that I need without having to comb through a bunch of json. Had a few questions in regards to the module though...is there a way to ignore SSL verification? I am still using self-signed certs on a few of my servers and in looking through the source code, it seems like you are basically doing the same thing I was doing before this module came about...using the requests module and sessions. Changing it to ignore ssl verification is quite simple, just add verify=False to each of the requests calls. Anyways, wasn't sure if that was something that was available or maybe a future 'feature'? :wink: Secondly, I have no second question because I answered it as I was typing the first. Thank you in advance.

User avatar
asker
Posts: 1261
Joined: Sun Mar 01, 2015 12:12 pm

Re: pyzm: a python wrapper (leverages 1.34 features)

Post by asker » Thu Mar 26, 2020 2:13 pm

ruffledrooster wrote:
Thu Mar 26, 2020 1:42 pm
Not sure if this is the right place to do this or not but I couldn't find any other area that seemed more fitting. First off, I have done some testing and using this python module is awesome! Have used python now for a few years and this module makes it so much easier to connect to my zm instances and get the data that I need without having to comb through a bunch of json. Had a few questions in regards to the module though...is there a way to ignore SSL verification? I am still using self-signed certs on a few of my servers and in looking through the source code, it seems like you are basically doing the same thing I was doing before this module came about...using the requests module and sessions. Changing it to ignore ssl verification is quite simple, just add verify=False to each of the requests calls. Anyways, wasn't sure if that was something that was available or maybe a future 'feature'? :wink: Secondly, I have no second question because I answered it as I was typing the first. Thank you in advance.
I just updated pyzm to 0.1.9 - when you initialize the APIs, I've added a new attribute called "disable_ssl_cert_check" if True will do what you want.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

ruffledrooster
Posts: 4
Joined: Mon Mar 06, 2017 6:20 pm

Re: pyzm: a python wrapper (leverages 1.34 features)

Post by ruffledrooster » Thu Mar 26, 2020 7:20 pm

Just updated to 0.1.9 and it works perfectly. Thank you again for the prompt response, greatly appreciated.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests