ev-manager


Nameev-manager JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/nils-soderman/ev-manager
SummaryBind functions to events that can be called from any other script at any time.
upload_time2024-03-03 11:36:57
maintainer
docs_urlNone
authorNils Soderman
requires_python>=3.7
license
keywords event manager bind subscribe fire function callback emit
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ev-manager (Event Manager)

Useful when working with DCCs like Maya, MotionBuilder, Unreal Engine, etc. and you want different tools/scripts to communicate with each other.

## Installation:
```batch
pip install ev-manager
```

## Examples:

### Using classes:

```python
""" my_module.py """

from typing import Callable
from ev_manager import Event

class ExampleEvent(Event[Callable[[int], None]]):
    pass

def my_callback(value: int):
    print(f"Number: {value}")

ExampleEvent.bind(my_callback)
```

```python
>>> from my_module import ExampleEvent
>>> ExampleEvent.emit(5)
>>> "Number: 5"
```


### Using functions:

```python
import ev_manager

def hello_world():
    print("Hello World!")

ev_manager.bind("MyEvent", hello_world)
```

```python
>>> import ev_manager
>>> ev_manager.emit("MyEvent")
>>> "Hello World!"
```


## Available functions:

| Function | Description |
| --- | --- |
| `bind(event, function)` | Bind a function to an event. |
| `unbind(event, function)` | Unbind a function from an event. |
| `unbind_all(*, event, function)` | Either unbind all functions from an event or unbind a function from all events. |
| `is_bound(event, function)` | Check if a function is bound to an event. |
| `emit(event, *args, **kwargs)` | Call all functions bound to an event. |


## Limitations:
Events are per Python instance. So they will for example not be communicating between different applications.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nils-soderman/ev-manager",
    "name": "ev-manager",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "event,manager,bind,subscribe,fire,function,callback,emit",
    "author": "Nils Soderman",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/f4/3a/0813d86883d05efb19e2fbaf8514ec1d9c4a4170ad0fdd5a1c33920c073b/ev-manager-0.1.0.tar.gz",
    "platform": null,
    "description": "# ev-manager (Event Manager)\n\nUseful when working with DCCs like Maya, MotionBuilder, Unreal Engine, etc. and you want different tools/scripts to communicate with each other.\n\n## Installation:\n```batch\npip install ev-manager\n```\n\n## Examples:\n\n### Using classes:\n\n```python\n\"\"\" my_module.py \"\"\"\n\nfrom typing import Callable\nfrom ev_manager import Event\n\nclass ExampleEvent(Event[Callable[[int], None]]):\n    pass\n\ndef my_callback(value: int):\n    print(f\"Number: {value}\")\n\nExampleEvent.bind(my_callback)\n```\n\n```python\n>>> from my_module import ExampleEvent\n>>> ExampleEvent.emit(5)\n>>> \"Number: 5\"\n```\n\n\n### Using functions:\n\n```python\nimport ev_manager\n\ndef hello_world():\n    print(\"Hello World!\")\n\nev_manager.bind(\"MyEvent\", hello_world)\n```\n\n```python\n>>> import ev_manager\n>>> ev_manager.emit(\"MyEvent\")\n>>> \"Hello World!\"\n```\n\n\n## Available functions:\n\n| Function | Description |\n| --- | --- |\n| `bind(event, function)` | Bind a function to an event. |\n| `unbind(event, function)` | Unbind a function from an event. |\n| `unbind_all(*, event, function)` | Either unbind all functions from an event or unbind a function from all events. |\n| `is_bound(event, function)` | Check if a function is bound to an event. |\n| `emit(event, *args, **kwargs)` | Call all functions bound to an event. |\n\n\n## Limitations:\nEvents are per Python instance. So they will for example not be communicating between different applications.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Bind functions to events that can be called from any other script at any time.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/nils-soderman/ev-manager"
    },
    "split_keywords": [
        "event",
        "manager",
        "bind",
        "subscribe",
        "fire",
        "function",
        "callback",
        "emit"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c77a1d518ad227c6d30b475d4fd737839a59f7e9ff4aa6f4acc52681001a8c30",
                "md5": "dbf5764626c3ca79712e1a1b320fa30b",
                "sha256": "994bd3b822b0b7d0e80ed2c75b95a2ed44c9067b73ea58e94d9a5bfab16cc6ea"
            },
            "downloads": -1,
            "filename": "ev_manager-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dbf5764626c3ca79712e1a1b320fa30b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4797,
            "upload_time": "2024-03-03T11:36:56",
            "upload_time_iso_8601": "2024-03-03T11:36:56.445997Z",
            "url": "https://files.pythonhosted.org/packages/c7/7a/1d518ad227c6d30b475d4fd737839a59f7e9ff4aa6f4acc52681001a8c30/ev_manager-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f43a0813d86883d05efb19e2fbaf8514ec1d9c4a4170ad0fdd5a1c33920c073b",
                "md5": "cf2a6953a3b05652a9f26cdeded9414e",
                "sha256": "0b96367ac0a36dffafa047ad25bf951d06df845dbd2d6e01eb46ba89dbad7c4a"
            },
            "downloads": -1,
            "filename": "ev-manager-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cf2a6953a3b05652a9f26cdeded9414e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4070,
            "upload_time": "2024-03-03T11:36:57",
            "upload_time_iso_8601": "2024-03-03T11:36:57.825480Z",
            "url": "https://files.pythonhosted.org/packages/f4/3a/0813d86883d05efb19e2fbaf8514ec1d9c4a4170ad0fdd5a1c33920c073b/ev-manager-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-03 11:36:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nils-soderman",
    "github_project": "ev-manager",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ev-manager"
}
        
Elapsed time: 0.46884s