#Picovico Python SDK The official python-sdk from Picovico API.
Reference | Link |
---|---|
API documentation | http://docs.picovico.com |
Create API account | http://picovico.com/api |
The official python-sdk from Picovico ($ pip install picovico)
Home Page: https://api.picovico.com
#Picovico Python SDK The official python-sdk from Picovico API.
Reference | Link |
---|---|
API documentation | http://docs.picovico.com |
Create API account | http://picovico.com/api |
PROFILES should not be case sensitive
The URL endpoints should clearly define the workflow. They should be categorized.
request_post
request_get
api_request_put
api_request_delete
class Api:
def get_api_headers(is_anonymous):
if is_anonymous():
headers = anonymous_headers()
else:
if not authorized
uNauth excetpion
headers = auth_headers()
return headers
def put(url, data, is_anonymous=False):
response = requests.put(api_endpoint + url, data=data, headers=self.get_api_headers(is_anonymous))
return get_sdk_response(response)
def put(url, data, is_anonymous):
response = requests.put(url, data=data, headers=self.get_api_headers(is_anonymous))
return get_sdk_response(response)
def put(url, data, is_anonymous):
response = requests.put(url, data=data, headers=self.get_api_headers(is_anonymous))
return get_sdk_response(response)
def put(url, data, is_anonymous):
response = requests.put(url, data=data, headers=self.get_api_headers(is_anonymous))
return get_sdk_response(response)
def get_sdk_response(response) :
- exception handling
- json decode
Installed /tmp/easy_install-AfcQay/mock-2.0.0/pbr-1.9.1-py2.7.egg
Marker evaluation failed, see the following error. For more information see: http://docs.openstack.org/developer/pbr/compatibility.html#evaluate-marker
ERROR:root:Error parsing
Traceback (most recent call last):
File "/tmp/easy_install-AfcQay/mock-2.0.0/pbr-1.9.1-py2.7.egg/pbr/core.py", line 111, in pbr
attrs = util.cfg_to_args(path, dist.script_args)
File "/tmp/easy_install-AfcQay/mock-2.0.0/pbr-1.9.1-py2.7.egg/pbr/util.py", line 248, in cfg_to_args
kwargs = setup_cfg_to_setup_kwargs(config, script_args)
File "/tmp/easy_install-AfcQay/mock-2.0.0/pbr-1.9.1-py2.7.egg/pbr/util.py", line 431, in setup_cfg_to_setup_kwargs
if pkg_resources.evaluate_marker('(%s)' % env_marker):
File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1302, in evaluate_marker
return cls.interpret(parser.expr(text).totuple(1)[1])
File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1337, in interpret
return op(nodelist)
File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1250, in atom
return cls.interpret(nodelist[2])
File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1337, in interpret
return op(nodelist)
File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1271, in comparison
raise SyntaxError(msg)
SyntaxError: '<' operator not allowed in environment markers
error: Setup script exited with error in setup command: Error parsing /tmp/easy_install-AfcQay/mock-2.0.0/setup.cfg: SyntaxError: '<' operator not allowed in environment markers
from picovico import PicovicoProject
Currently, the output format is just json maybe yaml and others could be nice.
Please refer to some standard libraries like facebook sdk and similar and lets try to follow some of the test practices / exceptions handling those libraries have used.
Delete unnecessary file from feature branch v2.0
$ which picovico-client
$HOME/.virtualenvs/picovico-python-sdk-test/bin/picovico-client
$ picovico-client
from: can't read /var/mail/picovico.cli.argsparser
$HOME/.virtualenvs/picovico-python-sdk-test/bin/picovico-client: line 5: syntax error: unexpected end of file
The staticmethods should be avoided wherever possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.