Your swiss knife to perform fast and easy pythonic stuff

hal, library, general-purpose
pip install PyHal==10.2.6


HAL | Handy Algorithmic Library

Your swiss knife to perform fast and easy pythonic stuff

Build Status Code Health
Table of Contents

The problem

Say you want to

If you want to do this stuff in a fast and easy way, this library is for you


Edit songs tags

Classic way

import os
from mutagen.mp3 import MP3
my_folder = "path to folder containing songs"
for root, dirs, files in os.walk(my_folder):
    for file in files:
        audio = MP3(file)
        audio["artist"] = "An example"

Using pyhal

from hal.files.models.system import ls_recurse
from import MP3Song
my_folder = "path to folder containing songs"
for file in ls_recurse(my_folder):
    MP3Song(file).set_artist("An example")

Plot data

Classic way

import numpy as np
import matplotlib.pyplot as plt
x = np.arange(1., 100.)
y = np.sin(x)
plt.plot(x, y)

Using pyhal

import numpy as np
from hal.charts.plotter import Plot2d
Plot2d().plot(np.sin, 1, 100, 100)

Get YouTube RSS feed of channel

Classic way

No easy way that I know of

Using pyhal

from import YoutubeChannel
video_url = "my awesome video of an awesome channel"
channel_feed = YoutubeChannel.get_feed_url_from_video(video_url)
# or if you know the name
channel_name = "my awesome channel"
channel_feed = YoutubeChannel(channel_name).get_feed_url()

Generate module tests code

Classic way

No easy way that I know of

Using pyhal

from hal.tests.gen import TestWriter
src = "path to module source folder"
out = "path to output folder"
w = TestWriter(src)


PyPI version Requirements Status Known Vulnerabilities

Different ways, all equals

via pipenv

  • $ pipenv install .
  • $ make install

via pip

  • $ pip3 install PyHal
  • $ make pip-install

fast install

  • make fast-init just copies source files to distitribution files ... run it only if you're sure about dependencies

Usage and documentation

Browse the online documentation here]( or make your own by make docs

Contributing and feedback

Contributions welcome Open Source Love

  1. open an issue
  2. fork this repository
  3. create your feature branch (git checkout -b my-new-feature)
  4. commit your changes (git commit -am 'Added my new feature')
  5. publish the branch (git push origin my-new-feature)
  6. open a PR

Suggestions and improvements are welcome!


Code Climate BCH compliance pylint score

Stefano Fogarollo

Thanks to