Name | lobbyview JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | LobbyView Rest API Wrapper |
upload_time | 2024-04-01 00:12:23 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.5 |
license | None |
keywords |
politics
lobbying
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# LobbyView Package Documentation
Python wrapper for Lobbyview Rest API; uses same endpoints and parameter names as outlined in the
[LobbyView Rest API Documentation](https://rest-api.lobbyview.org/)
## Class: LobbyViewResponse
Base class for LobbyView API responses.
## Class: LegislatorResponse
Response class for legislator data.
## Class: BillResponse
Response class for bill data.
## Class: ClientResponse
Response class for client data.
## Class: ReportResponse
Response class for report data.
## Class: IssueResponse
Response class for issue data.
## Class: NetworkResponse
Response class for network data.
## Class: TextResponse
Response class for text data.
## Class: QuarterLevelNetworkResponse
Response class for quarter-level network data.
## Class: BillClientNetworkResponse
Response class for bill-client network data.
## Class: LobbyView
Main class for interacting with the LobbyView API.
### Method: __init__
Initialize the LobbyView class with the provided API token.
### Method: get_data
Sends a GET request to the LobbyView API with the provided query string.
Returns the JSON response data.
### Method: legislators
Gets legislator information from the LobbyView API based on the provided parameters.
#### Parameters:
- legislator_id: Unique identifier of the legislator from LobbyView
- legislator_govtrack_id: Unique identifier of the legislator from GovTrack
- legislator_first_name: First name of the legislator
- legislator_last_name: Last name of the legislator
- legislator_full_name: Full name of the legislator
- legislator_gender: Gender of the legislator
- min_birthday: Minimum birthday of the legislator (YYYY-MM-DD)
- max_birthday: Maximum birthday of the legislator (YYYY-MM-DD)
#### Returns:
- LegislatorResponse object containing the legislator data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.legislators(legislator_first_name="John", legislator_last_name="McCain")
>>> output.data[0]['legislator_id']
'M000303'
>>> output = lobbyview.legislators(legislator_id="M000303")
>>> output.data[0]['legislator_full_name']
'John McCain'
```
### Method: bills
Gets bill information from the LobbyView API based on the provided parameters.
#### Parameters:
- congress_number: Session of Congress
- bill_chamber: Chamber of the legislative branch (Component of the bill_id composite key)
- bill_resolution_type: Bill type (Component of the bill_id composite key)
- bill_number: Bill number (Component of the bill_id composite key)
- bill_state: Bill status
- legislator_id: Sponsor of the bill
- min_introduced_date: Minimum date of introduction to Congress (YYYY-MM-DD)
- max_introduced_date: Maximum date of introduction to Congress (YYYY-MM-DD)
- min_updated_date: Minimum date of most recent status change (YYYY-MM-DD)
- max_updated_date: Maximum date of most recent status change (YYYY-MM-DD)
#### Returns:
- BillResponse object containing the bill data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.bills(congress_number=111, bill_chamber="H", bill_number=4173)
>>> output.data[0]['bill_state']
'ENACTED:SIGNED'
```
### Method: clients
Gets client information from the LobbyView API based on the provided parameters.
#### Parameters:
- client_uuid: Unique identifier of the client
- client_name: Name of the client
- min_naics: Minimum NAICS code to which the client belongs
- max_naics: Maximum NAICS code to which the client belongs
- naics_description: Descriptions of the NAICS code
#### Returns:
- ClientResponse object containing the client data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.clients(client_name="Microsoft Corporation")
>>> output.data[0]['client_uuid']
'44563806-56d2-5e99-84a1-95d22a7a69b3'
```
### Method: reports
Gets report information from the LobbyView API based on the provided parameters.
#### Parameters:
- report_uuid: Unique identifier of the report
- client_uuid: Unique identifier of the client
- registrant_uuid: Unique identifier of the registrant
- registrant_name: Name of the registrant
- report_year: Year of the report
- report_quarter_code: Quarter period of the report
- min_amount: Minimum lobbying firm income or lobbying expense (in-house)
- max_amount: Maximum lobbying firm income or lobbying expense (in-house)
- is_no_activity: Quarterly activity indicator
- is_client_self_filer: An organization employing its own in-house lobbyist(s)
- is_amendment: Amendment of previous report
#### Returns:
- ReportResponse object containing the report data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.reports(report_year=2020, report_quarter_code="2", is_client_self_filer=True, report_uuid="4b799814-3e94-5ee1-8dd4-b32aead9aca6")
>>> output.data[0]['amount']
'$11,680,000.00'
```
### Method: issues
Gets issue information from the LobbyView API based on the provided parameters.
#### Parameters:
- report_uuid: Unique identifier of the report
- issue_ordi: An integer given to the issue
- issue_code: General Issue Area Code (Section 15)
- gov_entity: House(s) of Congress and Federal agencies (Section 17)
#### Returns:
- IssueResponse object containing the issue data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.issues(issue_code="TRD")
```
### Method: networks
Gets network information from the LobbyView API based on the provided parameters.
#### Parameters:
- client_uuid: Unique identifier of the client
- legislator_id: Unique identifier of the legislator
- min_report_year: Minimum year of the report
- max_report_year: Maximum year of the report
- min_bills_sponsored: Minimum number of bills sponsored by the legislator in a specific year lobbied by the client
- max_bills_sponsored: Maximum number of bills sponsored by the legislator in a specific year lobbied by the client
#### Returns:
- NetworkResponse object containing the network data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.networks(client_uuid="44563806-56d2-5e99-84a1-95d22a7a69b3", legislator_id="M000303")
>>> output.data[0]['report_year']
2017
```
### Method: texts
Gets issue text data from the LobbyView API based on the provided parameters.
#### Parameters:
- report_uuid: Unique identifier of the report
- issue_ordi: An integer given to the issue
- issue_code: General Issue Area Code (Section 15)
- issue_text: Specific lobbying issues (Section 16)
#### Returns:
- TextResponse object containing the text data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.texts(issue_code="HCR", issue_text="covid")
```
### Method: quarter_level_networks
Gets quarter-level network information from the LobbyView API based on the provided parameters.
#### Parameters:
- client_uuid: Unique identifier of the client
- legislator_id: Unique identifier of the legislator
- report_year: Year of the report
- report_quarter_code: Quarter period of the report
- min_bills_sponsored: Minimum number of bills sponsored by the legislator in a specific quarter lobbied by the client
- max_bills_sponsored: Maximum number of bills sponsored by the legislator in a specific quarter lobbied by the client
#### Returns:
- QuarterLevelNetworkResponse object containing the quarter-level network data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.quarter_level_networks(client_uuid="44563806-56d2-5e99-84a1-95d22a7a69b3", legislator_id="M000303", report_year=2017, report_quarter_code=4)
>>> output.data[0]['n_bills_sponsored']
1
```
### Method: bill_client_networks
Gets bill-client network information from the LobbyView API based on the provided parameters.
#### Parameters:
- congress_number: Session of Congress
- bill_chamber: Chamber of the legislative branch (Component of the bill_id composite key)
- bill_resolution_type: Bill type (Component of the bill_id composite key)
- bill_number: Bill number (Component of the bill_id composite key)
- report_uuid: Unique identifier of the report
- issue_ordi: An integer given to the issue
- client_uuid: Unique identifier of the client
#### Returns:
- BillClientNetworkResponse object containing the bill-client network data
#### Example:
```python
>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)
>>> output = lobbyview.bill_client_networks(congress_number=114, bill_chamber="H", bill_number=1174, client_uuid="44563806-56d2-5e99-84a1-95d22a7a69b3")
>>> output.data[0]['issue_ordi']
2
```
Raw data
{
"_id": null,
"home_page": null,
"name": "lobbyview",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": null,
"keywords": "politics, lobbying",
"author": null,
"author_email": "lobbyview <lobbydata@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/4c/13/63f755eea1c4fca771c055784e08656ca8e295a744ae42d34e6b08c55284/lobbyview-0.0.2.tar.gz",
"platform": null,
"description": "# LobbyView Package Documentation\n\nPython wrapper for Lobbyview Rest API; uses same endpoints and parameter names as outlined in the\n[LobbyView Rest API Documentation](https://rest-api.lobbyview.org/)\n\n## Class: LobbyViewResponse\n\nBase class for LobbyView API responses.\n\n\n## Class: LegislatorResponse\n\nResponse class for legislator data.\n\n\n## Class: BillResponse\n\nResponse class for bill data.\n\n\n## Class: ClientResponse\n\nResponse class for client data.\n\n\n## Class: ReportResponse\n\nResponse class for report data.\n\n\n## Class: IssueResponse\n\nResponse class for issue data.\n\n\n## Class: NetworkResponse\n\nResponse class for network data.\n\n\n## Class: TextResponse\n\nResponse class for text data.\n\n\n## Class: QuarterLevelNetworkResponse\n\nResponse class for quarter-level network data.\n\n\n## Class: BillClientNetworkResponse\n\nResponse class for bill-client network data.\n\n\n## Class: LobbyView\n\nMain class for interacting with the LobbyView API.\n\n\n### Method: __init__\n\nInitialize the LobbyView class with the provided API token.\n\n\n### Method: get_data\n\nSends a GET request to the LobbyView API with the provided query string.\nReturns the JSON response data.\n\n\n### Method: legislators\n\nGets legislator information from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- legislator_id: Unique identifier of the legislator from LobbyView\n- legislator_govtrack_id: Unique identifier of the legislator from GovTrack\n- legislator_first_name: First name of the legislator\n- legislator_last_name: Last name of the legislator\n- legislator_full_name: Full name of the legislator\n- legislator_gender: Gender of the legislator\n- min_birthday: Minimum birthday of the legislator (YYYY-MM-DD)\n- max_birthday: Maximum birthday of the legislator (YYYY-MM-DD)\n\n#### Returns:\n- LegislatorResponse object containing the legislator data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.legislators(legislator_first_name=\"John\", legislator_last_name=\"McCain\")\n>>> output.data[0]['legislator_id']\n'M000303'\n>>> output = lobbyview.legislators(legislator_id=\"M000303\")\n>>> output.data[0]['legislator_full_name']\n'John McCain'\n```\n\n### Method: bills\n\nGets bill information from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- congress_number: Session of Congress\n- bill_chamber: Chamber of the legislative branch (Component of the bill_id composite key)\n- bill_resolution_type: Bill type (Component of the bill_id composite key)\n- bill_number: Bill number (Component of the bill_id composite key)\n- bill_state: Bill status\n- legislator_id: Sponsor of the bill\n- min_introduced_date: Minimum date of introduction to Congress (YYYY-MM-DD)\n- max_introduced_date: Maximum date of introduction to Congress (YYYY-MM-DD)\n- min_updated_date: Minimum date of most recent status change (YYYY-MM-DD)\n- max_updated_date: Maximum date of most recent status change (YYYY-MM-DD)\n\n#### Returns:\n- BillResponse object containing the bill data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.bills(congress_number=111, bill_chamber=\"H\", bill_number=4173)\n>>> output.data[0]['bill_state']\n'ENACTED:SIGNED'\n```\n\n### Method: clients\n\nGets client information from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- client_uuid: Unique identifier of the client\n- client_name: Name of the client\n- min_naics: Minimum NAICS code to which the client belongs\n- max_naics: Maximum NAICS code to which the client belongs\n- naics_description: Descriptions of the NAICS code\n\n#### Returns:\n- ClientResponse object containing the client data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.clients(client_name=\"Microsoft Corporation\")\n>>> output.data[0]['client_uuid']\n'44563806-56d2-5e99-84a1-95d22a7a69b3'\n```\n\n### Method: reports\n\nGets report information from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- report_uuid: Unique identifier of the report\n- client_uuid: Unique identifier of the client\n- registrant_uuid: Unique identifier of the registrant\n- registrant_name: Name of the registrant\n- report_year: Year of the report\n- report_quarter_code: Quarter period of the report\n- min_amount: Minimum lobbying firm income or lobbying expense (in-house)\n- max_amount: Maximum lobbying firm income or lobbying expense (in-house)\n- is_no_activity: Quarterly activity indicator\n- is_client_self_filer: An organization employing its own in-house lobbyist(s)\n- is_amendment: Amendment of previous report\n\n#### Returns:\n- ReportResponse object containing the report data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.reports(report_year=2020, report_quarter_code=\"2\", is_client_self_filer=True, report_uuid=\"4b799814-3e94-5ee1-8dd4-b32aead9aca6\")\n>>> output.data[0]['amount']\n'$11,680,000.00'\n```\n\n### Method: issues\n\nGets issue information from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- report_uuid: Unique identifier of the report\n- issue_ordi: An integer given to the issue\n- issue_code: General Issue Area Code (Section 15)\n- gov_entity: House(s) of Congress and Federal agencies (Section 17)\n\n#### Returns:\n- IssueResponse object containing the issue data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.issues(issue_code=\"TRD\")\n```\n\n### Method: networks\n\nGets network information from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- client_uuid: Unique identifier of the client\n- legislator_id: Unique identifier of the legislator\n- min_report_year: Minimum year of the report\n- max_report_year: Maximum year of the report\n- min_bills_sponsored: Minimum number of bills sponsored by the legislator in a specific year lobbied by the client\n- max_bills_sponsored: Maximum number of bills sponsored by the legislator in a specific year lobbied by the client\n\n#### Returns:\n- NetworkResponse object containing the network data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.networks(client_uuid=\"44563806-56d2-5e99-84a1-95d22a7a69b3\", legislator_id=\"M000303\")\n>>> output.data[0]['report_year']\n2017\n```\n\n### Method: texts\n\nGets issue text data from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- report_uuid: Unique identifier of the report\n- issue_ordi: An integer given to the issue\n- issue_code: General Issue Area Code (Section 15)\n- issue_text: Specific lobbying issues (Section 16)\n\n#### Returns:\n- TextResponse object containing the text data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.texts(issue_code=\"HCR\", issue_text=\"covid\")\n```\n\n### Method: quarter_level_networks\n\nGets quarter-level network information from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- client_uuid: Unique identifier of the client\n- legislator_id: Unique identifier of the legislator\n- report_year: Year of the report\n- report_quarter_code: Quarter period of the report\n- min_bills_sponsored: Minimum number of bills sponsored by the legislator in a specific quarter lobbied by the client\n- max_bills_sponsored: Maximum number of bills sponsored by the legislator in a specific quarter lobbied by the client\n\n#### Returns:\n- QuarterLevelNetworkResponse object containing the quarter-level network data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.quarter_level_networks(client_uuid=\"44563806-56d2-5e99-84a1-95d22a7a69b3\", legislator_id=\"M000303\", report_year=2017, report_quarter_code=4)\n>>> output.data[0]['n_bills_sponsored']\n1\n```\n\n### Method: bill_client_networks\n\nGets bill-client network information from the LobbyView API based on the provided parameters.\n\n\n#### Parameters:\n- congress_number: Session of Congress\n- bill_chamber: Chamber of the legislative branch (Component of the bill_id composite key)\n- bill_resolution_type: Bill type (Component of the bill_id composite key)\n- bill_number: Bill number (Component of the bill_id composite key)\n- report_uuid: Unique identifier of the report\n- issue_ordi: An integer given to the issue\n- client_uuid: Unique identifier of the client\n\n#### Returns:\n- BillClientNetworkResponse object containing the bill-client network data\n\n\n#### Example:\n```python\n>>> lobbyview = LobbyView(LOBBYVIEW_TOKEN)\n>>> output = lobbyview.bill_client_networks(congress_number=114, bill_chamber=\"H\", bill_number=1174, client_uuid=\"44563806-56d2-5e99-84a1-95d22a7a69b3\")\n>>> output.data[0]['issue_ordi']\n2\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "LobbyView Rest API Wrapper",
"version": "0.0.2",
"project_urls": {
"LobbyViewRestAPI": "https://rest-api.lobbyview.org/"
},
"split_keywords": [
"politics",
" lobbying"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e37e62623e1b0640f5219a7daf0ce81ec9e71c936b0e1ee549ae5fd3b2c409a6",
"md5": "29598ee811c9a6a00aef74302008670c",
"sha256": "f9911c72e956365adcb1f1d8589e19a19f8ccd8ba7ec28cacf0957e5b924337f"
},
"downloads": -1,
"filename": "lobbyview-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "29598ee811c9a6a00aef74302008670c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 7575,
"upload_time": "2024-04-01T00:12:21",
"upload_time_iso_8601": "2024-04-01T00:12:21.090451Z",
"url": "https://files.pythonhosted.org/packages/e3/7e/62623e1b0640f5219a7daf0ce81ec9e71c936b0e1ee549ae5fd3b2c409a6/lobbyview-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4c1363f755eea1c4fca771c055784e08656ca8e295a744ae42d34e6b08c55284",
"md5": "96c3343341ef9d30c393fcf281df4347",
"sha256": "16daa5b7a93c522149aa2b96087eb738a4616cc017da57f7cf9242d778566b2e"
},
"downloads": -1,
"filename": "lobbyview-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "96c3343341ef9d30c393fcf281df4347",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 7776,
"upload_time": "2024-04-01T00:12:23",
"upload_time_iso_8601": "2024-04-01T00:12:23.245757Z",
"url": "https://files.pythonhosted.org/packages/4c/13/63f755eea1c4fca771c055784e08656ca8e295a744ae42d34e6b08c55284/lobbyview-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-01 00:12:23",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lobbyview"
}