• Stars
    star
    678
  • Rank 66,609 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Laughs at your expense

JazzIt 🎷

Open All Collab License DeepSource Say Thanks!

Ever wanted your scripts to play music while running/ on erroring out?

Of course you didn't

But here it is anyway

Install

pip install jazzit

What it do?

With Jazzit you can just add a decorator to your functions and jazz it up

  • You can have a elevator music to go along with your long running script
  • Play humiliating music when it errors out to put you in your place

There are default tracks you can use, or you can use your own custom tracks

How to do it?

Play Frolic from curb your enthusiasm to keep you in your place

from jazzit import error_track

@error_track("curb_your_enthusiasm.mp3", wait=7)
def run():
    for num in reversed(range(10)):
        print(10/num)

if __name__ == "__main__":
    run()

Sip coffee to elevator music while your script is running

from jazzit import waiting_track

def fibonacci(n):
    if n < 0:
        raise Exception("BE POSITIVE!!!")
    elif n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)

@waiting_track("elevator.mp3")
def run(limit):
    for num in range(1, limit):
        print(fibonacci(num))

if __name__ == "__main__":
    run(1000)

To satisfy your WHAT !!! IT WORKED !!! moments

from jazzit import success_track

@success_track("anime-wow.mp3")
def add(a,b):
    print(a+b)

if __name__ == "__main__":
    add(12, 42)

The in-build tracks are bruh_moment, elevator and curb_your_enthusiasm but you can add your custom tracks and urls

Check out some of the examples

Jupyter Notebook

Check out the colab link above or the example notebook

Use Jupyter Magic:

Load inside a Jupyter notebook

%load_ext jazzit

Running away from the PEP8 police πŸš²πŸš“

%%waiting_track -t elevator.mp3

def fibonacci(n):
    if n < 0:
        raise Exception("BE POSITIVE!!!")
    elif n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)
for num in range(1, 35):
    print(fibonacci(num))

For those BRUH moments in your life

%%error_track -t bruh.mp3 -w 3

for num in reversed(range(10)):
    print(10/num)

It worked !!!

%%success -t anime-wow.mp3 -w 3

for num in range(10):
    print(num ** 2)

There are two arguments in play here

-t or --track that needs the sound track (Can be a file path, url, inbuilt tracks)

-w or --wait (Optional, default is 3 seconds) Wait for x seconds before cutting the music

Dependencies

Jazz added with playsound

If you getting hit with ModuleNotFound errors while running jazzit

You might need to install Pygobject https://pygobject.readthedocs.io/en/latest/getting_started.html

⚠️ Use wisely: Best suited for scripts you run non-professionally!

Profiling

TL;DR It is definitely slower with music

I did a lil profiling on bin/profiler.py

Without Music

Time to run : 5.2486350536346436 secs

With Music

Time to run: 5.270173072814941 secs

Memory profiling python -m memory_profiler bin/profiler.py

Social

Hacker News: https://news.ycombinator.com/item?id=24485447

Twitter: https://twitter.com/sangarshanan/status/1305933704007573504

amrrs put together a video https://youtu.be/qkyQfIjvPmM :)

Disclaimer

Default tracks were pulled from royalty-free stock audio sites (They are mostly gaming and meme sound effects)

More Repositories

1

time-series-forecasting

Understanding time series forecasting
Jupyter Notebook
65
star
2

geopatra

Interactive Maps with Geopandas
Python
50
star
3

crime-analytics-web-application

A Django Based Crime Visualization and ML Application
JavaScript
35
star
4

webscraping-and-analysis-of-medium-articles

Scraping medium articles tagged under ML,DL and AI and performing Analysis
Jupyter Notebook
29
star
5

song-lyrics-generation-and-analysis

Lyrics Generation🎢 using LSTM , word2vec Analysis and more
Jupyter Notebook
10
star
6

duhdoy

Sarcasm-Inator
Python
9
star
7

dadjokes-cli

Dad Jokes on your Terminal
Python
8
star
8

talks

Talks and stuff
Jupyter Notebook
7
star
9

implementing-basic-concepts-and-algorithms

this has some of the shit i did in college
Jupyter Notebook
5
star
10

Neural-Language-Translation

Tamil to English translation using Neural Networks
Jupyter Notebook
4
star
11

godseye

Using Lat Longs to map the pincode and extrapolating the road path between lat longs
Jupyter Notebook
4
star
12

bookmark

πŸ”– internet dungeon
3
star
13

Indian-startup-name-generator-

Startup name generation using LSTM networks ✌️
Jupyter Notebook
2
star
14

Computer-Vision

Computer vision notebooks
Jupyter Notebook
2
star
15

delta_streamer

Kafka to Hudi with Deltastreamer
Python
2
star
16

the-med-place

A decentralized healthcare application πŸ₯ Link to a static demo:
PHP
1
star
17

sangarshanan.github.io

Wannabe Blog
HTML
1
star
18

sangarshanan

1
star
19

Analysis-of-Spotify-Worldwide-Song-Ranking

Analysis of spotify kaggle dataset πŸ”‰
Jupyter Notebook
1
star
20

the-nosy-intern

Community
HTML
1
star
21

yeetdb

Throwaway Database written in Python
Jupyter Notebook
1
star
22

stkmachine.asm

Basic arithmetic and logical operations in x86 assembly
Assembly
1
star
23

sonic-pi-beats

Music with https://sonic-pi.net/
Ruby
1
star
24

osc-sonic-pi

OSC to control Sonic Pi
JavaScript
1
star