Skip to main content

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.

Source Distribution

amalgama-0.2.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amalgama-0.2.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amalgama-0.2.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.7.0 Linux/4.15.0-20-generic

File hashes

Hashes for amalgama-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6f4decc4c2472673322cc84325c1c52f56f6b348ec000580068c3a8ef2a774a0
MD5 423fac66daec830dff43d5bfb1ff8e3a
BLAKE2b-256 c13c453736887e0edef625290561b91ec8bc86892c03243d9ba6bc6f861015e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amalgama-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.7.0 Linux/4.15.0-20-generic

File hashes

Hashes for amalgama-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92db1c978392756456f5e21900f4e0323b43fe4801fba485f7a7ddf9cf7def3f
MD5 938b80dde19201ff30ccdde6eee95241
BLAKE2b-256 bb4ad31aa265ea18ad4860a21a94fc3696a18b979e2513de365aefc7cb2701ab

See more details on using hashes here.

Supported by

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