python-brickscout-api
Wrapper for the BrickScout API
Install
This package is published on PyPi: https://pypi.org/project/python-brickscout-api/
Install with pip
pip install python-brickscout-api
Usage
Usage at this point is minimal. I will extend this package as I go and as I need.
Create connection
You will need your username and password.
Create a new API connection
from brickscout.api import BrickScoutAPI
api = BrickScoutAPI(username='xxx', password='xxx')
Orders
- Get all open orders
Orders are considered open if they have not been marked as deleted or shipped.
orders = api.orders.get_open_orders()
for order in orders.iterator():
print(vars(order))
- Retrieve an order
order = api.orders.get(id)
print(vars(order))
- Update an order
order = api.orders.get(id)
order.internalComment = 'this is my new comment'
api.orders.update(order)
- Mark an order as PAID
order = api.orders.get(id)
api.orders.mark_as_paid(order)
- Mark an order as PACKED
order = api.orders.get(id)
api.orders.mark_as_packed(order)
- Mark an order as SHIPPED
order = api.orders.get(id)
api.orders.mark_as_shipped(order)
Error handling
Basic error handling has been added. You can check if an error has occured during a call by checking the has_error attribute on an object. If the has_error has been set to True, an Error object will be attached to the error attribute of the same object. The Error object contains following attributes: type, exception_code, developer_message, more_info_url and timestamp.
order = api.orders.get(id)
if order.has_error:
print(order.error.exception_code)
print(order.error.developer_message)
Metadata
Release files for python-brickscout-api 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-brickscout-api-1.1.2.tar.gz | 22.7 kB | Without provenance | Details for python-brickscout-api-1.1.2.tar.gz |
Release files / python-brickscout-api-1.1.2.tar.gz
| Download URL | python-brickscout-api-1.1.2.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9ac478c863411a29a03bd4c469ebf97eec5a6340fa879511cbc9a1e86a0bfda
|
|
BLAKE2b-256 checksum How to use checksums |
25199d7728d0f2c92adc350dd452a67a8898e90e7bf4b34a5c3362af6e326271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.7
|
Security for python-brickscout-api 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.