Table of Contents
Say you want to
- edit the tags of all the songs in a folder
- plot 2D/3D or even 4D points
- fetch the RSS feed of a YouTube channel
- generate tests code for a module
If you want to do this stuff in a fast and easy way, this library is for you
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"
audio.save()
from hal.files.models.system import ls_recurse
from hal.files.models.audio import MP3Song
my_folder = "path to folder containing songs"
for file in ls_recurse(my_folder):
MP3Song(file).set_artist("An example")
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(1., 100.)
y = np.sin(x)
plt.plot(x, y)
plt.show()
import numpy as np
from hal.charts.plotter import Plot2d
Plot2d().plot(np.sin, 1, 100, 100)
No easy way that I know of
from hal.internet.services.youtube 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()
No easy way that I know of
from hal.tests.gen import TestWriter
src = "path to module source folder"
out = "path to output folder"
w = TestWriter(src)
w.write_tests(out)
$ pip install -r https://raw.githubusercontent.com/sirfoga/pyhal/master/requirements.txt
$ pip install -r https://raw.githubusercontent.com/sirfoga/pyhal/master/requirements_dev.txt
Different ways, all equals
$ pipenv install .
$ make install
$ pip3 install PyHal
$ make pip-install
$ pip install git+https://github.com/sirfoga/pyhal/ # use GitHub for the latest release
make fast-init
just copies source files to distribution files ... run it only if you're sure about dependencies
Browse the online documentation here](https://pyhal.readthedocs.io/en/latest/)
or make your own by make docs
- open an issue
- fork this repository
- create your feature branch (
git checkout -b my-new-feature
) - commit your changes (
git commit -am 'Added my new feature'
) - publish the branch (
git push origin my-new-feature
) - open a PR
Suggestions and improvements are welcome!
Stefano Fogarollo |