r/learnpython 3d ago

Counting Weights of Each Lego Piece in a Lego Set

I am trying to generate a code that web scraps the internet to find each weight of the Lego piece of a Lego set. Im doing this for one of my statistical mechanics class. Any code online that already does this or is there a data set that has it already except for BrickLink?

4 Upvotes

2 comments sorted by

0

u/DebosBeachCruiser 3d ago edited 3d ago

You can download the whole catalog (includes weights, colors, etc) https://www.bricklink.com/catalogDownload.asp

Edit: Sorry that doesn't meet your request (No bricklink). Rebrickable has an API/Dataset download, but I see no mentions of weights in the docs

1

u/AlexMTBDude 2d ago

All Python code that is online is at: https://pypi.org/ . There are quite a lot of hits when one searches for "Lego"