| 1 | {{{ |
| 2 | #!rst |
| 3 | ==================== |
| 4 | Django's data portal |
| 5 | ==================== |
| 6 | |
| 7 | Inspired by David Eaves, here's some information on accessing Django's |
| 8 | contribution data. |
| 9 | |
| 10 | .. contents:: What's available: |
| 11 | |
| 12 | Please take it, mash it up, and let show us the results! |
| 13 | |
| 14 | If there's other data you'd like to see, please get in touch (``jacob -at- jacobian.org``) and let me know what you'd like to see. I'll do my best! |
| 15 | |
| 16 | Trac's database |
| 17 | =============== |
| 18 | |
| 19 | Data dumps out of Trac, our ticket tracking software. |
| 20 | |
| 21 | There's two ways to access the data: `Trac's RPC interface`_ and the `daily |
| 22 | data dumps`_. |
| 23 | |
| 24 | Trac's RPC interface |
| 25 | -------------------- |
| 26 | |
| 27 | Trac has a XML-RPC and JSON-RPC interface. You view some documentation of these |
| 28 | APIs at:: |
| 29 | |
| 30 | https://code.djangoproject.com/xmlrpc |
| 31 | |
| 32 | .. note:: |
| 33 | |
| 34 | **You'll need to be logged in to access this page** and to access the data. If you need to create an account, the sign-up page is at https://www.djangoproject.com/accounts/register/. |
| 35 | |
| 36 | The base URLs you'll use for for the XML-RPC and JSON-RPC APIs is:: |
| 37 | |
| 38 | https://{username}:{password}@code.djangoproject.com/login/rpc |
| 39 | |
| 40 | The easiest way to access these APIs is with Python's `xmlrpclib`_ library. |
| 41 | Here's a quick example:: |
| 42 | |
| 43 | >>> import xmlrpclib |
| 44 | >>> rpc_url = "https://USERNAME:PASSWORD@code.djangoproject.com/login/rpc" |
| 45 | >>> trac = xmlrpclib.ServerProxy(rpc_url) |
| 46 | |
| 47 | # Get a single ticket's info. |
| 48 | >>> ticket, time_created, time_changed, attributes = trac.ticket.get(1337) |
| 49 | >>> attributes['resolution'] |
| 50 | 'wontfix' |
| 51 | |
| 52 | # Perform a search. - counts the open (i.e. not-closed) tickets. |
| 53 | # Query syntax is documented at http://trac.edgewall.org/wiki/TracQuery#QueryLanguage |
| 54 | >>> not_closed = trac.ticket.query('status=!closed&max=5000') |
| 55 | >>> len(not_closed) |
| 56 | 1850 |
| 57 | |
| 58 | Please be careful here. There are APIs that write data and using them could |
| 59 | look like spam, so please ask me (``jacob -at- jacobian.org``) for permission |
| 60 | first! |
| 61 | |
| 62 | .. _xmlrpclib: http://docs.python.org/library/xmlrpclib.html |
| 63 | |
| 64 | Daily data dumps |
| 65 | ---------------- |
| 66 | |
| 67 | These are direct data dumps of the Trac database, collected nightly, in various |
| 68 | formats. They're sanitized to remove some tables with senstive info (session |
| 69 | data, etc.) but are otherwise complete. |
| 70 | |
| 71 | Dumps are currently available in the following formats: |
| 72 | |
| 73 | * CSV_ (tar'd & bzipped directory; one CSV file per table; ~35MB). |
| 74 | |
| 75 | .. _csv: https://www.djangoproject.com/m/data/django-trac-csv.tar.bz2 |
| 76 | |
| 77 | The database schema is documented at |
| 78 | http://trac.edgewall.org/wiki/TracDev/DatabaseSchema. The most interesting |
| 79 | tables are probabably the ``ticket`` and ``ticket_change`` tables. |
| 80 | ``ticket_change``, in particular, contains each change ever made to a ticket |
| 81 | and so probably has some of the most itnersting data available. |
| 82 | |
| 83 | Mashups |
| 84 | ======= |
| 85 | |
| 86 | If you create a mashup, please add it here! |
| 87 | |
| 88 | * `Django Development Dashboard`_ (by JKM). |
| 89 | |
| 90 | .. _django development dashboard: http://dddash.ep.io/ |
| 91 | |
| 92 | Questions? |
| 93 | ========== |
| 94 | |
| 95 | If you've got questions, please contact JKM (``jacob -at- jacobian.org``). |
| 96 | |
| 97 | }}} |