This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A simple Python wrapper for the Nobel Prize API.

Quickstart

First, initialize the API wrapper:

import nobel
api = nobel.Api()

Now you have access to the resources defined by the API (prizes, laureates and countries) and their methods.

For example, to list all laureates:

>>> for laureate in api.laureates.all():
...     print '%s (%s)' % (laureate, laureate.born_country)

To filter (check the Nobel Prize API documentation for all available filtering parameters):

>>> api.laureates.filter(gender='female', born_country='Iran')
[<Laureate id=773>, <Laureate id=817>]
>>> api.prizes.filter(year=1969)
[<Prize category="physics" year=1969>, <Prize category="chemistry" year=1969>,
<Prize category="medicine" year=1969>, <Prize category="literature" year=1969>,
<Prize category="peace" year=1969>, <Prize category="economics" year=1969>]

To retrieve a single resource:

>>> laureate = api.laureates.get(id=26)
>>> laureate.firstname
u'Albert'
>>> laureate.surname
u'Einstein'
>>> laureate.prizes
[<Prize category="physics" year=1921>]
>>> laureate.born_country
<Country code="DE" name="Germany">
>>> laureate.died_country
<Country code="US" name="USA">

>>> prize = api.prizes.get(year=2000, category='economics')
>>> print ", ".join([str(l) for l in prize.laureates])
James J. Heckman, Daniel L. McFadden

As you can see, every Prize object is given a laureates attribute populated with a list of its Laureate objects. Likewise, every Laureate objects is given a prizes attribute with Prize objects.

Attributes and query parameters in the Nobel Prize API are mixedCase, but this wrapper uses the more pythonic lower_case_with_underscores style and takes care of the conversion when filtering and accessing attributes.

Installation

To install Nobel, simply:

$ pip install nobel

TODO

  • Documentation and full reference
  • Tests
  • More ORM-ish stuff, like filtering using Prize, Laureate or Country objects as arguments
  • Add relation attributes, like affiliations.

Credits

This is inspired by the beautifully written hipchat-api wrapper.

Release History

Release History

0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1a

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
nobel-0.2.tar.gz (6.0 kB) Copy SHA256 Checksum SHA256 Source Aug 30, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting