SnakeJazz
Decorators for sound reproduction
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
About The Project
SnakeJazz provides decorators to let you listen to the running status of your Snake Python functions. Most definitly inspired by Rick and Morty :wink:
These are the decorators:
-
snakejazz.zzz: You can choose to reproduce a sound at the moment your function starts to excecute, when it finishes or when an error occurs. A different sound for each event can be given. -
snakejazz.www: Exactly the same as zzz, but you can specify youtube links and the audio will be downloaded. -
snakejazz.rattle: Rattle from start to finish. This will loop the sound until your function ends. You can either give a local path or a youtube link.
All three of them can be used directly to run with the default configuration. But you can also give some custom sounds for a more enjoyable moment.
Getting Started
There are two simple steps to have SnakeJazz running on you python scripts.
Prerequisites
SnakeJazz works with ffmpeg library for audio processing. To install it simply run:
-
apt
sudo apt update sudo apt install ffmpeg
-
dnf
sudo dnf install ffmpeg
You will also need a nice set of headphones to run SnakeJazz. :headphones:
Installation
-
Standard Installation
pip install snakejazz -
Development Install
git clone https://github.com/mchalela/SnakeJazz.git cd SnakeJazz pip install -e .
Basic Usage
Let's say you have a function that takes some time to compute. Just plug-in the decorator of your preference and you're good to go!
import time
import snakejazz
@snakejazz.rattle
def wait(t):
"""Some function to simulate computing time."""
time.sleep(t)
return
# Put on your headphones and run it!
wait(22)
The rattle decorator will play a sound in loop until your function ends.
Now let's say you want to be notified if an error occurs during the execution of your function.
import time
import snakejazz
@snakejazz.zzz(when_error=True)
def wait(t):
"""Some function to simulate computing time."""
time.sleep(t)
raise ValueError('Something went wrong')
return
# Put on your headphones and run it!
wait(3)
Sounds
For the moment SnakeJazz comes with one pack of 33 free sounds called Rhodesmas (available here: link). You can listen to them with the function snakejazz.play_sound. Just run this code:
import snakejazz
for sound, path in snakejazz.sounds.RHODESMAS.items():
print(f'Playing {sound}')
snakejazz.play_sound(path)
Contributing
This is an open source project made to be shared. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.
Author
Martin Chalela - email: tinchochalela@gmail.com
Project Link: https://github.com/mchalela/SnakeJazz
Acknowledgements
-
Snake and Saxophone icons: Icons made by Freepik from www.flaticon.com.
Metadata
Release files for snakejazz 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| snakejazz-0.1.1.tar.gz | 6.3 MB | Without provenance | Details |
Release files / snakejazz-0.1.1.tar.gz
| Download URL | snakejazz-0.1.1.tar.gz |
|---|---|
| Size | 6.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27d72f02654e7cf8d20e370b2bce08263eb1d24253d8fe3d01544209f764108c
|
|
BLAKE2b-256 checksum How to use checksums |
052b785968ab45ee2eb13e16c3a01b3ba2c57359bd4af727a63ed57f2e931568
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5
|
Security for snakejazz 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.