Skip to content

kirkedev/mpr

Repository files navigation

mpr

Test Status Coverage Status

Python package for downloading, parsing, and analyzing historical Mandatory Price Reporting data from the USDA's Agricultural Marketing Service.

  • Ergonomic client for interacting with MPR DataMart
  • Parses XML data into json
  • Parses report data from strings into numpy dtypes and record arrays
  • Builds a dynamic timeseries filesystem cache of requested data
  • Aggregates data into common reports as pandas DataFrames

See examples in the examples notebook

Setup

You'll need to install pipenv to run the code.

To activate the git hooks:

git config core.hooksPath .githooks

Commands

These all need to be run from the project root.

# View CME Lean Hog Index report for last 20 days
bin/cash --days=20

# View CME Cutout Index report (default last 10 days)
bin/cutout

# View Lean Hog Purchases report
bin/purchases

# View CME Fresh Bacon Index report
bin/bacon

# Start jupyter notebook server
bin/notebook

# Lint and run unit and acceptance tests with coverage
bin/tests

# Wipe reports cache
bin/wipe

# Build wheel for deployment
bin/build

# Remove build artifacts
bin/clean