Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 setup.py
Octocat-spinner-32 stackpy.py
Octocat-spinner-32 test.py
README.md

What is stackpy?

stackpy is a simple Python wrapper for the StackExchange API v2.

It was written by Kristian Glass for StackCompare.

Currently somewhat alpha.

Getting Started

For the latest stable version:

pip install stackpy

OR for the bleeding edge:

git clone https://github.com/doismellburning/stackpy.git

Examples

Sites

>>> from stackpy import Stackpy
>>> s = Stackpy()
>>> sites = s.sites().items
>>> stackoverflow = [site for site in sites if site.name == 'Stack Overflow'][0]
>>> stackoverflow.site_url
u'http://stackoverflow.com'
>>> stackoverflow.audience
u'professional and enthusiast programmers'

Users

>>> from stackpy import Stackpy
>>> s = Stackpy()
>>> kristian = s.users([928098]).items[0]
>>> kristian.display_name
u'Kristian Glass'

Other StackExchange Sites

>>> from stackpy import Stackpy
>>> s = Stackpy()
>>> kristian = s.users([114764], site='serverfault').items[0]
>>> kristian.display_name
u'Kristian Glass'
Something went wrong with that request. Please try again.