Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

aliaser

Static Badge RTD

GitHub Release PyPI - Version Python Version from PEP 621 TOML

PyPI - Types

aliaser provides a tiny metaclass and mixin that let you expose call-perfect method aliases without writing boilerplate forwarders.

Table of Contents

Features

  • @alias decorator to expose a method or property under multiple names.
  • Aliases mixin for runtime helpers, backed by the AliasMeta metaclass.
  • Property and method aliases share the original descriptor – no wrappers.
  • install()/uninstall() helpers manage registration of alias on builtins. install() runs automatically on import for drop-in usage.

Installation

Install from PyPI:

pip install aliaser

Or add it to a Poetry project:

poetry add aliaser

Usage

Declaring aliases with @alias

from aliaser import Aliases, alias

class Greeter(Aliases):
    @alias('hi', 'sup')
    def hello(self):
        print("Hello!")

Greeter().hi()  # prints "Hello!"

Adding aliases at runtime

Greeter.add_alias('hello', 'howdy')
Greeter().howdy()  # also prints "Hello!"

Avoiding the built-ins side effect

Importing the top-level package calls aliaser.install() which registers alias on builtins. This modifies the global namespace. Call aliaser.uninstall() to undo the side effect, or import alias from aliaser.decorator and Aliases from aliaser.mixin directly instead of importing aliaser.

Development

Clone the repository and install dependencies with Poetry:

poetry install

After making changes you can build the wheel with poetry build. Feel free to open issues or pull requests on GitHub to discuss improvements.

Supported Python versions

This project requires Python 3.12 or newer.

License

aliaser is distributed under the MIT License.

Metadata

Release files for aliaser 1.0.0.dev7

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

Source distribution (sdist)

Source distribution for aliaser 1.0.0.dev7
File Size Uploaded Provenance Actions
aliaser-1.0.0.dev7.tar.gz 5.5 kB Without provenance Details for aliaser-1.0.0.dev7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aliaser 1.0.0.dev7
File Interpreter ABI Platform Actions
aliaser-1.0.0.dev7-py3-none-any.whl Python 3 none any Details for aliaser-1.0.0.dev7-py3-none-any.whl

Total release size: 13.1 kB

Release files / aliaser-1.0.0.dev7.tar.gz

Download URL aliaser-1.0.0.dev7.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6d34ee3db3ec372a43207c22714a2a578a55e7a83977203c9a13e2ac5939026f
BLAKE2b-256 checksum
How to use checksums
0521b900af8f93d94c8b3486fde314de44c9722f413d03ca45b536dc9be7794e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.9 Windows/11

Release files / aliaser-1.0.0.dev7-py3-none-any.whl

Download URL aliaser-1.0.0.dev7-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18552266735a6d7247972f614f39dea48ca78a67e216e54ee84ac3bca7ea143b
BLAKE2b-256 checksum
How to use checksums
86d20adf1a0bf742c40fcdc20624f3d269e144e05b0d4f0ab2ca0089620aaa17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.9 Windows/11

Security for aliaser 1.0.0.dev7

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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