Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sloev/spotiflite
Scrapes Spotify and dumps data to a sqlite3 database without auth
https://github.com/sloev/spotiflite
python scraping spotify sqlite
Last synced: about 1 month ago
JSON representation
Scrapes Spotify and dumps data to a sqlite3 database without auth
- Host: GitHub
- URL: https://github.com/sloev/spotiflite
- Owner: sloev
- License: mit
- Created: 2020-04-05T02:15:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-02T21:40:47.000Z (about 4 years ago)
- Last Synced: 2024-09-30T02:04:58.728Z (about 2 months ago)
- Topics: python, scraping, spotify, sqlite
- Language: Python
- Homepage:
- Size: 102 KB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spotiflite
[![Build Status](https://travis-ci.com/sloev/spotiflite.svg?branch=master)](https://travis-ci.com/sloev/spotiflite) [![Latest Version](https://img.shields.io/pypi/v/spotiflite.svg)](https://pypi.python.org/pypi/spotiflite)
*(For the hosted api version checkout [spotiflite on rapidapi](https://rapidapi.com/sloev/api/spotiflite/endpoints) sourcecode for api is [here](https://github.com/sloev/spotiflite/raw/master/cloudflare/worker.js))*
Scrapes Spotify and dumps data to a sqlite3 database.
* Uses `requests` to make queries, with pythonic user-agent
* sleeps randomly between each HTTP call
* is *NOT* in a hurry to get anywhere
* has nice 80's cli interface## Install
```bash
$ pip install spotiflite
```then go somewhere and setup a database:
```bash
$ spotiflite setup
```you can also specify the db filename:
```bash
$ spotiflite --spotifydb=this/awesome/db setup
```## Usage
For example scrape **Frank ෴ Zappa**
```bash
$ spotiflite scrape 6ra4GIOgCZQZMOaUECftGN
got 44 artist ids
extracted data for Tom Waits
saved data for Tom Waits
got 8 artist ids
extracted data for Elmer Snowden
saved data for Elmer Snowden
got 6 artist ids
extracted data for Wesley Willis
saved data for Wesley Willis
...
```while its running you can get stats in another window
```bash
$ spotiflite stats
rows: 9882
completed: 1395
jobs to do: 8487
DB size: 48.04 MB
```### Cli usage
```bash
Usage: spotiflite.py [OPTIONS] COMMAND [ARGS]...Options:
-db, --spotifydb TEXT sqlite filename [default: spotify.db]
--help Show this message and exit.Commands:
scrape starts scraping from given artist id
setup creates tables
stats print out db stats
teardown deletes tables```