{"id":21125,"library":"deprecation-alias","title":"deprecation-alias","description":"A wrapper around the 'deprecation' library that provides support for deprecated aliases of functions, methods, and classes. Current version 0.4.0, requires Python >=3.6.1. Maintained by domdfcoding, releases are infrequent.","status":"active","version":"0.4.0","language":"python","source_language":"en","source_url":"https://github.com/domdfcoding/deprecation-alias","tags":["deprecation","alias","wrapper","python"],"install":[{"cmd":"pip install deprecation-alias","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Core dependency; provides the underlying deprecation machinery.","package":"deprecation","optional":false}],"imports":[{"wrong":"from deprecation_alias import deprecated_alias","symbol":"deprecated","correct":"from deprecation_alias import deprecated"},{"symbol":"deprecation","correct":"from deprecation_alias import deprecation"},{"symbol":"Callable","correct":"from deprecation_alias import Callable"}],"quickstart":{"code":"from deprecation_alias import deprecated_alias\n\n@deprecated_alias(new_name='new_func', deprecated_in='2.0', removed_in='3.0')\ndef old_func():\n    \"\"\"Old function that is now an alias.\"\"\"\n    return 'result'\n\n# Calling old_func will emit a deprecation warning\nprint(old_func())","lang":"python","description":"Define a deprecated alias for an existing function using the deprecated_alias decorator."},"warnings":[{"fix":"Ensure 'deprecation' is in your project dependencies: pip install deprecation or add to requirements.txt.","message":"The 'deprecated_alias' decorator requires the 'deprecation' library to be installed separately; it is not an automatic dependency of 'deprecation-alias'.","severity":"breaking","affected_versions":"all"},{"fix":"Review the documentation for proper usage. For classes, consider using @deprecated_alias on the class itself.","message":"The 'DeprecatedAlias' class is intended for use with classes, but using it incorrectly can lead to unexpected behavior (e.g., missing __init__).","severity":"gotcha","affected_versions":"all"},{"fix":"Verify that the target name exists in the same module scope as the decorator.","message":"When using 'deprecated_alias', the 'new_name' parameter must match an existing function/class name; otherwise, no alias is created, and the original function is still called.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.4.0':23 '3.6.1':26 'alia':3,34 'alias':15 'around':6 'class':20 'current':21 'deprec':2,8,14,33 'deprecation-alia':1 'domdfcod':29 'function':17 'infrequ':32 'librari':9 'maintain':27 'method':18 'provid':11 'python':25,36 'releas':30 'requir':24 'support':12 'version':22 'wrapper':5,35","created_at":"2026-04-27T16:58:12.816862+00:00","updated_at":"2026-04-27T16:58:12.816862+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.4.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/domdfcoding/deprecation-alias","docs":null,"changelog":null,"pypi":"https://pypi.org/project/deprecation-alias/","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-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}