API

The currently documented publicly exposed API’s for usage in your project are defined below.

Warning

External usage of internal utility functions and modules should be kept to a minimum as they may be altered, refactored or moved to other locations without notice (and without the typical deprecation cycle).

Moves

debtcollector.moves.moved_method(new_method_name, message=None, version=None, removal_version=None, stacklevel=3)[source]

Decorates a instance method that was moved to another location.

debtcollector.moves.moved_property(new_attribute_name, message=None, version=None, removal_version=None, stacklevel=3)[source]

Decorates a instance property that was moved to another location.

debtcollector.moves.moved_class(new_class, old_class_name, old_module_name, message=None, version=None, removal_version=None, stacklevel=3)[source]

Deprecates a class that was moved to another location.

This creates a ‘new-old’ type that can be used for a deprecation period that can be inherited from. This will emit warnings when the old locations class is initialized, telling where the new and improved location for the old class now is.

Renames

debtcollector.renames.renamed_kwarg(old_name, new_name, message=None, version=None, removal_version=None, stacklevel=3)[source]

Decorates a kwarg accepting function to deprecate a renamed kwarg.

Removals

debtcollector.removals.remove(f=None, message=None, version=None, removal_version=None, stacklevel=3)[source]

Decorates a function, method, or class to emit a deprecation warning

Parameters:
  • message (str) – A message to include in the deprecation warning
  • version (str) – Specify what version the removed function is present in
  • removal_version (str) – What version the function will be removed. If ‘?’ is used this implies an undefined future version
  • stacklevel (int) – How many entries deep in the call stack before ignoring
debtcollector.removals.removed_kwarg(old_name, message=None, version=None, removal_version=None, stacklevel=3)[source]

Decorates a kwarg accepting function to deprecate a removed kwarg.

debtcollector.removals.removed_module(module, replacement=None, message=None, version=None, removal_version=None, stacklevel=3)[source]

Helper to be called inside a module to emit a deprecation warning

Parameters:
  • replacment (str) – A location (or information about) of any potential replacement for the removed module (if applicable)
  • message (str) – A message to include in the deprecation warning
  • version (str) – Specify what version the removed module is present in
  • removal_version (str) – What version the module will be removed. If ‘?’ is used this implies an undefined future version
  • stacklevel (int) – How many entries deep in the call stack before ignoring

Table Of Contents

Previous topic

Installation

Next topic

Examples

This Page