Skip to main content

This module defines a decorator to wrap legacy APIs. The primary use case is APIs defined before keyword-only parameters existed.

>>> from legacy_api_wrap import legacy_api

We have a function with many positional parameters lying around:

>>> def fn(a, b=None, d=1, c=2):
...     return c, d, e

We want to convert the positional parameters d and c to keyword-only, change their order and add a parameter. For this we only need to specify name and order of the old positional parameters in the decorator.

>>> @legacy_api('d', 'c')
... def fn(a, b=None, *, c=2, d=1, e=3):
...     return c, d, e

After adding the decorator, users can keep calling the old API and get a DeprecationWarning:

>>> fn(12, 13, 14) == (2, 14, 3)
True

Release files for legacy-api-wrap 1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for legacy-api-wrap 1.5
File Size Uploaded
legacy_api_wrap-1.5.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for legacy-api-wrap 1.5
File Interpreter ABI Platform
legacy_api_wrap-1.5-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / legacy_api_wrap-1.5.tar.gz

Download URL legacy_api_wrap-1.5.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b41ba6532f3ebfe3a897a35a7f97dec3be04b92a450f6c2bcf89f1b91c9cadf2
BLAKE2b-256 checksum
How to use checksums
5849f06f94048c8974205730d40beca879e43b6eee08efb0101cfb8623e60f41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2025.

Transparency log

Release files / legacy_api_wrap-1.5-py3-none-any.whl

Download URL legacy_api_wrap-1.5-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a8ea50e3e3bcbcdec3447b77034fd0d32cb2cf4089db799238708e4d7e0098d
BLAKE2b-256 checksum
How to use checksums
415b058db09c45ba58a7321bdf2294cae651b37d6fec68117265af90cde043b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.5 This release

2 release files

1.4.1

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page