Sourcecode on GitHub Code license GitHub tag (latest SemVer incl. pre-release GitHub release (latest SemVer incl. including pre-releases GitHub release date Dependent repos (via libraries.io)
GitHub Workflow - Build and Test Status Codacy - Quality Codacy - Line Coverage Codecov - Branch Coverage Libraries.io SourceRank
PyPI - Tag PyPI - Status PyPI - Python Version Libraries.io status for latest release
Documentation License Documentation - Read Now!

pyAttributes Documentation

The Python package pyAttributes offers implementations of .NET-like attributes realized with Python decorators. The package also offers a mixin-class to ease using classes having annotated methods.

In addition, an ArgParseAttributes module is provided, which allows users to describe complex argparse commond-line argument parser structures in a declarative way.

Attributes can create a complex class hierarchy. This helps in finding and filtering for annotated properties and user-defined data. These search operations can be called globally on the attribute classes or locally within an annotated class. Therefore the provided helper-mixin should be inherited.

Use Cases

Annotate properties and user-defined data to methods.

Derived use cases:

Planned implementations:

  • Annotate user-defined data to classes.

  • Describe test cases and test suits to get a cleaner syntax for Python’s unit tests.

Technique

The annotated data is stored in an additional __dict__ entry for each annotated method. By default the entry is called __pyattr__. Multiple attributes can be applied to the same method.

Common Attributes

  • Attribute class

  • AttributeHelperMixin class

Special Attributes

This package brings special attribute implementations for:

  • Python’s ArgParse including sub-parser support.

Contributors

License

This Python package (source code) is licensed under Apache License 2.0.
The accompanying documentation is licensed under Creative Commons - Attribution 4.0 (CC-BY 4.0).


This document was generated on Oct 05, 2022 - 22:17.