Coder Social home page Coder Social logo

client-python's Introduction

civo

client-python's People

Contributors

aditya-narayan-nayak avatar alejandrojnm avatar andyjeffries avatar hoogenm avatar kaihoffman avatar martynbristow avatar tanmaymunjal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

client-python's Issues

404 on `civo.templates.search()`

I am getting a 404 when I am trying to list the templates

here is the error output

In [33]: civo=Civo("VALID_TOKEN", region="SVG1")

In [34]: civo.templates.search()
---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
File /usr/lib/python3.10/site-packages/requests/models.py:910, in Response.json(self, **kwargs)
    909 try:
--> 910     return complexjson.loads(self.text, **kwargs)
    911 except JSONDecodeError as e:
    912     # Catch JSON-related errors and raise as requests.JSONDecodeError
    913     # This aliases json.JSONDecodeError and simplejson.JSONDecodeError

File /usr/lib/python3.10/json/__init__.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    343 if (cls is None and object_hook is None and
    344         parse_int is None and parse_float is None and
    345         parse_constant is None and object_pairs_hook is None and not kw):
--> 346     return _default_decoder.decode(s)
    347 if cls is None:

File /usr/lib/python3.10/json/decoder.py:340, in JSONDecoder.decode(self, s, _w)
    339 if end != len(s):
--> 340     raise JSONDecodeError("Extra data", s, end)
    341 return obj

JSONDecodeError: Extra data: line 1 column 5 (char 4)

During handling of the above exception, another exception occurred:

JSONDecodeError                           Traceback (most recent call last)
Input In [34], in <cell line: 1>()
----> 1 civo.templates.search()

File ~/.local/lib/python3.10/site-packages/civo/templates.py:88, in Templates.search(self, filter)
     85     data = r.json()
     86     return filter_list(data=data, filter_by=filter)
---> 88 return r.json()

File /usr/lib/python3.10/site-packages/requests/models.py:917, in Response.json(self, **kwargs)
    915     raise RequestsJSONDecodeError(e.message)
    916 else:
--> 917     raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

JSONDecodeError: [Errno Extra data] 404 page not found
: 4

if for example, I am trying to list my SSH keys it works properly

In [35]: civo=Civo("VALID_TOKEN", region="SVG1")

In [36]: civo.ssh.search()
Out[36]:
[{'id': '0b3f565e-755f-4514-ac96-92f90ca2f980',
  'name': 'jstilia',
  'fingerprint': 'SHA256:cMNof4c6cA/txrP2EeXZfkTA9YjF+vKB4MyGyCfYW6A'}]

In [37]:

Adding auto-reformatting to the master branch

Hey, so I recently setup auto-reformatting using black on my fork to make sure I sent in clean code for any PRs and also didn't have to do the code formatting manually myself.

I was just wondering if it would be a good idea to setup auto-reformatting on the master branch as well to maintain consistent code formatting. Or maybe we should add code style guide to the project and ask all contributors to follow it ig?

Wdyt?

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.