CongressLib


NameCongressLib JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryA Python wrapper for the Congress.gov API.
upload_time2024-11-21 20:49:50
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT
keywords congress politics government legislation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CongressLib

CongressLib is a Python client library for interacting with the Congress.gov API. It provides a simple and intuitive interface for retrieving legislative data such as bills, amendments, treaties, committee activities, congressional records, and more. This library is designed for researchers, developers, and anyone interested in programmatically accessing Congress.gov data.

---

## Features

- Retrieve lists and detailed information about:
  - Bills
  - Amendments
  - Committees
  - Communications
  - Congressional records (daily and bound)
  - Members of Congress
  - Nominations
  - Summaries
  - Treaties
- Easily handle API authentication with your Congress.gov API key.
- Modular design for extensibility and maintainability.

---

## Installation

Install the package using pip:

```bash
pip install CongressLib
```

Or, clone the repository and install it manually:

```bash
git clone https://github.com/harryziyuhe/CongressLib.git
cd CongressLib
pip install .
```

---

## Getting Started

### Prerequisites

1. **Congress.gov API Key:** You need an API key from [Congress.gov Developer Hub](https://developer.congress.gov/).
2. Python version 3.8 or higher.

### Setup

Store your API key in an environment file (`.env`):

```
apikey=your_congress_api_key
```

### Example Usage

```python
from congresslib import PyCongress

# Initialize the client
client = PyCongress(apikey="your_api_key")

# Retrieve a list of bills
bills = client.bill.get_bill_list(congress=117, limit=5)
print(bills)

# Get detailed information about a specific treaty
treaty = client.treaty.get_treaty(congress=117, number=1)
print(treaty)

# Fetch amendments for a specific bill
amendments = client.amendment.get_amendment_list(congress=117, type="h", limit=10)
print(amendments)
```

## Available Functions

### Bill
- `get_bill_list`: Retrieve a list of bills based on filters like Congress number, type, and date range.
- `get_bill`: Get detailed information about a specific bill.
- `get_bill_actions`: Retrieve a list of actions on a specific bill.
- `get_bill_amendments`: Get amendments related to a specific bill.
- `get_bill_committees`: Retrieve committees associated with a bill.
- `get_bill_cosponsors`: Retrieve cosponsors of a specific bill.
- `get_bill_relatedbills`: Get related bills.
- `get_bill_subjects`: Get legislative subjects related to a bill.
- `get_bill_summaries`: Get summaries for a specific bill.
- `get_bill_text`: Retrieve text versions of a bill.
- `get_bill_titles`: Retrieve titles of a specific bill.
- `get_law_list`: Retrieve a list of laws.
- `get_law`: Retrieve detailed information about a specific law.

### Amendment
- `get_amendment_list`: Retrieve a list of amendments.
- `get_amendment`: Get detailed information about a specific amendment.
- `get_amendment_actions`: Retrieve a list of actions on a specific amendment.
- `get_amendment_cosponsors`: Retrieve cosponsors for a specific amendment.
- `get_amendment_amendments`: Retrieve amendments to a specific amendment.
- `get_amendment_text`: Retrieve text versions of an amendment (117th Congress onwards).

### Committee
- `get_committee_list`: Retrieve a list of congressional committees.
- `get_committee`: Get detailed information about a specific committee.
- `get_committee_bills`: Retrieve bills associated with a committee.
- `get_committee_reports`: Retrieve reports associated with a committee.
- `get_committee_nominations`: Retrieve nominations associated with a committee.
- `get_committee_communications`: Retrieve communications associated with a committee.

### Communication
- `get_communication_list`: Retrieve a list of communications for a chamber (House or Senate).
- `get_communication`: Get detailed information about a specific communication.
- `get_requirement_list`: Retrieve a list of House requirements.
- `get_requirement`: Get detailed information about a specific House requirement.
- `get_requirement_communications`: Retrieve communications matching a House requirement.

### Congress
- `get_congress_list`: Retrieve a list of congresses and congressional sessions.
- `get_congress`: Get detailed information about a specific Congress.

### Member
- `get_member_list`: Retrieve a list of congressional members.
- `get_member`: Get detailed information about a specific member.
- `get_sponsored_legislation`: Retrieve legislation sponsored by a member.
- `get_cosponsored_legislation`: Retrieve legislation cosponsored by a member.

### Nomination
- `get_nomination_list`: Retrieve a list of nominations received from the President.
- `get_nomination`: Get detailed information about a specific nomination.
- `get_nominees`: Retrieve a list of nominees for a position within a nomination.
- `get_nomination_actions`: Retrieve actions related to a nomination.
- `get_nomination_committees`: Retrieve committees associated with a nomination.
- `get_nomination_hearings`: Retrieve hearings associated with a nomination.

### Record
- `get_record_list`: Retrieve a list of congressional record issues.
- `get_daily_record_list`: Retrieve daily congressional record issues.
- `get_daily_record`: Retrieve a specific daily congressional record issue.
- `get_daily_record_articles`: Retrieve articles from a daily congressional record issue.
- `get_bound_record_list`: Retrieve a list of bound congressional records.

### Summary
- `get_summary_list`: Retrieve a list of summaries based on filters like Congress number, type, and date range.

### Treaty
- `get_treaty_list`: Retrieve a list of treaties.
- `get_treaty`: Get detailed information about a specific treaty.
- `get_treaty_actions`: Retrieve actions related to a treaty.
- `get_treaty_committees`: Retrieve committees associated with a treaty.

## Contributing

Contributions are welcome! Please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature (`git checkout -b feature-name`).
3. Commit your changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-name`).
5. Open a pull request.

---

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

## Acknowledgments

- [Congress.gov Developer Hub](https://developer.congress.gov/) for providing API access.

---

## Contact

For questions or feedback, feel free to reach out:

- **GitHub Issues:** [Issues Page](https://github.com/harryziyuhe/py-congress/issues)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "CongressLib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "Congress, politics, government, legislation",
    "author": null,
    "author_email": "Harry He <zih028@ucsd.edu>",
    "download_url": "https://files.pythonhosted.org/packages/a9/97/853c86225eecb5f4506185228ba529f8b0aef6e1df12ef9351a6f19a980f/congresslib-0.1.3.tar.gz",
    "platform": null,
    "description": "# CongressLib\n\nCongressLib is a Python client library for interacting with the Congress.gov API. It provides a simple and intuitive interface for retrieving legislative data such as bills, amendments, treaties, committee activities, congressional records, and more. This library is designed for researchers, developers, and anyone interested in programmatically accessing Congress.gov data.\n\n---\n\n## Features\n\n- Retrieve lists and detailed information about:\n  - Bills\n  - Amendments\n  - Committees\n  - Communications\n  - Congressional records (daily and bound)\n  - Members of Congress\n  - Nominations\n  - Summaries\n  - Treaties\n- Easily handle API authentication with your Congress.gov API key.\n- Modular design for extensibility and maintainability.\n\n---\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install CongressLib\n```\n\nOr, clone the repository and install it manually:\n\n```bash\ngit clone https://github.com/harryziyuhe/CongressLib.git\ncd CongressLib\npip install .\n```\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n1. **Congress.gov API Key:** You need an API key from [Congress.gov Developer Hub](https://developer.congress.gov/).\n2. Python version 3.8 or higher.\n\n### Setup\n\nStore your API key in an environment file (`.env`):\n\n```\napikey=your_congress_api_key\n```\n\n### Example Usage\n\n```python\nfrom congresslib import PyCongress\n\n# Initialize the client\nclient = PyCongress(apikey=\"your_api_key\")\n\n# Retrieve a list of bills\nbills = client.bill.get_bill_list(congress=117, limit=5)\nprint(bills)\n\n# Get detailed information about a specific treaty\ntreaty = client.treaty.get_treaty(congress=117, number=1)\nprint(treaty)\n\n# Fetch amendments for a specific bill\namendments = client.amendment.get_amendment_list(congress=117, type=\"h\", limit=10)\nprint(amendments)\n```\n\n## Available Functions\n\n### Bill\n- `get_bill_list`: Retrieve a list of bills based on filters like Congress number, type, and date range.\n- `get_bill`: Get detailed information about a specific bill.\n- `get_bill_actions`: Retrieve a list of actions on a specific bill.\n- `get_bill_amendments`: Get amendments related to a specific bill.\n- `get_bill_committees`: Retrieve committees associated with a bill.\n- `get_bill_cosponsors`: Retrieve cosponsors of a specific bill.\n- `get_bill_relatedbills`: Get related bills.\n- `get_bill_subjects`: Get legislative subjects related to a bill.\n- `get_bill_summaries`: Get summaries for a specific bill.\n- `get_bill_text`: Retrieve text versions of a bill.\n- `get_bill_titles`: Retrieve titles of a specific bill.\n- `get_law_list`: Retrieve a list of laws.\n- `get_law`: Retrieve detailed information about a specific law.\n\n### Amendment\n- `get_amendment_list`: Retrieve a list of amendments.\n- `get_amendment`: Get detailed information about a specific amendment.\n- `get_amendment_actions`: Retrieve a list of actions on a specific amendment.\n- `get_amendment_cosponsors`: Retrieve cosponsors for a specific amendment.\n- `get_amendment_amendments`: Retrieve amendments to a specific amendment.\n- `get_amendment_text`: Retrieve text versions of an amendment (117th Congress onwards).\n\n### Committee\n- `get_committee_list`: Retrieve a list of congressional committees.\n- `get_committee`: Get detailed information about a specific committee.\n- `get_committee_bills`: Retrieve bills associated with a committee.\n- `get_committee_reports`: Retrieve reports associated with a committee.\n- `get_committee_nominations`: Retrieve nominations associated with a committee.\n- `get_committee_communications`: Retrieve communications associated with a committee.\n\n### Communication\n- `get_communication_list`: Retrieve a list of communications for a chamber (House or Senate).\n- `get_communication`: Get detailed information about a specific communication.\n- `get_requirement_list`: Retrieve a list of House requirements.\n- `get_requirement`: Get detailed information about a specific House requirement.\n- `get_requirement_communications`: Retrieve communications matching a House requirement.\n\n### Congress\n- `get_congress_list`: Retrieve a list of congresses and congressional sessions.\n- `get_congress`: Get detailed information about a specific Congress.\n\n### Member\n- `get_member_list`: Retrieve a list of congressional members.\n- `get_member`: Get detailed information about a specific member.\n- `get_sponsored_legislation`: Retrieve legislation sponsored by a member.\n- `get_cosponsored_legislation`: Retrieve legislation cosponsored by a member.\n\n### Nomination\n- `get_nomination_list`: Retrieve a list of nominations received from the President.\n- `get_nomination`: Get detailed information about a specific nomination.\n- `get_nominees`: Retrieve a list of nominees for a position within a nomination.\n- `get_nomination_actions`: Retrieve actions related to a nomination.\n- `get_nomination_committees`: Retrieve committees associated with a nomination.\n- `get_nomination_hearings`: Retrieve hearings associated with a nomination.\n\n### Record\n- `get_record_list`: Retrieve a list of congressional record issues.\n- `get_daily_record_list`: Retrieve daily congressional record issues.\n- `get_daily_record`: Retrieve a specific daily congressional record issue.\n- `get_daily_record_articles`: Retrieve articles from a daily congressional record issue.\n- `get_bound_record_list`: Retrieve a list of bound congressional records.\n\n### Summary\n- `get_summary_list`: Retrieve a list of summaries based on filters like Congress number, type, and date range.\n\n### Treaty\n- `get_treaty_list`: Retrieve a list of treaties.\n- `get_treaty`: Get detailed information about a specific treaty.\n- `get_treaty_actions`: Retrieve actions related to a treaty.\n- `get_treaty_committees`: Retrieve committees associated with a treaty.\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch for your feature (`git checkout -b feature-name`).\n3. Commit your changes (`git commit -m 'Add some feature'`).\n4. Push to the branch (`git push origin feature-name`).\n5. Open a pull request.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Acknowledgments\n\n- [Congress.gov Developer Hub](https://developer.congress.gov/) for providing API access.\n\n---\n\n## Contact\n\nFor questions or feedback, feel free to reach out:\n\n- **GitHub Issues:** [Issues Page](https://github.com/harryziyuhe/py-congress/issues)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python wrapper for the Congress.gov API.",
    "version": "0.1.3",
    "project_urls": {
        "Issues": "https://github.com/harryziyuhe/CongressLib/issues",
        "Repository": "https://github.com/harryziyuhe/CongressLib"
    },
    "split_keywords": [
        "congress",
        " politics",
        " government",
        " legislation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5fbb08e9c96e47f43daa788d162d137ccf1d94fa9e51b07391776c5d188e4683",
                "md5": "c4d33950597fdd5538367e2288aa346d",
                "sha256": "d276af2df460778a0b0065dbaaeb8015fd248a09bced82fb5e590e7f017261b1"
            },
            "downloads": -1,
            "filename": "CongressLib-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c4d33950597fdd5538367e2288aa346d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 19769,
            "upload_time": "2024-11-21T20:49:49",
            "upload_time_iso_8601": "2024-11-21T20:49:49.383772Z",
            "url": "https://files.pythonhosted.org/packages/5f/bb/08e9c96e47f43daa788d162d137ccf1d94fa9e51b07391776c5d188e4683/CongressLib-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a997853c86225eecb5f4506185228ba529f8b0aef6e1df12ef9351a6f19a980f",
                "md5": "ec8d3132c371fd963604648a10dfdcc0",
                "sha256": "ae58da9c4a3a3c04d8109c96755d3dd125f006454c9f44411c79ceb705d1ec01"
            },
            "downloads": -1,
            "filename": "congresslib-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "ec8d3132c371fd963604648a10dfdcc0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14100,
            "upload_time": "2024-11-21T20:49:50",
            "upload_time_iso_8601": "2024-11-21T20:49:50.405829Z",
            "url": "https://files.pythonhosted.org/packages/a9/97/853c86225eecb5f4506185228ba529f8b0aef6e1df12ef9351a6f19a980f/congresslib-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-21 20:49:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "harryziyuhe",
    "github_project": "CongressLib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "congresslib"
}
        
Elapsed time: 1.91295s