Coder Social home page Coder Social logo

rebrick's Introduction

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.

rebrick's People

Contributors

xxao avatar

Stargazers

Michael Gale avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.