- Extract conversion matrices for mecabricks using the api at www.mecabricks.com/api/part-manager/parts/get
- Python >= 3.7
- python requests
pip install aiohttp
- download
extractor.py
to your local directory
import asyncio
import json
from extractor import get_bricks
import time
async def main():
start = time.perf_counter()
_range = range(1, 19900)
bricks = await get_bricks(_range, max_conn=100, lang="en", scope="official")
print("requests/sec. = " + str(
(_range.stop - _range.start) /
(time.perf_counter() - start)
))
with open("file.json") as f:
f.write(json.dumps(bricks))
asyncio.run(main())
Please feel free to open an issue or fork!
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
I am not responsible for what you use the code for!!! Also no warranty!