sunlight.capitolwords

For every day Congress is in session, Capitol Words visualizes the most frequently used words in the Congressional Record, giving you an at-a-glance view of which issues lawmakers address on a daily, weekly, monthly and yearly basis. Capitol Words lets you see what are the most popular words spoken by lawmakers on the House and Senate floor.

CapitolWords

class sunlight.services.capitolwords.CapitolWords[source]

Bindings into the CapitolWords project. Keep in mind, as you use this wrapper, that this is a very thin translation layer from the API into Python. There’s no object magic, so the docs on the API it’s self will be as useful as any of these docstrings.

Feel free to read up on the CapitolWords API in the docs.

If a request goes through and gets a normal response code, but the requested action is for whatever reason errorful, a sunlight.errors.InvalidRequestException will be thrown with the error string.

dates(phrase, **kwargs)[source]

Retrieve information regarding the popularity of a phrase over a period of time.

For a list of optional arguments see Capitol Words’ dates.json endpoint.

phrases(entity_type, entity_value, **kwargs)[source]

Retrieve information on the top phrases for an facet.

A facet can be any date, month, state or legislator.

For a list of arguments see Capitol Words’ phrases.json endpoint.

phrases_by_entity(entity_type, **kwargs)[source]

Get listing of top facets for a given phrase.

A facet can be any date, month, state or legislator.

For a list of arguments see Capitol Words’ phrases/entity.json endpoint.

text(phrase=None, title=None, **kwargs)[source]

Full text-search against Capitol Words data.

Neither phrase nor title are required, but one or the other must be used. If both are omitted, a sunlight.errors.BadRequestException will be thrown.

phrase will do a full-text search on that phrase, whereas title will doa full-text search on the title of each CR (Congressional Record) document.

For a list of arguments see Capitol Words’ text.json endpoint.