wirerope
========
.. image:: https://github.com/youknowone/wirerope/actions/workflows/python-package.yml/badge.svg
.. image:: https://codecov.io/gh/youknowone/wirerope/graph/badge.svg
:target: https://codecov.io/gh/youknowone/wirerope
The concepts:
- `wirerope.rope.WireRope` is a wrapper interface for python callable.
- Custom `wirerope.wire.Wire` class provides user-defined behavior.
A subclass of this class is working similar to a *decorator function* body.
- A wire object is associated with a bound method.
- Rope is dispatching types.
`wirerope.rope.WireRope` is the wrapper for callables. By wrapping a
function with `WireRope` with a custom subclass of the `wirerope.wire.Wire`
class, the wire object will be created by each function or bound method.
`Wire` is the most important part. The given class will be instantiated and
bound to each function or bound method - which fits the concept of *instance
cmethod* of human.
For example, when `f` is a free function or staticmethod, the wire also will
be a single object. When `f` is a method or property, wires will be created for
each method owner object `self`. When `f` is a classmethod, wires will be
created for each method owner class `cls`. Yes, it will detect the owner
and bound to it regardless of the calling type.
`Rope` is internal dispatcher. It will be helpful when creating a complex
object for decorated callable instead of simple callable feature.
See also
--------
- See [documentation](https://wirerope.readthedocs.io/en/latest/) - though it
is not yet written very well.
- See `tests/test_wire.py` for simple example.
- See [methodtools](https://github.com/youknowone/methodtools) for practical
example.
Raw data
{
"_id": null,
"home_page": "https://github.com/youknowone/wirerope",
"name": "wirerope",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "ring, methodtools, hack, method",
"author": "Jeong YunWon",
"author_email": "wirerope@youknowone.org",
"download_url": "https://files.pythonhosted.org/packages/bc/09/b9f811e2bf9b14c0a99fa072f431bb48a327101a2239b32c9ee1d2f46efe/wirerope-0.4.8.tar.gz",
"platform": null,
"description": "wirerope\n========\n\n.. image:: https://github.com/youknowone/wirerope/actions/workflows/python-package.yml/badge.svg\n.. image:: https://codecov.io/gh/youknowone/wirerope/graph/badge.svg\n :target: https://codecov.io/gh/youknowone/wirerope\n\n\nThe concepts:\n\n- `wirerope.rope.WireRope` is a wrapper interface for python callable.\n- Custom `wirerope.wire.Wire` class provides user-defined behavior.\n A subclass of this class is working similar to a *decorator function* body.\n- A wire object is associated with a bound method.\n- Rope is dispatching types.\n\n`wirerope.rope.WireRope` is the wrapper for callables. By wrapping a\nfunction with `WireRope` with a custom subclass of the `wirerope.wire.Wire`\nclass, the wire object will be created by each function or bound method.\n\n`Wire` is the most important part. The given class will be instantiated and\nbound to each function or bound method - which fits the concept of *instance\ncmethod* of human.\nFor example, when `f` is a free function or staticmethod, the wire also will\nbe a single object. When `f` is a method or property, wires will be created for\neach method owner object `self`. When `f` is a classmethod, wires will be\ncreated for each method owner class `cls`. Yes, it will detect the owner\nand bound to it regardless of the calling type.\n\n`Rope` is internal dispatcher. It will be helpful when creating a complex\nobject for decorated callable instead of simple callable feature.\n\n\nSee also\n--------\n\n- See [documentation](https://wirerope.readthedocs.io/en/latest/) - though it\n is not yet written very well.\n- See `tests/test_wire.py` for simple example.\n- See [methodtools](https://github.com/youknowone/methodtools) for practical\n example.\n",
"bugtrack_url": null,
"license": "BSD 2-Clause License",
"summary": "'Turn functions and methods into fully controllable objects'",
"version": "0.4.8",
"project_urls": {
"Homepage": "https://github.com/youknowone/wirerope"
},
"split_keywords": [
"ring",
" methodtools",
" hack",
" method"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ebfe5a7e62fa87e75a262e50da6a6575fe1c1556b407ab27deea1a1946ae400f",
"md5": "8e8369ad39823b712933568d264f573a",
"sha256": "99e54b9bd9d3a8e18199b87e2c5edf58d7f64e3f7e2f5bb041034025f03a4e68"
},
"downloads": -1,
"filename": "wirerope-0.4.8-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e8369ad39823b712933568d264f573a",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 9106,
"upload_time": "2024-11-09T06:21:23",
"upload_time_iso_8601": "2024-11-09T06:21:23.378681Z",
"url": "https://files.pythonhosted.org/packages/eb/fe/5a7e62fa87e75a262e50da6a6575fe1c1556b407ab27deea1a1946ae400f/wirerope-0.4.8-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc09b9f811e2bf9b14c0a99fa072f431bb48a327101a2239b32c9ee1d2f46efe",
"md5": "2f05e377650da3890ad033641669f03d",
"sha256": "fa172d09eff7534563f315e38712b5fa3b88a1aa3467b539a7510f2e427a7af4"
},
"downloads": -1,
"filename": "wirerope-0.4.8.tar.gz",
"has_sig": false,
"md5_digest": "2f05e377650da3890ad033641669f03d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10805,
"upload_time": "2024-11-09T06:21:25",
"upload_time_iso_8601": "2024-11-09T06:21:25.168648Z",
"url": "https://files.pythonhosted.org/packages/bc/09/b9f811e2bf9b14c0a99fa072f431bb48a327101a2239b32c9ee1d2f46efe/wirerope-0.4.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-09 06:21:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "youknowone",
"github_project": "wirerope",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"lcname": "wirerope"
}