musixmatch Namespace Reference

Namespaces

 album
 
 api
 
 artist
 
 base
 
 lyrics
 
 subtitle
 
 track
 
 ws
 

Functions

def url_call (url)
 
def download_file (file_url, file_name)
 
def get_trackid_from_text_search (title, artistname='')
 
def get_preview_from_trackid (trackid)
 

Variables

string __author__ = "Luca De Vitis <luca@monkeython.com>"
 
string __version__ = '0.9'
 
string __copyright__ = "2011, %s "
 
string __license__
 
string __doc__
 
string __docformat__ = 'restructuredtext en'
 
list __classifiers__
 
list __all__
 
 apikey = os.environ.get('musixmatch_apikey', None)
 
 format = os.environ.get('musixmatch_format', 'json')
 
string newapikey = '82be3ea3f79ea404d45f47607c103eff'
 
 song_wakeMeUp = musixmatch.ws.track.search(q_lyrics = 'wake me up',f_lyrics_language='en',s_track_rating='desc',format ='json',apikey=newapikey)
 
string DIGITAL7_API_KEY = '7dbpa63h3y3d'
 
 tracktitle
 
 trackid
 
 audio_url = get_preview_from_trackid(trackid)
 
string file_name = tracktitle+u'.mp3'
 
string path_name = './'
 
 mp3 = download_file(audio_url, path_name)
 
 chart = musixmatch.ws.track.chart.get(country='it', apikey=apikey)
 
 lyrics = musixmatch.ws.track.lyrics.get('Sexy and I know it',apikey=apikey)
 

Function Documentation

def musixmatch.download_file (   file_url,
  file_name 
)

Definition at line 55 of file musixmatch-master/musixmatch.py.

def musixmatch.get_preview_from_trackid (   trackid)
    ***This method is from get_preview_url.py by Thierry Bertin-Mahieux***
    Ask for the preview to a particular track, get the XML answer
    After calling the API with a given track id,
    we get an XML response that looks like:
    
    <response status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd">
    <url>
    http://previews.7digital.com/clips/34/6804688.clip.mp3
    </url>
    </response>
    
    We parse it for the URL that we return, or '' if a problem

Definition at line 93 of file musixmatch-master/musixmatch.py.

def musixmatch.get_trackid_from_text_search (   title,
  artistname = '' 
)
    ***This method is from get_preview_url.py by Thierry Bertin-Mahieux***
    Search for an artist + title using 7digital search API
    Return None if there is a problem, or tuple (title,trackid)

Definition at line 67 of file musixmatch-master/musixmatch.py.

def musixmatch.url_call (   url)
***This method is from get_preview_url.py by Thierry Bertin-Mahieux***
Do a simple request to the 7digital API
We assume we don't do intense querying, this function is not robust
Return the answer as na xml document

Definition at line 42 of file musixmatch-master/musixmatch.py.

Referenced by get_preview_from_trackid(), and get_trackid_from_text_search().

Variable Documentation

list musixmatch.__all__
private
Initial value:
1 = [
2  'ws', 'api', 'base',
3  'artist', 'track', 'lyrics', 'subtitle', 'album'
4 ]

Definition at line 38 of file musixmatch-master/build/lib/musixmatch/__init__.py.

string musixmatch.__author__ = "Luca De Vitis <luca@monkeython.com>"
private
list musixmatch.__classifiers__
private
Initial value:
1 = [
2  'Development Status :: 4 - Beta',
3  'Intended Audience :: Developers',
4  'License :: OSI Approved :: GNU General Public License (GPL)',
5  'Operating System :: OS Independent',
6  'Topic :: Internet :: WWW/HTTP',
7  'Topic :: Software Development :: Libraries',
8 ]

Definition at line 30 of file musixmatch-master/build/lib/musixmatch/__init__.py.

string musixmatch.__copyright__ = "2011, %s "
private
string musixmatch.__doc__
private
Initial value:
1 = """
2 :abstract: Python interface to Musixmatch API
3 :version: %s
4 :author: %s
5 :organization: Monkeython
6 :contact: http://www.monkeython.com
7 :copyright: %s
8 """

Definition at line 21 of file musixmatch-master/build/lib/musixmatch/__init__.py.

string musixmatch.__docformat__ = 'restructuredtext en'
private
string musixmatch.__license__
private
Initial value:
1 = """
2  Copyright (C) %s
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 """

Definition at line 5 of file musixmatch-master/build/lib/musixmatch/__init__.py.

string musixmatch.__version__ = '0.9'
private
string musixmatch.apikey = os.environ.get('musixmatch_apikey', None)
musixmatch.audio_url = get_preview_from_trackid(trackid)

Definition at line 125 of file musixmatch-master/musixmatch.py.

musixmatch.chart = musixmatch.ws.track.chart.get(country='it', apikey=apikey)

Definition at line 9 of file musixmatch.py.

string musixmatch.DIGITAL7_API_KEY = '7dbpa63h3y3d'

Definition at line 40 of file musixmatch-master/musixmatch.py.

musixmatch.file_name = tracktitle+u'.mp3'

Definition at line 127 of file musixmatch-master/musixmatch.py.

musixmatch.format = os.environ.get('musixmatch_format', 'json')
musixmatch.lyrics = musixmatch.ws.track.lyrics.get('Sexy and I know it',apikey=apikey)

Definition at line 12 of file musixmatch.py.

string musixmatch.newapikey = '82be3ea3f79ea404d45f47607c103eff'

Definition at line 15 of file musixmatch-master/musixmatch.py.

string musixmatch.path_name = './'

Definition at line 134 of file musixmatch-master/musixmatch.py.

musixmatch.song_wakeMeUp = musixmatch.ws.track.search(q_lyrics = 'wake me up',f_lyrics_language='en',s_track_rating='desc',format ='json',apikey=newapikey)

Definition at line 21 of file musixmatch-master/musixmatch.py.

musixmatch.trackid

Definition at line 123 of file musixmatch-master/musixmatch.py.

musixmatch.tracktitle

Definition at line 123 of file musixmatch-master/musixmatch.py.