{"id":19922452,"url":"https://github.com/furkanonder/objerve","last_synced_at":"2025-05-03T07:30:44.642Z","repository":{"id":36954637,"uuid":"503514409","full_name":"furkanonder/objerve","owner":"furkanonder","description":"A tiny observer for the attributes of Python objects.","archived":false,"fork":false,"pushed_at":"2022-09-10T14:23:54.000Z","size":179,"stargazers_count":34,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T13:04:07.289Z","etag":null,"topics":["hook","observer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/furkanonder.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}},"created_at":"2022-06-14T20:43:02.000Z","updated_at":"2025-03-29T08:46:09.000Z","dependencies_parsed_at":"2022-07-12T20:50:50.548Z","dependency_job_id":null,"html_url":"https://github.com/furkanonder/objerve","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanonder%2Fobjerve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanonder%2Fobjerve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanonder%2Fobjerve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanonder%2Fobjerve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furkanonder","download_url":"https://codeload.github.com/furkanonder/objerve/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252156744,"owners_count":21703344,"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","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":["hook","observer"],"created_at":"2024-11-12T22:11:02.328Z","updated_at":"2025-05-03T07:30:44.316Z","avatar_url":"https://github.com/furkanonder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/furkanonder/objerve/blob/develop/assets/logo/objerve.png\" width=300px /\u003e\n  \u003ch2\u003eobjerve\u003c/h2\u003e\n  \u003ch3\u003eA tiny observer for the attributes of Python objects.\u003c/h3\u003e\n  \u003ca href=\"https://github.com/furkanonder/objerve/actions\"\u003e\u003cimg alt=\"Actions Status\" src=\"https://github.com/furkanonder/objerve/workflows/Test/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/furkanonder/objerve/issues\"\u003e\u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/furkanonder/objerve\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/furkanonder/objerve/stargazers\"\u003e\u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/furkanonder/objerve\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/furkanonder/objerve/blob/main/LICENSE\"\u003e\u003cimg alt=\"GitHub license\" src=\"https://img.shields.io/github/license/furkanonder/objerve\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pepy.tech/project/objerve\"\u003e\u003cimg alt=\"Downloads\" src=\"https://pepy.tech/badge/objerve\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## Installation\n\n_objerve_ can be installed by running `pip install objerve`\n\n## Example Usage\n\nLet's say you have a class like that;\n\n```python\nclass M:\n    qux = \"blue\"\n\n    def __init__(self):\n        self.bar = 55\n        self.foo = 89\n        self.baz = 121\n```\n\nTo watch the changes, you need the add the `@watch()` as a class decorator. Within the\narguments of the `watch` decorator you should pass in lists for the keyword arguments of\nthe attributes you wish to watch.\n\n```python\nfrom objerve import watch\n\n@watch(set={\"foo\", \"qux\"}, get={\"bar\", \"foo\"}, delete={\"baz\"})\nclass M:\n    qux = \"blue\"\n\n    def __init__(self):\n        self.bar = 55\n        self.foo = 89\n        self.baz = 121\n\n\nm = M()\nm.bar = 233\n\n\ndef abc():\n    m.foo += 10\n\n\nm.qux = \"red\"\n\n\ndef get_foo(m):\n    m.bar\n\n\nabc()\nm.foo\ndel m.baz\nget_foo(m)\n```\n\nOutput:\n\n```sh\nSet | foo = 89\n  File \"/home/blue/objerve/examples/example.py\", line 9, in __init__\n    self.foo = 89\n\nSet | qux = red\n  File \"/home/blue/objerve/examples/example.py\", line 21, in \u003cmodule\u003e\n    m.qux = \"red\"\n\nGet | foo\n  File \"/home/blue/objerve/examples/example.py\", line 18, in abc\n    m.foo += 10\n\nSet | foo = 99\n  File \"/home/blue/objerve/examples/example.py\", line 18, in abc\n    m.foo += 10\n\nGet | foo\n  File \"/home/blue/objerve/examples/example.py\", line 29, in \u003cmodule\u003e\n    m.foo\n\nDelete | baz\n  File \"/home/blue/objerve/examples/example.py\", line 30, in \u003cmodule\u003e\n    del m.baz\n\nGet | bar\n  File \"/home/blue/objerve/examples/example.py\", line 25, in get_foo\n    m.bar\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkanonder%2Fobjerve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurkanonder%2Fobjerve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkanonder%2Fobjerve/lists"}