Coder Social home page Coder Social logo

simperium-python's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

simperium-python's Issues

Add python3 support

This library is not compatible with python3. Discovered this while beginning to port sncli to the simperium api.

Would there be any interest from Simperium to add python 3 support? With the current setup it could require a fair bit of work to support both with the current setup - perhaps it would be worth having a second repo simperium-python3 or similar?

Porting would involve:

  • updating the syntax
  • moving to the new urllib (it changed a lot between 2 and 3); perhaps consider using the requests library instead?
  • taking into account differences in string/bytes handling

`changes` method fails with 404 error code

Calling it from the python REPL returns a 404, and attempts at querying it with cURL do as well. Has the endpoint been removed from the server?

This is vexing as there are no other ways for a non-admin user to sync changes across clients via HTTP.

(ins)>>> from simperium.core import Auth, Api
(ins)>>> auth = Auth('xxx, 'xxx')
(ins)>>> token = auth.authorize('xxx', 'xxx')
(ins)>>> api.todo.index()
{u'current': u'5a92faf5d9b5bb1d2d05a3b6', u'index': [{u'id': u'91faf5558dc8cb57c367', u'v': 3}]}
(ins)>>> api.todo.changes()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "simperium/core.py", line 282, in changes
    response = self._request(url, headers=headers, timeout=timeout)
  File "simperium/core.py", line 120, in _request
    response = urllib2.urlopen(request, timeout=timeout)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

delete bad request

Bucket.delete gives me a 400 bad request response. I did some digging, and I get a bad request with everything I try using DELETE. For example:

❯ curl -H 'X-Simperium-Token: REDACTED' -X DELETE \
  https://api.simperium.com/1/redacted/note/i/myredactedid
<html><title>400: Bad Request</title><body>400: Bad Request</body></html>
~
❯ curl -H 'X-Simperium-Token: REDACTED' -X GET \   
  https://api.simperium.com/1/redacted/note/i/myredactedid
{"tags": ["Thing", ... // snip

Am I using it wrong or misreading the docs? I tested with curl following the http docs for the simplenote app (shown above), as well as this python library.

Undocumented `changes` endpoint in Simperium HTTP doc?

In bulk_post of Bucket class, you're making request to changes endpoint, but I couldn't find it on Simperium HTTP doc. I'm writing a client with a method to send buffered entities at once, pretty much like bulk_post. Would be good to have reference for that endpoint (like available query params and expected responses).

This is merely a question not an issue with this Python wrapper.

Installation error on Debian GNU/Linux 8.11 (jessie)

Tried to install as one of the requirements for sncli with following command:

pip install git+https://github.com/swalladge/simperium-python3.git#egg=Simperium3 --user
Downloading/unpacking Simperium3 from git+https://github.com/swalladge/simperium-python3.git
  Cloning https://github.com/swalladge/simperium-python3.git to /tmp/pip-build-v4xf4wpi/Simperium3
  Running setup.py (path:/tmp/pip-build-v4xf4wpi/Simperium3/setup.py) egg_info for package Simperium3
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)
    error in Simperium3 setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
    Complete output from command python setup.py egg_info:
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'

  warnings.warn(msg)

/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'long_description_content_type'

  warnings.warn(msg)

error in Simperium3 setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-v4xf4wpi/Simperium3
Storing debug log for failure in /home/user/.pip/pip.log

What do I miss?

Regards,
Zaxon

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.