{"id":16428440,"url":"https://github.com/pliablepixels/pyzmutils","last_synced_at":"2025-10-15T05:30:04.646Z","repository":{"id":143490149,"uuid":"196874989","full_name":"pliablepixels/pyzmutils","owner":"pliablepixels","description":"ZoneMinder logging and utility modules for Python Projects","archived":false,"fork":false,"pushed_at":"2019-07-26T15:50:22.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-30T14:05:05.084Z","etag":null,"topics":["python","python3","zoneminder"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pliablepixels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-14T19:25:16.000Z","updated_at":"2022-11-01T13:13:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8b9fac9-a733-4a46-aa97-72bc15538fd5","html_url":"https://github.com/pliablepixels/pyzmutils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pliablepixels/pyzmutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pliablepixels%2Fpyzmutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pliablepixels%2Fpyzmutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pliablepixels%2Fpyzmutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pliablepixels%2Fpyzmutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pliablepixels","download_url":"https://codeload.github.com/pliablepixels/pyzmutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pliablepixels%2Fpyzmutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279054482,"owners_count":26094340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","python3","zoneminder"],"created_at":"2024-10-11T08:16:44.116Z","updated_at":"2025-10-15T05:30:04.621Z","avatar_url":"https://github.com/pliablepixels.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## This module is deprecated in favor of \u003ca href='https://github.com/pliablepixels/pyzm'\u003epyzm\u003c/a\u003e\n\n### What\n\nPython utilities for ZoneMinder projects\n\n### Limitations\n* Only for Python3\n* Basic support for now\n\nCurrent modules:\n* Logger\n\n### Usage\n\n#### Basic\n```python\nimport pyzmutils.logger as zmlog\n\nlogger = zmlog.ZMLogger()\n# You can also specify a module name and a conf path manually\n# if you don'y specify a module name, then the process name is taken\n# logger = zmlog.ZMLogger(name='mymodule', conf='/etc/zm')\n\nlogger.Warning('This is a Warning')\nlogger.Info('This is an Info')\nlogger.Debug(1,'This is a Debug 1')\nlogger.Debug(3,'This is a Debug 3')\nlogger.Fatal('This is a Fatal message, and we will quit')\nlogger.close()\n```\n\n#### Advanced\n\nYou can customize the constructor like so:\n\n```python\n\nimport pyzmutils.logger as zmlog\noverrides = {\n  'conf_path':'/my/special/zm/config/path', # default is /etc/zm\n  'driver': 'mysql+pymysql', # default is mysql+mysqldb see https://docs.sqlalchemy.org/en/13/dialects/mysql.html\n}\nlogger = zmlog.ZMLogger(name='myapp', overrides=overrides)\n```\n\nBasically, overrides will override values this module retrieves from the conf of ZM DB. Keys available to override:\n\n```\n  'conf_path': '/etc/zm',\n  'user' : None,\n  'password' : None,\n  'host' : None,\n  'webuser': None,\n  'webgroup': None,\n  'dbname' : None,\n  'logpath' : None,\n  'log_level_syslog' : None,\n  'log_level_file' : None,\n  'log_level_db' : None,\n  'log_debug' : None,\n  'log_level_debug' : None,\n  'log_debug_target' : None,\n  'log_debug_file' :None,\n  'server_id': None,\n  'driver': 'mysql+mysqlconnector'\n```\n\nSo for example, let's suppose ZM has DB logging enabled, but you want to turn it off for this model. Also, ZM uses syslog as INFO but you want DEBUG3 for this module:\n\nyou'd do:\n\n```python\n\nimport pyzmutils.logger as zmlog\n\noverrides = {\n  'log_level_db': -5, # -5 is 'OFF' in ZM\n  'log_level_syslog': 1, # 1 is 'DBG' in ZM\n  'log_level_debug': 3,\n  'log_debug_target': 'myapp'\n}\nlogger = zmlog.ZMLogger(name='myapp', overrides=overrides)\nprint (logger.get_config())\nlogger.Warning('This is a Warning')\nlogger.Info('This is an Info')\nlogger.Debug(1,'This is a Debug 1')\nlogger.Debug(3,'This is a Debug 3')\n#logger.Fatal('This is a Fatal message, and we will quit')\nlogger.close()\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpliablepixels%2Fpyzmutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpliablepixels%2Fpyzmutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpliablepixels%2Fpyzmutils/lists"}