Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

amalgama scraper

Project description

Amalgama-pq

image image image Build Status codecov

Amalgama lyrics scraping

Installation

from PyPI

$ pip install 

from git repository

$ pip install git+https://github.com/andriyor/amalgama-pq.git#egg=amalgama-pq

from source

$ git clone https://github.com/andriyor/amalgama-pq.git
$ cd amalgama
$ python setup.py install

Requirements

  • Python 3.6 and up

Usage

import requests

import amalgama

artist, song = 'Pink Floyd', 'Time'
url = amalgama.get_url(artist, song)
try:
    response = requests.get(url)
    response.raise_for_status()
    text = amalgama.get_first_translate_text(response.text)
    print(f'{text}{url}')
except requests.exceptions.HTTPError:
    print(f'{artist}-{song} not found in amalgama {url}')

Expected output

Time (оригинал Pink Floyd)

Ticking away the moments that make up a dull day
You fritter and waste the hours in an off hand way
Kicking around on a piece of ground in your home town
Waiting for someone or something to show you the way
...

Время (перевод Дмитрий Попов из Новокузнецка)

Тикают секунды, наполняя скучный день,
Ты разбрасываешься по мелочам и понапрасну тратишь время,
Вертишься вокруг клочка земли родного города,
В ожидании, что кто-то или что-то укажет тебе путь.
...

Development setup

Install Pipenv

$ pipenv install --dev -e .

or Poetry

$ poetry install

run tests

$ poetry run pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
amalgama-0.2.1-py3-none-any.whl (6.7 kB) Copy SHA256 hash SHA256 Wheel py3
amalgama-0.2.1.tar.gz (4.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page