{"id":15905991,"url":"https://github.com/lucacappelletti94/ringbell","last_synced_at":"2025-08-21T18:04:30.938Z","repository":{"id":57886877,"uuid":"528873935","full_name":"LucaCappelletti94/ringbell","owner":"LucaCappelletti94","description":"Python package to play a sound when a task completes.","archived":false,"fork":false,"pushed_at":"2022-08-28T10:07:28.000Z","size":3835,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T20:44:42.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LucaCappelletti94.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"LucaCappelletti94"}},"created_at":"2022-08-25T13:54:33.000Z","updated_at":"2023-08-22T15:02:37.000Z","dependencies_parsed_at":"2022-08-26T13:11:10.790Z","dependency_job_id":null,"html_url":"https://github.com/LucaCappelletti94/ringbell","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/LucaCappelletti94%2Fringbell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fringbell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fringbell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fringbell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LucaCappelletti94","download_url":"https://codeload.github.com/LucaCappelletti94/ringbell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246905830,"owners_count":20852818,"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":[],"created_at":"2024-10-06T13:20:30.536Z","updated_at":"2025-04-02T22:42:58.116Z","avatar_url":"https://github.com/LucaCappelletti94.png","language":"Python","readme":"Ring Bell\n=========================================================================================\n|pip| |downloads|\n\nPython package for playing a sound when a task is complete. The callbacks additionally works also within jupyter notebook,\nso that if you are working on a notebook on a remote machine it plays the audio within your browser and not in the server.\n\nHow do I install this package?\n----------------------------------------------\nYou will need a couple packages that you might not already have installed:\n\n.. code:: shell\n\n    sudo apt install python3-dev\n    sudo apt install libasound2-dev\n\nFinally as usual, just download it using pip:\n\n.. code:: shell\n\n    pip install ringbell\n\n\nSupport my work ❤️\n------------------------------------------------------\nIf you have enjoyed my work, and possibly it has saved you some precious minutes,\nplease do `support me on GitHub ❤️ \u003chttps://github.com/sponsors/LucaCappelletti94\u003e`_\n\n\nIntegration with exceptions and Jupyter Notebooks\n------------------------------------------------------\nIn Jupyter Notebooks it is now possible to integrate Ringbell with a one liner, that will play\na positive sound when the execution completes successfully and a negative sound when the execution\ncrashes and burns.\n\nAnalogous support is added for normal scripts, but only for exceptions since I am not aware of\nan hook event for the end of a script.\n\nNotification after at least one minute of execution\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nSince in most Jupyter Notebooks, expecially for experiments, there will be a few very quick\ncells and then some very long ones, we do not want to spam the user with sounds. The only\ncase where we'd like to advise the user is when enought time has passed since the start of either\nthe script execution or, in case of Jupyter Notebooks, the start of the cell execution.\n\nTo do this, simply import the ringbell package as such:\n\n.. code:: python\n\n    import ringbell.auto\n\n\nImmediate notification\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nIf you'd like to have an immediate notification for each cell and exception.\n\n.. code:: python\n\n    import ringbell.immediate\n\n\nAll exceptions\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nIf you'd like to have an immediate notification for all exceptions.\n\n.. code:: python\n\n    import ringbell.all_exceptions\n\n\nCustom time interval\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nYou can also customize the time interval as such:\n\n.. code:: python\n\n    from ringbell import auto_ringbell\n    auto_ringbell(\n        minimum_execution_time = 60,\n        only_exceptions = False,\n        good_sound=\"sample_for_nominal_execution\",\n        bad_sound=\"sample_for_exceptions\"\n    )\n\n\nUsage examples\n------------------------------------------------------\nIt's quite trivia, really, just go:\n\n.. code:: python\n\n    from ringbell import RingBell\n\n    def my_long_task():\n        # Do stuf...\n\n        # And when it is finished...\n        RingBell(\n            sample = \"microwave\",\n            minimum_execution_time = 0,\n            verbose = True\n        )\n\n\nHow many sounds are there? Well, just list them:\n\n.. code:: python\n\n    from ringbell import RingBell\n\n    print(RingBell.available_samples())\n\n\nWhat abount a custom sound? Just pass it as an argument.\n\n.. code:: python\n\n    from ringbell import RingBell\n\n    def my_long_task():\n        # Do stuf...\n\n        # And when it is finished...\n        RingBell(path=\"path/to/my_custom_sound.mp3\")\n\n\n.. |pip| image:: https://badge.fury.io/py/ringbell.svg\n    :target: https://badge.fury.io/py/ringbell\n    :alt: Pypi project\n\n.. |downloads| image:: https://pepy.tech/badge/ringbell\n    :target: https://pepy.tech/badge/ringbell\n    :alt: Pypi total project downloads \n","funding_links":["https://github.com/sponsors/LucaCappelletti94"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucacappelletti94%2Fringbell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucacappelletti94%2Fringbell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucacappelletti94%2Fringbell/lists"}