Skip to main content

Genie Music API

Project description

GenieAPI

지니뮤직(genie.co.kr)의 비공식 Python API 래퍼입니다. 이 라이브러리를 사용하면 노래 검색, 실시간 차트 조회, 가사 추출, 그리고 노래 및 앨범의 상세 정보를 쉽게 가져올 수 있습니다.

주요 기능

  • 노래 검색: 검색어를 통해 노래 목록과 메타데이터를 조회합니다.
  • 실시간 차트: Top 200 실시간 차트 순위를 가져옵니다.
  • 노래 상세 정보: 곡의 장르, 재생 시간, 작사/작곡/편곡자 등 상세 정보를 조회합니다.
  • 앨범 상세 정보: 앨범의 아티스트, 발매일, 수록곡 목록(Tracklist) 등을 조회합니다.
  • 가사 추출: 타임스탬프가 포함된 가사 데이터를 가져옵니다.
  • 플레이리스트: 공개된 플레이리스트의 수록곡을 가져옵니다.

설치 방법

이 프로젝트는 Python 3.8 이상을 필요로 하며, 다음 라이브러리에 의존합니다:

pip install requests beautifulsoup4

사용 방법

from genieapi import GenieAPI

genie = GenieAPI()

# 1. 노래 검색
songs = genie.search_song("Ditto")
if songs:
    print(f"검색 결과: {songs[0].title} - {songs[0].artist}")

# 2. 실시간 Top 200 차트 조회
chart = genie.get_chart_top200()
for entry in chart[:5]:
    print(f"{entry.rank}위: {entry.song.title} - {entry.song.artist}")

# 3. 노래 상세 정보 조회
detail = genie.get_song_detail("99570005") # Ditto 의 ID
if detail:
    print(f"제목: {detail.title}, 재생시간: {detail.duration}")
    print(f"작사가: {detail.lyricist}")

# 4. 앨범 상세 정보 조회
album = genie.get_album_detail("83325577") # NewJeans 'OMG' 앨범 ID
if album:
    print(f"앨범명: {album.title}, 아티스트: {album.artist}, 발매일: {album.release_date}")
    print("수록곡 목록:")
    for track in album.tracklist:
        print(f" - {track.title}")

프로젝트 구조

  • genieapi/: 메인 패키지 디렉토리
    • GenieAPI.py: 네트워크 요청 및 API의 메인 엔트리 포인트
    • parsers.py: HTML 파싱 로직을 담당하는 순수 함수 모듈
    • models.py: 데이터 모델 (Song, Album, Lyric, ChartEntry)
    • Error.py: 사용자 정의 예외 클래스

주의사항

이 API는 공식적인 방법이 아닌 웹 스크래핑을 통해 동작하므로, 지니뮤직 사이트의 구조 변경에 따라 동작하지 않을 수 있습니다. 교육 및 연구 목적으로만 사용하시기 바라며, 과도한 요청은 자제해 주세요.

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

genieapi-0.1.4.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

genieapi-0.1.4-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file genieapi-0.1.4.tar.gz.

File metadata

  • Download URL: genieapi-0.1.4.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for genieapi-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6c07445cc8477a3b42fd7305165ded4a46512d8c34c25905221c7d123c6ce276
MD5 2fcc624c4c4e21776bf851e48236bfb6
BLAKE2b-256 9528e5971b2c5504cebd7ffcbd445c7ad96a30db8ed32ead0129a32f2ce6b2b8

See more details on using hashes here.

File details

Details for the file genieapi-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: genieapi-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for genieapi-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b0da5a0a790f06a0c8503552c7f6aacb997718e0b92e38e12e03a26706b49130
MD5 b98a137c2f002b808da8da7c35ed3300
BLAKE2b-256 27658bf54423a0c61c35c5c7df304c8dde97c0c5d8910d45a5562481ff5fc0ce

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