You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Python wrapper for the [Sunlight Foundation's Real Time
5
+
Congress API](http://services.sunlightlabs.com/docs/Real_Time_Congress_API/).
21
6
7
+
Sunlight Labs takes government data and transforms it into services developers can use. The Real Time Congress (RTC) API is a RESTful API over the artifacts of Congress, in as close to real-time as possible.
22
8
9
+
**WARNING**: This may create a more transparent government. If you don't want change then stop reading here.
23
10
24
11
Requirements
25
12
------------
26
13
- python >= 2.6
27
-
- unittest2
28
-
29
-
Use the following command to clone the repository locally to work on it:
- dict2obj is a function that coverts the json converted dictionary into a usable object. Since much of the RTC API's fields are not guaranteed, this may help avoid the extra coding for keyErrors. Additionally, it is convenient to use dot notation instead of dictionaries.
44
+
45
+
- Fork the project.
46
+
- Read through the outstanding issues, or report new ones
- Enter helper text into the **RTC_helpers.py** after writing a new
53
+
classmethod to help document what you've done.
54
+
- Send us a pull request.
63
55
64
56
###How to create class methods for collections
65
57
This is the basic structure:
@@ -79,25 +71,30 @@ class Bill(RTC_Client): #name of collection (eg: bills, videos, floor, updates)
79
71
80
72
81
73
### Running tests
82
-
Set your PYTHONPATH to the top-level directory--the one containing the RTC.py file. In *nix-land, do this:
74
+
Make sure you have the **discover** package installed. It is included in our
75
+
**requirements.txt**, which you can install with this command:
76
+
83
77
<code>
84
-
$ export PYTHONPATH=/path/to/top/level/directory
78
+
$ pip install -r requirements.txt
85
79
</code>
86
-
In Windows-land, do something like this:
80
+
81
+
Then, in the project directory you can run all the tests with:
82
+
87
83
<code>
88
-
PYTHONPATH=%path%;\path\to\top\level\directory
84
+
$ python -m discover
89
85
</code>
90
86
91
-
You can run individual tests like this:
87
+
You can run individual or grouped tests based on patterns:
92
88
<code>
93
-
$ python tests/TestRTC.py
89
+
$ python -m discover -p 'test_videos.py'
94
90
</code>
95
91
96
-
Also, you can run all tests like this:
92
+
or
93
+
97
94
<code>
98
-
$ python tests
95
+
$ python -m discover -p '*.py'
99
96
</code>
100
97
101
-
### Other comments
102
-
- It'd be helpful to enter helper text into the RTC_helpers.py after writing a new classmethod
103
-
- It'd be helpful to write some tests after writing a new classmethod. See "tests/dummy.py" to get started.
98
+
### Development Notes for Contributors
99
+
**dict2obj** is a function that coverts the json converted dictionary into a usable object. Since much of the RTC API's fields are not guaranteed, this may help avoid the extra coding for keyErrors. Additionally, it is convenient to use dot notation instead of dictionaries.
0 commit comments