Permalink
Browse files

Initial commit. Some scaffolding and a partially complete README file

  • Loading branch information...
0 parents commit 84e5010fea11dc13c567f2ea605f3da8ba593f4c @paulosman paulosman committed Feb 6, 2012
Showing with 118 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +79 −0 README.rst
  3. +1 −0 requirements.txt
  4. +31 −0 setup.py
  5. +3 −0 soundcloud/__init__.py
  6. +2 −0 soundcloud/tests/__init__.py
@@ -0,0 +1,2 @@
+*.pyc
+*.egg-info
@@ -0,0 +1,79 @@
+=================
+soundcloud-python
+=================
+
+A friendly wrapper around the `Soundcloud API`_. Right now it is just a README file!
+
+.. _Soundcloud API: http://developers.soundcloud.com/
+
+Installation
+------------
+
+To install soundcloud-python, simply: ::
+
+ pip install soundcloud
+
+Or if you're not hip to the pip: ::
+
+ easy_install soundcloud
+
+Basic Use
+---------
+
+To use soundcloud-python, you must first create a `Client` instance, passing at a minimum the client id you obtained when you `registered your app`_: ::
+
+ import soundcloud
+
+ client = soundcloud.Client(client_id=YOUR_CLIENT_ID)
+
+The client instance can then be used to fetch or modify resources: ::
+
+ tracks = client.get('/tracks', order='hotness', limit=10)
+ for track in tracks:
+ print track.title
+ app = client.get('/apps/124')
+ print app.permalink_url
+
+.. _registered your app: http://soundcloud.com/you/apps/
+
+Authentication
+--------------
+
+Examples
+--------
+
+Adding a track to a playlist: ::
+
+ import soundcloud
+
+ client = soundcloud.Client(access_token="a valid access token")
+
+ # get my last playlist
+ playlist = client.get('/me/playlists')[0]
+
+ # get ids of contained tracks
+ track_ids = [t.id for t in playlist.tracks]
+
+ # adding a new track 21778201
+ track_ids.append(21778201)
+
+ # map array of ids to array of track objects:
+ tracks = map(lambda track_id: dict(track_id=track_id), track_ids)
+
+ # send update/put request to playlist
+ playlist = client.put(playlist.uri, playlist={
+ 'tracks': tracks
+ })
+
+ # print the list of track ids of the updated playlist:
+ print [t.id for t in playlist.tracks]
+
+
+Contributing
+------------
+
+Contributions are awesome. You are most welcome to `submit issues`_, `discuss soundcloud-python`_ or `fork the repository`_.
+
+.. _`submit issues`: https://github.com/soundcloud/soundcloud-python/issues
+.. _`discuss soundcloud-python`: https://groups.google.com/group/soundcloudapi
+.. _`fork the repository`: https://github.com/soundcloud/soundcloud-python
@@ -0,0 +1 @@
+nose==1.1.2
@@ -0,0 +1,31 @@
+from setuptools import setup
+
+import soundcloud
+
+setup(
+ name='soundcloud',
+ version=soundcloud.__version__,
+ description='A friendly wrapper library for the Soundcloud API',
+ author='Paul Osman',
+ author_email='osman@soundcloud.com',
+ url='https://github.com/soundcloud/soundcloud-python',
+ license='BSD',
+ packages=['soundcloud'],
+ include_package_data=True,
+ package_data={
+ '': ['README.rst']
+ },
+ setup_requires=[
+ 'nose==1.1.2',
+ ],
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: BSD License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Topic :: Internet',
+ 'Topic :: Multimedia :: Sound/Audio',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ ]
+)
@@ -0,0 +1,3 @@
+"""Python Soundcloud API Wrapper."""
+
+__version__ = '0.1dev'
@@ -0,0 +1,2 @@
+def test_something():
+ assert True

0 comments on commit 84e5010

Please sign in to comment.