Skip to main content

Music online charts.

Project description

mochart

CircleCI

mochart(music on chart) is a simple webpage parser that aims to retrieve song rankings in JSON compatible data format.

Installation

A simple pip install:

pip install mochart

Example

Realtime ranks from Melon:

from mochart import melon
ranks = melon.realtime()
print(ranks)

At the time of this writing, the code would print:

[{
	"title": "SOLO",
	"artist": "제니 (JENNIE)",
	"album": "SOLO"
}, {
	"title": "봄바람",
	"artist": "Wanna One (워너원)",
	"album": "1¹¹=1 (POWER OF DESTINY)"
}, {
	"title": "Tempo",
	"artist": "EXO",
	"album": "DON`T MESS UP MY TEMPO - The 5th Album"
}, {
	"title": "YES or YES",
	"artist": "TWICE (트와이스)",
	"album": "YES or YES"
}, {
	"title": "너를 만나",
	"artist": "폴킴",
	"album": "너를 만나"
}, {
	"title": "아름답고도 아프구나",
	"artist": "비투비",
	"album": "HOUR MOMENT"
}, {
	"title": "Gravity",
	"artist": "EXO",
	"album": "DON`T MESS UP MY TEMPO - The 5th Album"
}...]

feat. 아이돌전쟁

API

All functions in a provider(e.g. Melon) will return Python List that contains music information in order of its ranking.

Generally, a rank contains title, aritst, and album in string format as seen above.

Not all providers support the these functions.

realtime

Return the most current ranks at the time of query.

trend

Return songs that are trending at the time of query.

day

Return ranks given day.

week

Return ranks given week.

month

Return ranks given month.

year

Return ranks given year.

Datetime

Given datetime object will be converted into a local datetime for the provider. For example A datetime given to melon.day(today), the argument today will be converted to Asia/Seoul timezone before the query.

Note that if incorrect time is given to any function, it could return either an empty array or ranks of the closest date.

Also, if no datetime object is provided as an argument, the current time will be used in the query.

Contribution

You are more than welcome to contribute a new chart and/or ideas on this project.

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

mochart-0.1.1.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file mochart-0.1.1.tar.gz.

File metadata

  • Download URL: mochart-0.1.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for mochart-0.1.1.tar.gz
Algorithm Hash digest
SHA256 039fc07b782427cdb7507ebea4919bfaab0f17eafc97b0ad697f28fd4ab20e2d
MD5 4d08f73a800310b12a0889a23fa07637
BLAKE2b-256 4cacaf30a20e39ad17a74a55b7b085bb8bf0e7ad65989121bae17d7c5d9a83b2

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