{"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":[{"note":"Main decorator for creating deprecated aliases.","symbol":"deprecated_alias","correct":"from deprecation_alias import deprecated_alias"},{"note":"Class to define a deprecated alias for a function or class.","symbol":"DeprecatedAlias","correct":"from deprecation_alias import DeprecatedAlias"}],"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,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install or upgrade: pip install --upgrade deprecation-alias","cause":"The library is not installed or an older version that didn't export the symbol.","error":"ImportError: cannot import name 'deprecated_alias' from 'deprecation_alias'"},{"fix":"Install it: pip install deprecation","cause":"The 'deprecation' library is a required dependency but not automatically installed.","error":"ModuleNotFoundError: No module named 'deprecation'"},{"fix":"Check the version: pip show deprecation-alias; if <0.3.0, upgrade: pip install --upgrade deprecation-alias","cause":"The signature of deprecated_alias changed; 'deprecated_in' was introduced in a later version (likely 0.3.0).","error":"TypeError: deprecated_alias() got an unexpected keyword argument 'deprecated_in'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}