{"id":23429,"library":"classproperties","title":"classproperties","description":"A lightweight Python library providing property decorators for classmethods and staticmethods. Version 0.2.0 is the latest release. The project is minimally maintained.","status":"maintenance","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/dpep/pyclassproperties","tags":["classproperty","decorator","python","utility"],"install":[{"cmd":"pip install classproperties","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"No common incorrect import path.","wrong":"","symbol":"classproperty","correct":"from classproperties import classproperty"}],"quickstart":{"code":"from classproperties import classproperty\n\nclass MyClass:\n    @classproperty\n    def my_prop(cls):\n        return 'classprop_val'\n\nprint(MyClass.my_prop)","lang":"python","description":"Basic usage of classproperty decorator."},"warnings":[{"fix":"Ensure the decorated function is a classmethod-like method with 'cls' parameter inside a class.","message":"The decorator must be used inside a class definition and the method must accept 'cls' as its first argument. Defining it outside a class will raise an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Always apply @classproperty explicitly in subclasses that need a different value.","message":"Inheritance may not work as expected if subclasses override the property without using the decorator. The parent class property will be used if overridden as a regular attribute.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.2.0':14 'classmethod':10 'classproperti':1,24 'decor':8,25 'latest':17 'librari':5 'lightweight':3 'maintain':23 'minim':22 'project':20 'properti':7 'provid':6 'python':4,26 'releas':18 'staticmethod':12 'util':27 'version':13","created_at":"2026-05-01T08:07:44.172879+00:00","updated_at":"2026-05-01T08:07:44.172879+00:00","problems":[{"fix":"Make sure the method signature is like: def method(cls): and that @classproperty is applied inside a class body.","cause":"The decorated method does not accept 'cls' as its first parameter, or the decorator is applied to a non-method.","error":"TypeError: @classproperty can only be used on methods with 'cls' as first argument"},{"fix":"Ensure Python 3. Use only on methods defined inside a class.","cause":"Using an incompatible Python version or applying the decorator incorrectly (e.g., on a non-function). The library may not support Python 2.","error":"AttributeError: 'function' object has no attribute '__get__'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.2.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/dpep/pyclassproperties","docs":null,"changelog":null,"pypi":"https://pypi.org/project/classproperties/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}