Skip to main content

An API utility wrapper for accessing the e-Manifest hazardous waste tracking system maintained by the US Environmental Protection Agency

Project description

e-Manifest

Downloads PyPI License: CC0-1.0

emanifest is a Python utility wrapper for accessing the e-Manifest API of the US Environmental Protection Agency's RCRAInfo national electronic hazardous waste management system.

Note: The emanifest package was substantially refactored after version 1.1.0 and was released as a new major version at 2.0.0. Code relying on version 1.1.0 should not upgrade to version 2.0.0 of this package without refactoring.

Contents

Requirements

  • Python 3.6

Dependencies

  • requests
  • requests_toolbelt
  • datetime
  • json
  • zipfile
  • sys
  • io

Installation

emanifest can be installed directly from the Python package directory using pip:

pip install emanifest

Usage

Getting Started

Before using the emanifest package, ensure you have a RCRAInfo user account and the necessary permissions to generate an API ID and key. Make note of your ID and key somewhere safe.

To add emanifest to your current Python environment and authenticate your account, peform the following commands:

from emanifest import emanifest as em

em.new_client('ENVIRONMENT')
em.Auth('YOUR_API_ID', 'YOUR_API_KEY')

Your environment variable can be either preprod or prod based on your permissions. To register for a preproduction testing account, visit the preprod site.

After authenticating, you are ready to use the full functionality of the emanifest package. Functions designed for use by other groups, such as regulators or industry users, will return 'Access Denied' errors if you are not authorized to view this content in RCRAInfo.

Functions

There are ten categories of functions in the emanifest package. For more information about these services, visit the Swagger page of your selected environment. (PREPROD, PROD)

  1. [All users] Authentication services
  2. [All users] e-Manifest Lookup Services
  3. [All users] Lookup Services
  4. [All users] Site Services
  5. [Industry users] e-Manifest Services
  6. [Industry users] e-Manifest UI Link Services
  7. [Regulator users] CM&E Evaluation Services
  8. [Regulator users] e-Manifest Services
  9. [Regulator users] Handler Services
  10. [Regulator users] User Services

Content will be returned as a JSON object. Functions that download file attachments will store these in the same folder as your Python document. Functions that update, correct, or save manifests by uploading new .json and/or .zip files must receive the specific location of these files on your computer. By default, these functions will assume the files are located in the same folder as your Python document.

After authenticating your account, you can complete a variety of actions within the e-Manifest system. For example, you might start with a new site by getting its basic details:

em.GetSiteDetails('VATEST000001')

Once you've confirmed this is the correct site, you might search for manifests in transit from that site:

em.SearchMTN(siteId='VATEST000001', status='InTransit')

If one of those manifests didn't match your records, you could initiate a correction with the correct JSON information and optionally any attachments (.zip):

em.Correct('manifest_file_name.json', 'optional_attachments.zip')

Help

If you are uncertain how to use a function, run help(em.FunctionName) in your Python environment. This will return a description of the function, any required inputs, and the formats of those inputs. For a list of all the functions contained in emanifest and additional information about this package, run help(emanifest) in your Python environment.

Contact

Please direct questions to the EPA e-Manifest team at USEPA/e-manifest

Disclaimer

The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government.

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

emanifest-2.0.0.tar.gz (11.5 kB view hashes)

Uploaded Source

Built Distribution

emanifest-2.0.0-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

Supported by

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