Code Monkey home page Code Monkey logo

pyquora's Introduction

pyquora

Note: Parts of this library are broken due to changes on Quora's end. Issues and pull requests welcome.

Build Status Code Coverage

A Python module to fetch and parse data from Quora.

Table of Contents

Installation

You will need Python 2.x and pip.

Install using pip:

pip install quora

Usage

User statistics

from quora import User

user = User('Christopher-J-Su')

# Get user activity
activity = user.activity

# Do stuff with the parsed activity data
print activity

# Get user statistics
stats = user.stats

# Take a gander
print stats

Questions

from quora import Quora

# Get question statistics
question = Quora.get_question_stats('what-is-python')

# question is:
# {
#     'want_answers': 3,
#     'question_text': u'What is python?', 
#     'topics': [u'Science, Engineering, and Technology', u'Technology', u'Electronics', u'Computers'], 
#     'question_details': None, 'answer_count': 1, 
#     'answer_wiki': '<div class="hidden" id="answer_wiki"><div id="ld_mqcfmt_15628"><div id="__w2_po3p1uM_wiki"></div></div></div>',
# }

Answer statistics

from quora import Quora

# The function can be called in any of the following ways.
answer = Quora.get_one_answer('http://qr.ae/6hARL')
answer = Quora.get_one_answer('6hARL')
answer = Quora.get_one_answer(question, author) # question and answer are variables

# answer is:
# {
#     'want_answers': 8, 
#     'views': 197, 
#     'author': u'Mayur-P-R-Rohith', 
#     'question_link': u'https://www.quora.com/Does-Quora-similar-question-search-when-posing-a-new-question-work-better-than-the-search-box-ove', 
#     'comment_count': 1, 
#     'answer': '...', 
#     'upvote_count': 5
# }

# Get the latest answers from a question
latest_answers = Quora.get_latest_answers('what-is-python')

Features

Currently implemented

  • User statistics
  • User activity
  • Question statistics
  • Answer statistics

To do

  • Detailed user information (followers, following, etc.; not just statistics)

Contribute

Gitter HuBoard

Check out the issues on GitHub and/or make a pull request to contribute!

Projects using pyquora

  • quora-api – A REST API for Quora.
  • quora-backup – A Python package and CLI for backing up Quora data.

pyquora's People

Contributors

csu avatar rohithpr avatar aaronwinter avatar svisser avatar gitter-badger avatar vikas-parashar 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.