Skip to main content

Parse the title of a YouTube video to try and get artist & song name

Project description

PyPI version shields.io PyPI license PyPI status youtube_title_parse CI

youtube title parse

Parse the title of a YouTube video to try and get artist & song name.

Description

Video titles on YouTube follow no strict format, and so passing the titles directly to music APIs to fetch metadata hardly works. This module attempts to recognize common patterns (using regex) and extract artist and song name.

Installation

To install youtube_title_parse, simply use pipenv (or pip, of course):

pipenv install youtube_title_parse

Usage

CLI

youtube_title_parse comes with a CLI that you can use directly:

$ youtube_title_parse "Seoul - Stay With Us (Official Video)"
Seoul - Stay With Us

Module

You can also import youtube_title_parse as a module.

from youtube_title_parse import get_artist_title

artist, title = get_artist_title("Seoul - Stay With Us (Official Video)")
assert artist == "Seoul"
assert title == "Stay With Us"

Credits

This module is originally a Python3 rewrite of the equivalent npm library, get-artist-title, but adds some extra functionality to catch more patterns.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

License

youtube-title-parse is made available under the MIT license.

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

youtube_title_parse-1.0.0.tar.gz (13.5 kB view hashes)

Uploaded Source

Built Distribution

youtube_title_parse-1.0.0-py2.py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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