Git Product home page Git Product logo

thebigdb-python's Introduction

IMPORTANT NOTE

This is an experimental python wrapper for TheBigDB.com API. It is currently under heavy development by the community and can change radically at any moment. As said in the original README, it is mainly inspired by the Ruby and the Javascript wrappers. You are more than welcome to improve it, by submitting a pull request.

Usage

Using TheBigDB's python client is very simple.

First, create an instance of TheBigDB:

db=TheBigDB('YOUR_API_KEY_GOES_HERE')

To search TheBigDB:

The empty string is treated as a wildcard.

def success_callback(response):
    #Here you can proccess the response to your query.
    #response is the JSON string that TheBigDB returned
    #success in this case only means that the HTTP request did not error out
    #it does not mean that TheBigDB has not returned an error code.

def failure_callback(response):
    #Called on HTTP request failure.
    #response is an object of type http.client.HTTPResponse

db.search(['', 'atomic radius'], success_callback, failure_callback)
# Returns all facts with 'atomic radius' as the second node.

To insert data into TheBigDB:

#inserts the atomic radius of iron into TheBigDB
db.add_nodes(['Iron', 'atomic radius', '140 pm'], success_callback, failure_callback)

To upvote/downvote a node:

db.upvote('NODE_ID') #Get the NodeID from db.search
db.downvote('NODE_ID')

thebigdb-python's People

Contributors

sapphire-arches avatar

Watchers

 avatar  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.