Git Product home page Git Product logo

python-convore's Introduction

Convore: Python API Wrapper

.d8888b  .d88b.  88888b.  888  888  .d88b.  888d888  .d88b.

d88P" d88""88b 888 "88b 888 888 d88""88b 888P" d8P Y8b 888 888 888 888 888 Y88 88P 888 888 888 88888888 Y88b. Y88..88P 888 888 Y8bd8P Y88..88P 888 Y8b. "Y8888P "Y88P" 888 888 Y88P "Y88P" 888 "Y8888

Overview

This is going to be awesome, and modeled after the excellent github2 module.

Usage

Hmm.. :

>>> import convore
>>> convore.login('username', 'password')

>>> convore.account_verify()
True

>>> convore.groups
[<group 'api-2'>, ...]

>>> convore.groups['api-2']
<group 'api-2>

>>> convore.groups['api-2'].leave()
True

>>> convore.group_create(name, description=None, slug=None)
<group 'group-name'>

>>> convore.groups['api-2'].topics
[<topic 'group/topic-name'>, ...]

>>> convore.groups['api-2'].topic_create(name)
<topic 'group/topic-name>

>>> convore.groups['api-2'].topics[topic_id].messages
[<message 'group/topic/'>, ...]

>>> convore.groups['api-2'].topics[topic_id].messages.create(message)
True



convore.group_create(name, decription=None, slug=None)

Installation

To install convore, simply: :

$ pip install convore

Or, if you absolutely must: :

$ easy_install convore

But, you really shouldn't do that.

Contribute

If you'd like to contribute, simply fork the repository, commit your changes to the develop branch (or branch off of it), and send a pull request. Make sure you add yourself to AUTHORS.

Roadmap

  • Documentation
  • Write it!
  • Test it!
  • Fo shizzle

python-convore's People

Contributors

colekowalski avatar gsiegman avatar myusuf3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-convore's Issues

providing invalid login data causes infinite recurssion

Hi,

if I provide invalid login data for convore we get a RuntimeError: maximum recursion depth.
The recursion happens in urllib2.py, but I guess it's how opener is called.

Here is a part of the traceback:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/home/adi/Projekte/private/conveggie/conveggie/data/__init__.py", line 163, in run
    self._check_queue_and_execute()
  File "/home/adi/Projekte/private/conveggie/conveggie/data/__init__.py", line 171, in _check_queue_and_execute
    self._run_command(msg.command, msg.data)
  File "/home/adi/Projekte/private/conveggie/conveggie/data/__init__.py", line 181, in _run_command
    self._do_login(in_data)
  File "/home/adi/Projekte/private/conveggie/conveggie/data/__init__.py", line 189, in _do_login
    response_data['login'] =  self.convore.account_verify()
  File "/home/adi/Projekte/private/conveggie/env/src/convore/convore/core.py", line 47, in account_verify
    r = api.get('account', 'verify')
  File "/home/adi/Projekte/private/conveggie/env/src/convore/convore/api.py", line 53, in get
    r = requests.get(url, params=params, auth=auth)
  File "/home/adi/Projekte/private/conveggie/env/lib/python2.6/site-packages/requests/core.py", line 426, in get
    return request('GET', url, params=params, headers=headers, cookiejar=cookies, auth=auth)
  File "/home/adi/Projekte/private/conveggie/env/lib/python2.6/site-packages/requests/core.py", line 411, in request
    r.send()
  File "/home/adi/Projekte/private/conveggie/env/lib/python2.6/site-packages/requests/core.py", line 186, in send
    resp =  opener(req)
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 429, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 855, in http_error_401
    url, req, headers)
  File "/usr/lib/python2.6/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python2.6/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 429, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 855, in http_error_401
    url, req, headers)
  File "/usr/lib/python2.6/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python2.6/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
.
.
.
.
.
.
.
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 429, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 855, in http_error_401
    url, req, headers)
  File "/usr/lib/python2.6/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python2.6/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 429, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 855, in http_error_401
    url, req, headers)
  File "/usr/lib/python2.6/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python2.6/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
  File "/usr/lib/python2.6/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/home/adi/Projekte/private/conveggie/env/lib/python2.6/site-packages/requests/packages/poster/streaminghttp.py", line 170, in https_open
    return self.do_open(StreamingHTTPSConnection, req)
  File "/usr/lib/python2.6/urllib2.py", line 1133, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib/python2.6/httplib.py", line 910, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.6/httplib.py", line 947, in _send_request
    self.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 904, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 776, in _send_output
    self.send(msg)
  File "/home/adi/Projekte/private/conveggie/env/lib/python2.6/site-packages/requests/packages/poster/streaminghttp.py", line 51, in send
    self.connect()
  File "/usr/lib/python2.6/httplib.py", line 1112, in connect
    self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
  File "/usr/lib/python2.6/ssl.py", line 350, in wrap_socket
    suppress_ragged_eofs=suppress_ragged_eofs)
  File "/usr/lib/python2.6/ssl.py", line 92, in __init__
    socket.__init__(self, _sock=sock._sock)
RuntimeError: maximum recursion depth exceeded while calling a Python object

Cheers
Adi

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.