brick analyzer

brick analyzer

6 devlogs
5h 22m
Created by luna

Analyzes brick purchases before purchasing. Currently only sets are supported.

Sets get analyzed on the following criteria:
- BrickLink part out value (i.e. what the singular parts would cost / would sell at again)
- BrickLink sales average (i.e. to which prices the set as a whole has been sold in the last 6 month
- Price per piece (i.e. the average price of one piece)
- Rebrickable build search (how many % of pieces you own in your Rebrickable collection)
- Rebrickable alternate builds (how many other models you can build with that set on Rebrickable)

Quick information for terms used in the script:
- Set num: the LEGO set number, often visible on the front of the box or the instructions. This is also the one used at many Lego-sites, such as BrickLink
- RB API key: Your Rebrickable API key, create a (free) account at https://rebrickable.com/, then head to your settings, API tab and create it
- RB User Token: If you don't know what this is, just leave it blank. The tool will promt you to login using username and password

---

Note: Online tools to execute this are not possible due to missing dependencies, the demo link is a Linux executable. As I don't have access to Windows I couldn't package it into an .exe file. If you want to run this on windows, clone the repo and run the python file. Installation instructions are only for Linux.

Timeline

Fixed a bug where I forgot to convert the US $ prices into a float, this also needed some bug fixing. That is the line I changed if you're interested:

blsalesaverage = float(usdspecificprice.replace(',','').removeprefix(' '))

Update attachment

Fixed a minor bug where prices shown on BrickLink with the prefix US $ instead of USD $, as I expected it in my code, would crash the script. I just needed to build in one if-condition and that was it.

Update attachment

Changed from reading a file as the input for the Rebrickable API key to an input() statement, so it can be compiled into an .exe file.

Update attachment

Ship 1

0 payouts of shell 0 shells

luna

9 days ago

luna Covers 3 devlogs and 4h 34m

Added another API call: This time to get the information from Rebrickable as to how many alternate builds there are, so you can decide if you can build a lot with it or not.
This is now also v1 of this project. If you have any other ideas, please leave them in the comments, I can implement them in further versions.

Update attachment
luna
luna
1h 47m 21 days ago

I have worked around 2 weeks on this with a very bad internet connection (max. 8kB/s), so Summer of Making didn't load at all. Here is a devlog of these two weeks and 1¾ hours of work:

As Rebrickable (https://rebrickable.com/) is one of my favorite brick-related platforms, I added two new integrations with Rebrickable!
1. if you're unsure about the number of pieces in the set, just ask the RB (Rebrickable) API
2. get build results from Rebrickable, i.e. how many parts you already own of the set - for that there is technically a third call that gets the user token if you haven't already

Additionally I tested it with all my recent brick purchases and it worked great, I corrected some typos and added a multiplier (e.g. selling it on BL gives you 5× the money)

(user-token was cropped out from image)

Update attachment

I started the project including two checks already:

  1. BL part-out value
  2. BL sales average

These needed to be done via website scraping since the BeickLink API has this data, however is just accessible by registered sellers, which I'm not (and technically can't, be ause I'm not 18 yet). I have written support about it, but they haven't responded yet. Maybe I can change it to API in the future.

Update attachment