|
GettingStarted
Downloading and installing the Python client library.
Featured This client library helps you work with social network data from your web server. This document will help explain where you can obtain the files for the client library, and how to use them in your own projects. Obtaining the client libraryThere are two options for obtaining the files for the client library. Obtaining the pre-packaged releaseMost developers will want to use the pre-packaged release, which is released according to the project roadmap and will be the most stable version of the library. To download the library, go to the Downloads tab. The most recent release of the library will be listed, typically with a few different archive types (.zip, .tar.gz, .tar.bz). There is no difference between the different archive formats - please select one supported by your operating system. After extracting the library from the archive, you will have a new opensocial-python-client directory. The library files themselves are in the opensocial-python-client/src/opensocial directory. Obtaining the most up-to-date version from SVNThe most up-to-date version of the code is available from this project's SVN repository. Obtaining the code this way is intended for developers looking for fixes or features that have not been released in the pre-packaged version, or for developers who want to contribute patches back to the project. Obtain the code by using the following SVN checkout command (you will need an SVN client installed on your computer): svn checkout http://opensocial-python-client.googlecode.com/svn/trunk/ opensocial-python-client After checking out the code, you will have a new opensocial-python-client directory. The library files themselves are in the opensocial-python-client/src/opensocial directory. What to do with the filesAfter obtaining the library in either of the ways described above, you will have a directory named opensocial-python-client somewhere on your filesystem, containing a file named setup.py. Install the library as a Python moduleTo install the library as a system module, run python setup.py install Once installed, you will be able to import the opensocial module in your scripts by using the following: import opensocial Copy the opensocial directory into your projectIn certain cases, you will not be able to install the OpenSocial client library as a system module (for example, App Engine). You can include a copy of the src/opensocial directory for each project you write. For example, if your project structure looks like this: myproject/
|- myproject.pyCopy the opensocial-python-client/src/opensocial directory into the myproject directory. You can then add the following code to myproject.py to include the client library: import opensocial Running Unit TestsTo run all unit tests, simply run the following from the /tests directory: python run_all_tests.py | |
A Debian GNU/Linux package is available at http://opensocial.pokersource.info/ and should show up around August 2009 in the official repositories (see the corresponding ITP at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=536603 )