Skip to content

Commit

Permalink
Updated index page.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan Phelps-Goodman committed Mar 18, 2011
1 parent 7e213f5 commit 425cbcf
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 94 deletions.
74 changes: 0 additions & 74 deletions README.rst
Expand Up @@ -22,77 +22,3 @@ python >= 2.4

simplejson >= 1.8 (not required with Python 2.6, will use built-in ``json`` module)

Usage
=====

To initialize the api, all that is required is for it to be imported and for an
API key to be defined.

(If you do not have an API key visit http://services.sunlightlabs.com/api/ to
register for one.)

Import TransparencyData class and set your API key:

>>> from transparencydata import TransparencyData
>>> td = TransparencyData('sunlight-api-key')

-------------------
Parameter Operators
-------------------

Some parameters allow multiple values or greater than, less than, or between operations. We allow operators to be added similar to the method used by the Django ORM. The operator is appended to the end of the parameter name using double underscore.

>>> td.contributions(amount=100) # contributions equal to 100 dollars
>>> td.contributions(amount__lt=100) # contributions less than 100 dollars

>>> td.contributions(cycle=1990) # contributions from the 1990 election cycle
>>> td.contributions(cycle__in=(1990,2008)) # contributions from the 1990 and 2008 election cycles

gt
Greater than specified value.

lt
Less than specified value.

between
Between the lesser value and greater value. Parameters must be passed as a two-value tuple or list.

>>> td.contributions(date__between=(start_date, end_date))

in
Matches any in a range of values. Parameter must be a tuple or list.


