Skip to main content

amalgama scraper

Project description

Amalgama-pq

image image image Build Status codecov

Amalgama lyrics scraping

Requirements

  • Python 3.5 and up

Installation

from PyPI

$ pip install amalgama

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-pq
$ python setup.py install

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

Using Poetry

$ poetry install

run tests

$ poetry run pytest

or Pipenv

$ pipenv install --dev -e .

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.

Source Distribution

amalgama-0.2.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

amalgama-0.2.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file amalgama-0.2.3.tar.gz.

File metadata

  • Download URL: amalgama-0.2.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0b4 CPython/3.7.1 Linux/5.3.0-19-generic

File hashes

Hashes for amalgama-0.2.3.tar.gz
Algorithm Hash digest
SHA256 47faaa09d250187798c1f48cd53708338606eadb049bdb98e98b2d09849d7584
MD5 97e122d990b61f9df4e7411b67707914
BLAKE2b-256 1ecd6493004738b184546b2399834ecb0093a90bc758f72f053e1d29ae0f9c04

See more details on using hashes here.

File details

Details for the file amalgama-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: amalgama-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0b4 CPython/3.7.1 Linux/5.3.0-19-generic

File hashes

Hashes for amalgama-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 51bf50fc281f9509dbc181952a6e33cadc4f8dbbce5881f9efe8f9d11dfa5db3
MD5 710165517fb2967b5edd614a2b515ee4
BLAKE2b-256 1b901054449046c28fc478e69eef1c8d0398ea5d4b002427e027313e654e197c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page