Skip to main content

Python version of the R arcos package

Project description

arcospy

Build Status


Introduction

Welcome to arcospy, the python version of the R arcos package maintained by The Washington Post. arcospy is the result of a R-to-python translation project carried out at the University of Maryland in the Fall of 2019. The project was motivated a Washington Post data-driven story on a large pain pill database recently made publicly available.

The arcospy module was built to offer the exact same functionality as arcos, with the only difference being the ability to run the API calls in python! All of the commands in arcospy inherit the names from the original commands in arcos. Both arcos and arcospy act as wrappers for the DEA ARCOS dataset.


Installation

arcospy is hosted on PyPI and is pip installable. To install arcospy on your machine, start a new terminal and run the following commands:

$ pip install arcospy

Requirements

arcospy requires pandas>=0.20.0, requests>=2.0.0, and io.


Updates

Updates (will be posted periodically):

  • 5/20/2021: Changes in API payload required a minor update to certain raw data commands.
  • 9/14/2020: Updated docs to reflect forthcoming publication of arcos and arcospy in JOSS.
  • 8/1/2020: Renamed demos to docs for development consistency. Added another example notebook demonstrating acquisition and manipulation of pharmacy-level data. Planning gathering of additional ARCOS reports.
  • 3/18/2020: Added four new commands for business-level data, as well as updating documentation to reflect additional years now present in the data (up to 2014).
  • 3/1/2020: Re-organized repository for readability. Updated testing documents. Fixed two small parameter issues with state-level query commands. 1.0.8 live and stable.
  • 1/22/2020: Carried out PEP8 styling for commands, added help information, and package header. Re-published package as 1.0.6 as the package is now considered stable.
  • 1/14/2020: Reformatted README.md to provide more specific headers, installation instructions, requirements, and additional information.
  • 12/10/2019: added a new folder called demos. Inculdes a basic getting started guide as well as an introduction to making the data spatial.

Use

All functions are available on The Washington Post reference page here. Example notebooks in python are available in the docs folder. Additional example use cases are available in R here.

Data can be gathered at the pharmacy, distributor, county, or state as the geographic unit of analysis. Depending on the geographic level, there may be raw, summarized, or supplemental data available. For example, the county_raw() command returns each individual ARCOS record for a given county from 2006 to 2014. However, the summarized_county_annual() command returns the annual summarized totals for a given county for each year of 2006 to 2014.


Contributing

The following is lifted directly from contributing.md

Contributions are welcome to both arcos and arcospy. For major contributions, please fork the master arcos or arcospy branch and then open a pull request with the suggested changes. We will then review the change and determine if there is a generalizable solution to both R and Python. If there is no generalizable solution, we will still strive to make your contribution visible on the respective Github page.

Documentation

Improvements to the documentation for arcos and arcospy are welcome. As stated above, we will try to generalize all contributions to both packages. For example, if the wording around a specific command is unclear, we can improve the wording in both packages. Additionally, if there are features of a command that you believe should be included in the primary documentation, please let us know so we can improve the user experience.

Code

Presently, the core functionality of the API is maintained by the Data Reporting Team at The Washington Post. There is ample room for users to suggest functions that can be added to arcos and arcospy. For example, users might suggest functions that download national or regional sets of data by looping existing commands.

Issues

Trackable issue pages are available on both the master arcos or arcospy Github pages. Issues may be related to anything from malfunctioning commands to inconsistent data. We encourage an active discussion and hope to readily address any errors. We recommend that when submitting an issue users provide specific tags and examples of the aberrant behavior. If you are able to solve an issue with the code independently, please open a pull request with the corrected code and a short explanation as to the bug fix.


Disclaimer: please note that the author of this package, Jeff Sauer, is not affiliated with the Washington Post in any official capacity.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arcospy-1.2.3.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arcospy-1.2.3-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file arcospy-1.2.3.tar.gz.

File metadata

  • Download URL: arcospy-1.2.3.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

File hashes

Hashes for arcospy-1.2.3.tar.gz
Algorithm Hash digest
SHA256 36e00ba95d582e4ef75f8928d21aee67b9f0bf01bf8a13f05057dc8dae6540bc
MD5 3f3f31f71d5c804006464063f0e7d1f3
BLAKE2b-256 ee4448f37b312ab0790f3671594b49d5ab5a9c9ee7acd1a3d6241dc29005b491

See more details on using hashes here.

File details

Details for the file arcospy-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: arcospy-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

File hashes

Hashes for arcospy-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aff6f0b1f3bf00c33a79a3914225da5d102df6a081745f6c199a9093d569b6a3
MD5 46c70751c138454b0bb2b7d3a50b9417
BLAKE2b-256 e865c966cae4d8a2a20fe796e7ccf9d87fef3a485f7faa730321455870194716

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page