Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
57af335
Exception string test
Marx314 Feb 17, 2016
c6dfe65
Merge pull request #3 from Marx314/unittest_exception
mbelang Feb 17, 2016
bbe71ac
Add timeout to http requests
Mar 9, 2016
8725aff
Merge pull request #4 from fguillot/adding-request-timeout
fguillot Mar 9, 2016
3836062
Update readme
olcar Mar 10, 2016
8fe8e96
Changed package name
olcar Mar 10, 2016
ca7cfe2
Ability to use `POST` as default request method
Mar 22, 2016
400c49c
Add test that verifies old import still works.
Mar 22, 2016
67abd3e
Merge pull request #5 from ardeois/master
maxc0c0s Mar 22, 2016
8517a84
UbersmithException returns the original `code` and `message` given by…
Mar 22, 2016
d764652
Merge pull request #6 from ardeois/exception_message
mbelang Mar 23, 2016
6e8fece
Rework test without flexmock, request_mock
Marx314 Mar 23, 2016
2e6ef8a
Merge pull request #7 from Marx314/mock_and_post_readme
fguillot Mar 24, 2016
6bf8f0a
Added more Ubersmith exceptions:
Mar 31, 2016
1b77c12
Merge pull request #8 from internap/handle-request-exceptions
fguillot Mar 31, 2016
693383e
Refactored broken exception handling
Mar 31, 2016
60f5aee
Merge pull request #9 from internap/refactored_exception_handling
Marx314 Mar 31, 2016
98a338e
Handle different content types
Mar 31, 2016
239201d
Single quote to be standard.
Marx314 Mar 31, 2016
b9a1206
Now is better than never.
Marx314 Mar 31, 2016
c5bb98c
Merge pull request #10 from internap/handle-content-type
Marx314 Mar 31, 2016
6d99a63
Update README.rst
r-daneel Apr 7, 2016
114f97c
Merge pull request #11 from r-daneel/fix_documentation-timout_is_float
Apr 8, 2016
8867c3b
cast 'timeout' to float
r-daneel Apr 9, 2016
0591ae5
Merge pull request #12 from r-daneel/patch-1
Apr 10, 2016
96dceed
Remove requests requirements
May 26, 2016
fa3d014
Merge pull request #13 from lindycoder/unlock_requests
Marx314 May 26, 2016
02e5e50
Use python style enumerables in calls
fbouliane Dec 16, 2016
e90348c
Merge pull request #15 from fbouliane/encode-enumberables-as-arguments
Marx314 Dec 16, 2016
6f50b1b
Improve setup.py and requirements.txt
Apr 18, 2017
80f4f9e
Merge pull request #16
fguillot Apr 18, 2017
87ecc9d
Add PEP8 validation and missing copyright headers
Apr 18, 2017
ae8ed0b
Merge pull request #17
fguillot Apr 18, 2017
9ffe346
Send custom user agent (issue #14)
Apr 18, 2017
609c9b2
Add flake8 test to travis.yml
Apr 18, 2017
5c0eebb
Merge pull request #19
fguillot Apr 18, 2017
0748912
Merge pull request #18
fguillot Apr 18, 2017
49cc5e2
Handle file upload
Marx314 Nov 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
language: python

python:
- '2.7'
- '3.4'
- '2.7'
- '3.4'

install:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
script: nosetests
- pip install -r requirements.txt
- pip install -r test-requirements.txt

script:
- nosetests
- flake8

deploy:
provider: pypi
user: internaphosting
Expand Down
44 changes: 34 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
# Ubersmith API Client for Python
Ubersmith API Client for Python
===============================

.. image:: https://travis-ci.org/internap/python-ubersmithclient.svg?branch=master
:target: https://travis-ci.org/internap/python-ubersmithclient

.. image:: https://img.shields.io/pypi/v/ubersmith_client.svg?style=flat
:target: https://pypi.python.org/pypi/ubersmith_client
.. image:: https://img.shields.io/pypi/v/python-ubersmithclient.svg?style=flat
:target: https://pypi.python.org/pypi/python-ubersmithclient

# Usage
Usage
-----

>>> import ubersmith_client
>>> api = ubersmith_client.api.init('http://ubersmith.com/api/2.0/', 'username', 'password')
>>> api.client.count()
u'264'
>>> api.client.latest_client()
1265
.. code:: python

import ubersmith_client

api = ubersmith_client.api.init(url='http://ubersmith.com/api/2.0/', user='username', password='password')
api.client.count()
>>> u'264'
api.client.latest_client()
>>> 1265

API
---

**ubersmith_client.api.init(url, user, password, timeout, use_http_get)**
:url:
URL of your API

*Example:* ``http://ubersmith.example.org/api/2.0/``

:user: API username
:password: API Password or token
:timeout: api timeout given to requests (type: float)

*Default:* ``60``
:use_http_get:
Use `GET` requests instead of `POST`

*Default:* ``False``
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requests<=2.9.1
pbr>=1.8
requests
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ubersmith_client
url = https://github.com/Marx314/python-ubersmithclient
name = python-ubersmithclient
url = https://github.com/internap/python-ubersmithclient
author = Internap
author-email = [email protected]
summary = Another ubersmith lib
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Copyright 2016 Internap
# Copyright 2017 Internap.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,10 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#!/usr/bin/env python
from setuptools import setup

setup(
setup_requires=["pbr>=1.8"],
setup_requires=['pbr'],
pbr=True,
)
5 changes: 3 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
nose==1.2.1
requests-mock==0.7.0
pyhamcrest==1.8.1
pyhamcrest==1.8.1
mock==1.3.0
flake8
7 changes: 0 additions & 7 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,3 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def apply_kwargs(kwargs, default_kwargs):
for k, v in kwargs.items():
if isinstance(v, dict):
default_kwargs[k] = apply_kwargs(v, default_kwargs[k])
else:
default_kwargs[k] = v
return default_kwargs
211 changes: 0 additions & 211 deletions tests/api_test.py

This file was deleted.

Loading