A light Python wrapper around the METRC Web API
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
$ pip install python_metrc
cd python_metrc pytest
To generate and call the endpoint - https://sandbox-api-ca.metrc.com/transfers/v1/delivery/packages/states
- you can use any of the following combinations:
>>> from python_metrc import METRC >>> metrc = METRC('https://sandbox-api-ca.metrc.com', vendor_key={VENDOR_KEY}, user_key={USER_KEY}, license_number={LICENSE_NUMBER}) >>> metrc.transfers('delivery').packages('states').get() <Response [200]> >>> metrc.transfers.delivery.packages('states').get() <Response [200]> >>> metrc.transfers.delivery.packages.states.get() <Response [200]> >>> metrc.transfers('delivery', 'packages', 'states').get() <Response [200]>
The METRC
class instance provides the GET
, POST
and DELETE
HTTP methods as binded on itself. The return type is the requests
module's Response
object.
Please read the Contribution guidelines for details on our code of conduct, and the process for submitting pull requests to us.
See the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details
- Hammock - Used to generate RESTful URLs