See the parameter documentation (http://transparencydata.com/api/) to find out which operators are valid for each parameter.

----------------------
Campaign Contributions
----------------------

To find all contributions to Chris Van Hollen from the state of CA during the 2008 election cycle:

>>> td.contributions(cycle=2008, contributor_state='CA', recipient_ft='van hollen')

A list of valid contributions parameters can be accessed programmatically:

>>> print td.contributions.parameters

Parameter documentation: http://transparencydata.com/api/#contributions

Response documentation: http://transparencydata.com/docs/#contributions

--------
Lobbying
--------

To find all lobbying conducted by John Wonderlich:

>>> td.lobbying(lobbyist_ft='john wonderlich')

A list of valid lobbying parameters can be accessed programmatically:

>>> print td.lobbying.parameters

Parameter documentation: http://transparencydata.com/api/#lobbying

Response documentation: http://transparencydata.com/docs/#lobbying
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/influenceexplorer.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/transparencydata.doctree
Binary file not shown.
17 changes: 17 additions & 0 deletions docs/_build/html/_sources/influenceexplorer.txt
@@ -1,18 +1,35 @@
Influence Explorer API
======================


.. automodule:: influenceexplorer

.. autoclass:: influenceexplorer.InfluenceExplorer

----------------------
General Entity Methods
----------------------

.. autoclass:: influenceexplorer.Entities()
:members:

------------------
Politician Methods
------------------

.. autoclass:: influenceexplorer.Politician()
:members:

--------------------
Organization Methods
--------------------

.. autoclass:: influenceexplorer.Organization()
:members:

------------------
Individual Methods
------------------

.. autoclass:: influenceexplorer.Individual()
:members:
12 changes: 6 additions & 6 deletions docs/_build/html/_sources/transparencydata.txt
@@ -1,9 +1,9 @@
Transparency Data API
=====================

-----
Usage
=====

-----

The TransparencyData class is constructed with your API key as an initialization parameter:

Expand Down Expand Up @@ -98,11 +98,11 @@ Federal Grants

To find all grants made by the NEA in 2010:

>>> api.grants(agency_ft='national endowment for the arts', fiscal_year='2010')
>>> td.grants(agency_ft='national endowment for the arts', fiscal_year='2010')

A list of valid grant parameters can be accessed programmatically:

>>> api.grants.parameters
>>> td.grants.parameters

Parameter documentation: http://transparencydata.com/api/grants/

Expand All @@ -115,11 +115,11 @@ Federal Contracts

To find all federal contracts issued to Bank of America:

>>> api.contracts(vendor_name='bank of america')
>>> td.contracts(vendor_name='bank of america')

A list of valid contract parameters can be accessed programmatically:

>>> api.contracts.parameters
>>> td.contracts.parameters

Parameter documentation: http://transparencydata.com/api/contracts

Expand Down
12 changes: 9 additions & 3 deletions docs/_build/html/index.html
Expand Up @@ -60,8 +60,8 @@ <h1>python-transparencydata&#8217;s documentation<a class="headerlink" href="#py
More data sets will be added over time.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="transparencydata.html">Transparency Data API</a></li>
<li class="toctree-l1"><a class="reference internal" href="transparencydata.html#usage">Usage</a><ul>
<li class="toctree-l1"><a class="reference internal" href="transparencydata.html">Transparency Data API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="transparencydata.html#usage">Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="transparencydata.html#parameter-operators">Parameter Operators</a></li>
<li class="toctree-l2"><a class="reference internal" href="transparencydata.html#campaign-contributions">Campaign Contributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="transparencydata.html#lobbying">Lobbying</a></li>
Expand All @@ -70,7 +70,13 @@ <h1>python-transparencydata&#8217;s documentation<a class="headerlink" href="#py
<li class="toctree-l2"><a class="reference internal" href="transparencydata.html#federal-contracts">Federal Contracts</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="influenceexplorer.html">Influence Explorer API</a></li>
<li class="toctree-l1"><a class="reference internal" href="influenceexplorer.html">Influence Explorer API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="influenceexplorer.html#general-entity-methods">General Entity Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="influenceexplorer.html#politician-methods">Politician Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="influenceexplorer.html#organization-methods">Organization Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="influenceexplorer.html#individual-methods">Individual Methods</a></li>
</ul>
</li>
</ul>
</div>
</div>
Expand Down
23 changes: 23 additions & 0 deletions docs/_build/html/influenceexplorer.html
Expand Up @@ -64,6 +64,8 @@ <h3>Navigation</h3>
</div>
</dd></dl>

<div class="section" id="general-entity-methods">
<h2>General Entity Methods<a class="headerlink" href="#general-entity-methods" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="influenceexplorer.Entities">
<em class="property">class </em><tt class="descclassname">influenceexplorer.</tt><tt class="descname">Entities</tt><a class="reference internal" href="_modules/influenceexplorer.html#Entities"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#influenceexplorer.Entities" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -151,6 +153,9 @@ <h3>Navigation</h3>

</dd></dl>

</div>
<div class="section" id="politician-methods">
<h2>Politician Methods<a class="headerlink" href="#politician-methods" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="influenceexplorer.Politician">
<em class="property">class </em><tt class="descclassname">influenceexplorer.</tt><tt class="descname">Politician</tt><a class="reference internal" href="_modules/influenceexplorer.html#Politician"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#influenceexplorer.Politician" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -206,6 +211,9 @@ <h3>Navigation</h3>

</dd></dl>

</div>
<div class="section" id="organization-methods">
<h2>Organization Methods<a class="headerlink" href="#organization-methods" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="influenceexplorer.Organization">
<em class="property">class </em><tt class="descclassname">influenceexplorer.</tt><tt class="descname">Organization</tt><a class="reference internal" href="_modules/influenceexplorer.html#Organization"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#influenceexplorer.Organization" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -320,6 +328,9 @@ <h3>Navigation</h3>

</dd></dl>

</div>
<div class="section" id="individual-methods">
<h2>Individual Methods<a class="headerlink" href="#individual-methods" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="influenceexplorer.Individual">
<em class="property">class </em><tt class="descclassname">influenceexplorer.</tt><tt class="descname">Individual</tt><a class="reference internal" href="_modules/influenceexplorer.html#Individual"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#influenceexplorer.Individual" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -372,6 +383,7 @@ <h3>Navigation</h3>

</dd></dl>

</div>
</div>


Expand All @@ -380,6 +392,17 @@ <h3>Navigation</h3>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Influence Explorer API</a><ul>
<li><a class="reference internal" href="#general-entity-methods">General Entity Methods</a></li>
<li><a class="reference internal" href="#politician-methods">Politician Methods</a></li>
<li><a class="reference internal" href="#organization-methods">Organization Methods</a></li>
<li><a class="reference internal" href="#individual-methods">Individual Methods</a></li>
</ul>
</li>
</ul>

<h4>Previous topic</h4>
<p class="topless"><a href="transparencydata.html"
title="previous chapter">Transparency Data API</a></p>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 425cbcf

Please sign in to comment.