Rebrick
The rebrick library provides a collection of utilities to retrieve various data from Rebrickable.com bricks repository. It can be used either as a simple tool, which reads requested data and converts them into easy-access custom classes or by using the API directly to allow handling the HTTPResponse in whatever way you want.
Please see the examples folder or in-code documentation of classes and functions to learn more about the rebrick library capabilities as well as the original documentation of the Rebrickable API.
See also a similar tool for BrickSet.com called brickse.
Tool Example
import rebrick
# init Rebrick tool
rb = rebrick.Rebrick("your_API_KEY_here", "your_USER_TOKEN_here", silent=True)
# get set info
data = rb.get_set(6608)
print(data)
# if user token is not provided on init you can get it later to access user data
rb.login("your_username_here", "your_password_here")
# get user partlists
data = rb.get_users_partlists()
print(data)
API Example
import rebrick
import json
# init rebrick module for general reading
rebrick.init("your_API_KEY_here")
# get set info
response = rebrick.lego.get_set(6608)
print(json.loads(response.read()))
# init rebrick module including user reading
rebrick.init("your_API_KEY_here", "your_USER_TOKEN_here")
# if you don't know the user token you can use your login credentials
rebrick.init("your_API_KEY_here", "your_username_here", "your_password_here")
# get user partlists
response = rebrick.users.get_partlists()
print(json.loads(response.read()))
Installation
The rebrick library is fully implemented in Python. No additional compiler is necessary. After downloading the source code just run the following command from the rebrick folder:
$ python setup.py install
or simply by using pip
$ pip install rebrick
Disclaimer
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Metadata
Release files for rebrick 0.4.0
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 |
|---|---|---|---|---|
| rebrick-0.4.0.tar.gz | 15.7 kB | Without provenance | Details for rebrick-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rebrick-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for rebrick-0.4.0-py3-none-any.whl |
Total release size: 31.7 kB
Release files / rebrick-0.4.0.tar.gz
| Download URL | rebrick-0.4.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eaf9832f00defdb1254e44ff890c99dd8e7d94054ed3a4c40edff199337be8fd
|
|
BLAKE2b-256 checksum How to use checksums |
7fd9161252f0c2306d8740e6304c79445a0b7382cb6fa5b6afbaa73211aa5276
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / rebrick-0.4.0-py3-none-any.whl
| Download URL | rebrick-0.4.0-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26b408fe24a4f446f56d1c68e5c459b6437fe9607f273ad497ee8b6eeb63338c
|
|
BLAKE2b-256 checksum How to use checksums |
aa7fe390b68ecd0051e0c1e8cca6f6c6e35a76a84fe666cea841eef28b26ee68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for rebrick 0.4.0
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.