Brickse
The brickse library provides a collection of utilities to retrieve various data from BrickSet.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 brickse library capabilities as well as the original documentation of the BrickSet API.
See also a similar tool for Rebrickable.com called rebrick.
Tool Example
import brickse
# init Brickse tool
bs = brickse.Brickse("your_API_KEY_here", "your_USER_TOKEN_here", silent=True)
# get set info
data = bs.get_set(set_number=6608)
print(data)
# if user token is not provided on init you can get it later to access user data
bs.login("your_username_here", "your_password_here")
# get user sets
data = bs.get_users_sets(owned=True)
print(data)
API Example
import brickse
import json
# init brickse module for general reading
brickse.init("your_API_KEY_here")
# get set info
response = brickse.lego.get_set(set_number=6608)
print(json.loads(response.read()))
# init brickse module including user reading
brickse.init("your_API_KEY_here", "your_USER_TOKEN_here")
# if you don't know the user token you can use your login credentials
brickse.init("your_API_KEY_here", "your_username_here", "your_password_here")
# get user sets
response = brickse.users.get_sets(owned=True)
print(json.loads(response.read()))
Installation
The brickse library is fully implemented in Python. No additional compiler is necessary. After downloading the source code just run the following command from the brickse folder:
$ python setup.py install
or simply by using pip
$ pip install brickse
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 brickse 0.2.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 | |
|---|---|---|---|
| brickse-0.2.0.tar.gz | 10.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| brickse-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.5 kB
Release files / brickse-0.2.0.tar.gz
| Download URL | brickse-0.2.0.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0365b839c2fcc2886a35589465fdad3a39b4dd62eec2be277f053418b40e5f6f
|
|
BLAKE2b-256 checksum How to use checksums |
c5261efdce37aaf3deda80956d772dae84d3a1e87d93c99c490c70bb3c04f588
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / brickse-0.2.0-py3-none-any.whl
| Download URL | brickse-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4690a3f04063490539120e204620915922a7c22ce69d4062db8f94fa5f6dabf
|
|
BLAKE2b-256 checksum How to use checksums |
75f4e3c13cedf8a131a3798ae5fe25e2e6dc6b3b6054e1be3cc77b008fb07b06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|