https://github.com/andriyor/amalgama-pq
Amalgama lyrics scraping
https://github.com/andriyor/amalgama-pq
lyrics lyrics-fetcher pyquery scraping
Last synced: 3 months ago
JSON representation
Amalgama lyrics scraping
- Host: GitHub
- URL: https://github.com/andriyor/amalgama-pq
- Owner: andriyor
- License: mit
- Created: 2018-07-23T15:46:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T18:28:09.000Z (about 5 years ago)
- Last Synced: 2026-01-03T23:59:04.099Z (4 months ago)
- Topics: lyrics, lyrics-fetcher, pyquery, scraping
- Language: HTML
- Homepage:
- Size: 127 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Amalgama-pq
[](https://pypi.org/project/amalgama/)
[](https://pypi.org/project/amalgama/)
[](https://pypi.org/project/amalgama/)
[](https://travis-ci.org/Live-Lyrics/amalgama-pq)
[](https://codecov.io/gh/Live-Lyrics/amalgama-pq)
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
```python
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](https://poetry.eustace.io/docs/)
```
$ poetry install
```
run tests
```
$ poetry run pytest
```
or [Pipenv](https://docs.pipenv.org/)
```
$ pipenv install --dev -e .
```
## License
[MIT](https://choosealicense.com/licenses/mit/)