Python METRC
A light Python wrapper around the METRC Web API
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Installing
$ pip install python_metrc
Running the tests
cd python_metrc pytest
Documentation
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.
Contributing
Please read the Contribution guidelines for details on our code of conduct, and the process for submitting pull requests to us.
License
This project is licensed under the MIT License - see the LICENSE file for details
Acknowledgments
Hammock - Used to generate RESTful URLs
History
0.1.2 (2018-09-26)
Convert main class to inherit from Hammock instead.
0.1.1 (2018-09-26)
Clean up unnecessary artefacts after setup.
0.1.0 (2018-09-26)
First release on PyPI.
Metadata
Release files for python-metrc 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_metrc-0.1.4.tar.gz | 9.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_metrc-0.1.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 13.5 kB
Release files / python_metrc-0.1.4.tar.gz
| Download URL | python_metrc-0.1.4.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
193b7cc2fe292e3aac7e122cb4a92b793f9e90fc08d78a159a56065ee3aeaaf2
|
|
BLAKE2b-256 checksum How to use checksums |
4ec3a990c16119a573bd773829a033170774d9d0d023ba2d4443182d0f72b436
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
|
Release files / python_metrc-0.1.4-py2.py3-none-any.whl
| Download URL | python_metrc-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f73c8e59035ccc210f88e011ba17dffbc9534987d81ca78cb74e05325f79b5c5
|
|
BLAKE2b-256 checksum How to use checksums |
5c3d3e454a4175c7f0e992313591a9fe5e0bdd2e15323e176e6749e70c7189b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
|