Scrapes petitions from [change.org](https://www.change.org/).
[![GitHub Source Code](https://img.shields.io/badge/github_source_code-source_code?logo=github&color=green)](https://github.com/cja5553/change_org_scraper)
## Quick Start
Here we provide a quick example on how you can use `AutoThemeGenerator` to scrape petitions right from [change.org](https://www.change.org/).
```python
from change_dot_org import scrape_petitions
# Specify the url of your scrape.org searches
## for instance, we shall scrape petitions from the search "supplemental nutrition assistance program"
url='https://www.change.org/search?q=Supplemental%20Nutrition%20Assistance%20Program&offset=0'
# scrape the petition data from change.org
SNAP_petitions_df=scrape_petitions(url)
print(SNAP_petitions_df)
```
It returns a dataframe with all the petitions related to SNAP as well as corresponding details (eg description, date created, target audience signature count, location created, victory status, etc).
## Requirements
### Required packages
To use `change_org_scrapper`, you are required to have the following packages installed:
- `requests`
- `bs4`
- `tqdm`
- `pandas`
- `ast`
- `re` (Python standard library)
- `json` (Python standard library)
If you do not have these packages installed in python, you can do the following:
```bash
pip install requests bs4 tqdm pandas ast
```
## Installation
To install in python, simply do the following:
```bash
pip install change_org_scrapper
```
## Citation
This package was made as part of a larger study on food stamps (i.e., SNAP), therefore, we do not have the paper ready just yet.
However, if you wish to cite, you may cite:
C Alba (2024) change_org_scraper: A python package to scrape petitions from change.org. PyPi.
# Questions?
Contact me at [alba@wusl.edu](mailto:alba@wusl.edu)
Raw data
{
"_id": null,
"home_page": null,
"name": "change-org-scraper",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "change.org, petitions, web scraping",
"author": "Charles Alba",
"author_email": "alba@wustl.edu",
"download_url": "https://files.pythonhosted.org/packages/af/dc/c5306f68e172cb67b18c59f536bf890469b7d6a161066cfcc1d6561c1c42/change_org_scraper-0.0.1.tar.gz",
"platform": null,
"description": "Scrapes petitions from [change.org](https://www.change.org/).\r\r\n\r\r\n[![GitHub Source Code](https://img.shields.io/badge/github_source_code-source_code?logo=github&color=green)](https://github.com/cja5553/change_org_scraper) \r\r\n\r\r\n## Quick Start\r\r\nHere we provide a quick example on how you can use `AutoThemeGenerator` to scrape petitions right from [change.org](https://www.change.org/). \r\r\n\r\r\n```python\r\r\nfrom change_dot_org import scrape_petitions\r\r\n\r\r\n# Specify the url of your scrape.org searches\r\r\n## for instance, we shall scrape petitions from the search \"supplemental nutrition assistance program\"\r\r\n\r\r\nurl='https://www.change.org/search?q=Supplemental%20Nutrition%20Assistance%20Program&offset=0'\r\r\n\r\r\n# scrape the petition data from change.org\r\r\nSNAP_petitions_df=scrape_petitions(url)\r\r\n\r\r\nprint(SNAP_petitions_df)\r\r\n```\r\r\nIt returns a dataframe with all the petitions related to SNAP as well as corresponding details (eg description, date created, target audience signature count, location created, victory status, etc). \r\r\n\r\r\n\r\r\n\r\r\n## Requirements\r\r\n### Required packages\r\r\nTo use `change_org_scrapper`, you are required to have the following packages installed: \r\r\n- `requests`\r\r\n- `bs4` \r\r\n- `tqdm` \r\r\n- `pandas` \r\r\n- `ast` \r\r\n- `re` (Python standard library) \r\r\n- `json` (Python standard library) \r\r\n\r\r\nIf you do not have these packages installed in python, you can do the following:\r\r\n```bash\r\r\npip install requests bs4 tqdm pandas ast\r\r\n```\r\r\n\r\r\n## Installation\r\r\nTo install in python, simply do the following: \r\r\n```bash\r\r\npip install change_org_scrapper\r\r\n```\r\r\n\r\r\n## Citation\r\r\nThis package was made as part of a larger study on food stamps (i.e., SNAP), therefore, we do not have the paper ready just yet. \r\r\n\r\r\nHowever, if you wish to cite, you may cite:\r\r\n\r\r\nC Alba (2024) change_org_scraper: A python package to scrape petitions from change.org. PyPi. \r\r\n\r\r\n# Questions?\r\r\nContact me at [alba@wusl.edu](mailto:alba@wusl.edu)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Scrapes petitions and corresponding information from change.org",
"version": "0.0.1",
"project_urls": null,
"split_keywords": [
"change.org",
" petitions",
" web scraping"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "afdcc5306f68e172cb67b18c59f536bf890469b7d6a161066cfcc1d6561c1c42",
"md5": "c59b9e2f534dd9ab643268613b662ac5",
"sha256": "827cd201d8ff71330b7e7f937dac17b630106f16d016d0eb98d729398f3d1463"
},
"downloads": -1,
"filename": "change_org_scraper-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "c59b9e2f534dd9ab643268613b662ac5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5434,
"upload_time": "2024-07-14T23:43:35",
"upload_time_iso_8601": "2024-07-14T23:43:35.444028Z",
"url": "https://files.pythonhosted.org/packages/af/dc/c5306f68e172cb67b18c59f536bf890469b7d6a161066cfcc1d6561c1c42/change_org_scraper-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-14 23:43:35",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "change-org-scraper"
}