{"id":20872382,"url":"https://github.com/romnn/classprop","last_synced_at":"2025-05-12T13:33:39.121Z","repository":{"id":50173789,"uuid":"247103748","full_name":"romnn/classprop","owner":"romnn","description":"@classproperty decorator for python that works just like @property.","archived":false,"fork":false,"pushed_at":"2022-12-08T07:46:04.000Z","size":165,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T10:47:00.157Z","etag":null,"topics":["class","classproperty","decorator","metaclass","python3","pythonic"],"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/romnn.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-13T15:29:51.000Z","updated_at":"2024-01-14T00:01:01.000Z","dependencies_parsed_at":"2022-09-25T00:51:40.093Z","dependency_job_id":null,"html_url":"https://github.com/romnn/classprop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fclassprop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fclassprop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fclassprop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fclassprop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romnn","download_url":"https://codeload.github.com/romnn/classprop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253748287,"owners_count":21957900,"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":["class","classproperty","decorator","metaclass","python3","pythonic"],"created_at":"2024-11-18T06:18:57.086Z","updated_at":"2025-05-12T13:33:38.833Z","avatar_url":"https://github.com/romnn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"===============================\n@classprop\n===============================\n\n.. image:: https://github.com/romnn/classprop/workflows/test/badge.svg\n        :target: https://github.com/romnn/classprop/actions\n        :alt: Build Status\n\n.. image:: https://img.shields.io/pypi/v/classprop.svg\n        :target: https://pypi.python.org/pypi/classprop\n        :alt: PyPI version\n\n.. image:: https://img.shields.io/github/license/romnn/classprop\n        :target: https://github.com/romnn/classprop\n        :alt: License\n\n.. image:: https://codecov.io/gh/romnn/classprop/branch/master/graph/badge.svg\n        :target: https://codecov.io/gh/romnn/classprop\n        :alt: Test Coverage\n\n\"\"\"\"\"\"\"\"\n\n.. role:: python(code)\n   :language: python\n\nSmall python package that provides a :python:`@classproperty` decorator for python classes\nthat works just like :python:`@property` except for class variables!\n\n.. code-block:: console\n\n    $ pip install classprop\n\nUse it just like builtin :python:`@property`'s:\n\n.. code-block:: python\n\n    from classprop import classprop\n\n    class TestClass:\n        _internal = \"Hello, World\"\n\n        @classprop\n        def my_class_prop(self) -\u003e str:\n            return self._internal\n\n        @my_class_prop.setter\n        def my_class_prop(self, value: str) -\u003e None:\n            self._internal = value\n\n\n\n    foo = TestClass()\n    assert foo.my_class_prop == \"Hello, World\"\n\n    baz = TestClass()\n    assert baz.my_class_prop == \"Hello, World\"\n\n    baz.my_class_prop = \"Changed\"\n    assert foo.my_class_prop == \"Changed\"\n\n\nDevelopment\n-----------\n\nFor detailed instructions see `CONTRIBUTING \u003cCONTRIBUTING.rst\u003e`_.\n\nTests\n~~~~~~~\nYou can run tests with\n\n.. code-block:: console\n\n    $ invoke test\n    $ invoke test --min-coverage=90     # Fail when code coverage is below 90%\n    $ invoke type-check                 # Run mypy type checks\n\nLinting and formatting\n~~~~~~~~~~~~~~~~~~~~~~~~\nLint and format the code with\n\n.. code-block:: console\n\n    $ invoke format\n    $ invoke lint\n\nAll of this happens when you run ``invoke pre-commit``.\n\nNote\n-----\n\nThis project is still in the alpha stage and should not be considered production ready.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromnn%2Fclassprop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromnn%2Fclassprop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromnn%2Fclassprop/lists"}