{"id":20485464,"url":"https://github.com/knowsuchagency/klaxon","last_synced_at":"2025-04-13T14:54:28.255Z","repository":{"id":52946955,"uuid":"170247959","full_name":"knowsuchagency/klaxon","owner":"knowsuchagency","description":"Mac OS notifications from Python","archived":false,"fork":false,"pushed_at":"2020-05-24T06:39:45.000Z","size":5627,"stargazers_count":76,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T14:54:23.351Z","etag":null,"topics":["klaxon","mac","notifications","notifiers","productivity","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/klaxon/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knowsuchagency.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-12T03:51:25.000Z","updated_at":"2024-11-17T01:48:06.000Z","dependencies_parsed_at":"2022-08-28T03:12:57.847Z","dependency_job_id":null,"html_url":"https://github.com/knowsuchagency/klaxon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowsuchagency%2Fklaxon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowsuchagency%2Fklaxon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowsuchagency%2Fklaxon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowsuchagency%2Fklaxon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knowsuchagency","download_url":"https://codeload.github.com/knowsuchagency/klaxon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732512,"owners_count":21152851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["klaxon","mac","notifications","notifiers","productivity","python"],"created_at":"2024-11-15T16:30:43.720Z","updated_at":"2025-04-13T14:54:28.223Z","avatar_url":"https://github.com/knowsuchagency.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# klaxon\n\n![](https://github.com/knowsuchagency/klaxon/workflows/black/badge.svg)\n![](https://github.com/knowsuchagency/klaxon/workflows/mypy/badge.svg)\n![](https://github.com/knowsuchagency/klaxon/workflows/unit%20tests/badge.svg)\n\nSend Mac OS (or [notifiers][notifiers]) notifications from the terminal or Python programs.\n\nThis is especially useful for when you want a push notification\nfor some long-running background task.\n\nSimilar to the [terminal-notifier ruby gem][terminal-notifier],\nbut posix-compliant and able to send notifications via\nthe [notifiers][notifiers] library.\n\n![hello-klaxon](static/recording.gif)\n\n## Installation\nFor command-line use, the recommended method of installation is through [pipx].\n```bash\npipx install klaxon\n```\nNaturally, klaxon can also be pip-installed.\n```bash\npip install klaxon\n```\n\n## Usage\n\n### terminal\n\n```bash\n# blank notification\nklaxon\n# with custom message\nklaxon --message \"this is the message body\"\n# pipe message from other program\necho \"this is the message body\" | klaxon --\n```\n\n### python\n\n```python\nfrom klaxon import klaxon, klaxonify\n\n# send a notification\n\nklaxon(\n    title='hello, klaxon',\n    subtitle='hola',\n    message='it me'\n)\n\n# we can decorate our functions to have\n# them send notifications at termination\n\n@klaxonify\ndef hello(name='world'):\n    return f'hello, {name}'\n\n\n@klaxonify(title='oh hai', output_as_message=True)\ndef foo():\n    return \"This will be the message body.\"\n\n```\n\n## Non-MacOS Notifications\n\n### i.e. mobile | email | slack\n\nYou'll need to install klaxon with the `notifiers` extra.\n\n```bash\npipx install klaxon[notifiers]\n```\n\nYou will need a `~/.config/klaxon/config.toml` or `pyproject.toml` file with the\n`tool.klaxon` namespace configured at the top level. Values from the latter will\noverride values in the former.\n\n`enable-notifiers` will need to be set to `true` and you will need a `[[notifiers]]` key.\n\nThe latter will determine the parameters passed to the `notifiers.notify` method.\n\nFor example:\n\n`~/.config/klaxon/config.toml`\n```toml\nenable-notifiers = true\n\n[[notifiers]]\nname = 'slack'\n# see https://api.slack.com/incoming-webhooks#getting-started\nwebhook_url = {{your webhook url}}\n\n[[notifiers]]\nname = 'pushover'\nuser = {{your user token}}\ntoken = {{your application token}}\n```\n\nVoila! Now messages sent from klaxon will be pushed to slack and pushover.\n\n## Development\n\n```bash\n\ngit clone git@github.com:knowsuchagency/klaxon.git\n\ncd klaxon\n\n# create a virtualenv and activate it\n\npython3 -m venv .venv\nsource .venv/bin/activate\n\n# install poetry and use it to install project dependencies\n\npip install -U pip\npip install poetry\npoetry install\n\n# this will install `invoke` which will let you use the tasks defined in `tasks.py`\n\n# install pre-commit hooks\n\ninv install-hooks\n\n# from now on, as you make changes to the project, the pre-commit hooks and\n# github workflows will help make sure code is formatted properly and tests\n# are invoked as you commit, push, and submit pull requests\n```\n\n\n[terminal-notifier]: https://github.com/julienXX/terminal-notifier\n[pipx]: https://github.com/pipxproject/pipx\n[osascript]: https://apple.stackexchange.com/questions/57412/how-can-i-trigger-a-notification-center-notification-from-an-applescript-or-shel/115373#115373\n[notifiers]: https://github.com/notifiers/notifiers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowsuchagency%2Fklaxon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknowsuchagency%2Fklaxon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowsuchagency%2Fklaxon/lists"}