aliaser


Namealiaser JSON
Version 1.0.0.dev7 PyPI version JSON
download
home_pageNone
SummaryDrop-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.
upload_time2025-07-12 17:53:16
maintainerNone
docs_urlNone
authorTaylor B.
requires_python>=3.11
licenseMIT 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.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aliaser
![Static Badge](https://img.shields.io/badge/Inspyre-Softworks-blue?style=for-the-badge&logo=poetry)
![RTD](https://app.readthedocs.org/projects/aliaser/badge/?version=latest&style=for-the-badge)

![GitHub Release](https://img.shields.io/github/v/release/tayjaybabee/aliaser?include_prereleases&cacheSeconds=10&style=for-the-badge)
![PyPI - Version](https://img.shields.io/pypi/v/aliaser?style=for-the-badge)
![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Ftayjaybabee%2Faliaser%2Frefs%2Fheads%2Fmaster%2Fpyproject.toml&style=for-the-badge)

![PyPI - Types](https://img.shields.io/pypi/types/aliaser?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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aliaser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "Taylor B.",
    "author_email": "t.blackstone@inspyre.tech",
    "download_url": "https://files.pythonhosted.org/packages/05/21/b900af8f93d94c8b3486fde314de44c9722f413d03ca45b536dc9be7794e/aliaser-1.0.0.dev7.tar.gz",
    "platform": null,
    "description": "# aliaser\n![Static Badge](https://img.shields.io/badge/Inspyre-Softworks-blue?style=for-the-badge&logo=poetry)\n![RTD](https://app.readthedocs.org/projects/aliaser/badge/?version=latest&style=for-the-badge)\n\n![GitHub Release](https://img.shields.io/github/v/release/tayjaybabee/aliaser?include_prereleases&cacheSeconds=10&style=for-the-badge)\n![PyPI - Version](https://img.shields.io/pypi/v/aliaser?style=for-the-badge)\n![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Ftayjaybabee%2Faliaser%2Frefs%2Fheads%2Fmaster%2Fpyproject.toml&style=for-the-badge)\n\n![PyPI - Types](https://img.shields.io/pypi/types/aliaser?style=for-the-badge)\n\n\n\naliaser provides a tiny metaclass and mixin that let you expose call-perfect\nmethod aliases without writing boilerplate forwarders.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Declaring aliases with `@alias`](#declaring-aliases-with-alias)\n  - [Adding aliases at runtime](#adding-aliases-at-runtime)\n  - [Avoiding the built-ins side effect](#avoiding-the-built-ins-side-effect)\n- [Development](#development)\n- [Supported Python versions](#supported-python-versions)\n- [License](#license)\n\n## Features\n\n- `@alias` decorator to expose a method or property under multiple names.\n- `Aliases` mixin for runtime helpers, backed by the `AliasMeta` metaclass.\n- Property and method aliases share the original descriptor \u2013 no wrappers.\n- `install()`/`uninstall()` helpers manage registration of `alias` on\n  `builtins`. `install()` runs automatically on import for drop-in usage.\n\n## Installation\n\nInstall from PyPI:\n\n```bash\npip install aliaser\n```\n\nOr add it to a Poetry project:\n\n```bash\npoetry add aliaser\n```\n\n## Usage\n\n### Declaring aliases with `@alias`\n\n```python\nfrom aliaser import Aliases, alias\n\nclass Greeter(Aliases):\n    @alias('hi', 'sup')\n    def hello(self):\n        print(\"Hello!\")\n\nGreeter().hi()  # prints \"Hello!\"\n```\n\n### Adding aliases at runtime\n\n```python\nGreeter.add_alias('hello', 'howdy')\nGreeter().howdy()  # also prints \"Hello!\"\n```\n\n### Avoiding the built-ins side effect\n\nImporting the top-level package calls `aliaser.install()` which registers\n`alias` on `builtins`. This modifies the global namespace. Call\n`aliaser.uninstall()` to undo the side effect, or import `alias` from\n`aliaser.decorator` and `Aliases` from `aliaser.mixin` directly instead of\nimporting `aliaser`.\n\n## Development\n\nClone the repository and install dependencies with Poetry:\n\n```bash\npoetry install\n```\n\nAfter making changes you can build the wheel with `poetry build`. Feel free to\nopen issues or pull requests on GitHub to discuss improvements.\n\n## Supported Python versions\n\nThis project requires Python 3.12 or newer.\n\n## License\n\n`aliaser` is distributed under the MIT License.\n",
    "bugtrack_url": null,
    "license": "MIT License\n\nCopyright (c) 2025 Taylor B.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "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.",
    "version": "1.0.0.dev7",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86d20adf1a0bf742c40fcdc20624f3d269e144e05b0d4f0ab2ca0089620aaa17",
                "md5": "63599d091507e1d8714efd016bfb7686",
                "sha256": "18552266735a6d7247972f614f39dea48ca78a67e216e54ee84ac3bca7ea143b"
            },
            "downloads": -1,
            "filename": "aliaser-1.0.0.dev7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63599d091507e1d8714efd016bfb7686",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 7623,
            "upload_time": "2025-07-12T17:53:15",
            "upload_time_iso_8601": "2025-07-12T17:53:15.236328Z",
            "url": "https://files.pythonhosted.org/packages/86/d2/0adf1a0bf742c40fcdc20624f3d269e144e05b0d4f0ab2ca0089620aaa17/aliaser-1.0.0.dev7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0521b900af8f93d94c8b3486fde314de44c9722f413d03ca45b536dc9be7794e",
                "md5": "fae342bfd630a16e41441a3f58d11ac9",
                "sha256": "6d34ee3db3ec372a43207c22714a2a578a55e7a83977203c9a13e2ac5939026f"
            },
            "downloads": -1,
            "filename": "aliaser-1.0.0.dev7.tar.gz",
            "has_sig": false,
            "md5_digest": "fae342bfd630a16e41441a3f58d11ac9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 5499,
            "upload_time": "2025-07-12T17:53:16",
            "upload_time_iso_8601": "2025-07-12T17:53:16.288730Z",
            "url": "https://files.pythonhosted.org/packages/05/21/b900af8f93d94c8b3486fde314de44c9722f413d03ca45b536dc9be7794e/aliaser-1.0.0.dev7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 17:53:16",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "aliaser"
}
        
Elapsed time: 1.32558s