Metadata-Version: 2.3
Name: aliaser
Version: 1.0.0.dev3
Summary: Drop-in mix-in + metaclass that let you declare any number of call-perfect aliases for a method with a single decorator or a runtime helper. No boiler-plate forwarders required.
License: MIT License
         
         Copyright (c) 2025 Taylor B.
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Author: Taylor B.
Author-email: t.blackstone@inspyre.tech
Requires-Python: >=3.11
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Provides-Extra: docs
Requires-Dist: furo (>=2024.8.6) ; extra == "docs"
Requires-Dist: sphinx (>=8.2.3) ; extra == "docs"
Description-Content-Type: text/markdown

# aliaser
![RTD](https://app.readthedocs.org/projects/aliaser/badge/?version=latest&style=for-the-badge)

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

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
  - [Declaring aliases with `@alias`](#declaring-aliases-with-alias)
  - [Adding aliases at runtime](#adding-aliases-at-runtime)
  - [Avoiding the built-ins side effect](#avoiding-the-built-ins-side-effect)
- [Development](#development)
- [Supported Python versions](#supported-python-versions)
- [License](#license)

## 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:

```bash
pip install aliaser
```

Or add it to a Poetry project:

```bash
poetry add aliaser
```

## Usage

### Declaring aliases with `@alias`

```python
from aliaser import Aliases, alias

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

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

### Adding aliases at runtime

```python
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:

```bash
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.

