Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
* develop:
  Change release date
  Update documentation
  Update documentation
  Update documentation
  Clean up link for Retrofit in CHANGELOG.rst
  Fix links in CHANGELOG.rst
  Update documentation
  Add CHANGELOG.rst
  Update documentation
  Add `sphinx-autobuild` requirement for documentation
  Fix documentation build issues
  Update Documentation
  Update documentation
  Update documentation
  Update `uplink.Path` documentation.
  Update deploy settings
  Update documentation
  Update documentation
  • Loading branch information
prkumar committed Oct 20, 2017
2 parents 0e75dc8 + fec809d commit 4b975aa
Show file tree
Hide file tree
Showing 17 changed files with 698 additions and 200 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ deploy:
secure: 2Gbn5BKdn4VovYg/iQTvVWndfzKm8941aF7mPcZ+Ped4Y1asDW8EEqhBP3Ocknive4HOwe22B4phIqnZ31/g2p/20lo5z/ywULwOCCuoRGTz5lMCFQt4MkJp3fvJwVUShOPJHPW4450UUOqmCoylaXFZsgq5+HLuplCMUgWro7ZiM8mfq6X45iCrHRGXSUh1SSmgSMLYZ7cM80bjvGjP0SlSsh+5ZUS6srDlUxFilH6Cc7+y0CjrnOxk1YIEhk+usLccaewpn0tpdhQf5gLQ6Q+3hj/o/ovnUiPyy4kYeCHjOgcv50JKPWNzM8Ie+9iWNZycs3tvwwZyWRueRMGAjnIO+AigQjuzIoaN8QEt3GyU0Rxxt1qU+KMgBvgSXV66l6w8Q5htpCD1fxIQxdElx+7gZQ1FUm9sHP7BVNVHgKPDP0etO+k5nx9d/1dXVw1CxSO/4zwfJ6VfxFIkIzOleoT7lydzdKsFY/5PlCD2WjErQfbdO8HIqinBwTFG+gfqZnblp64sRNMAcmzkqxN9GocltctRwmPHRbhUP960akeqbKlfQsAXrB2cxMIwYsX8AG21MQ+4hAOgQinAc5AiZ4Gmy7Nq0dxC126uAC9t8Y+4sq2Cwft7xzy/iSMM2hmPOlQx0kWbI7T1eI3FcXvz2aUdLhOz2o5L6VGfie7/RNo=
on:
tags: true
python: '3.6'
distributions: "sdist bdist_wheel"
27 changes: 27 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Changelog
*********

All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog`_, and this project adheres to the
`Semantic Versioning`_ scheme.

0.1.0 - 2017-10-19
==================

Added
-----
- Python ports for almost all method and argument annotations in Retrofit_.
- Adherence to the variation of the semantic versioning scheme outlined in
the official Python package distribution tutorial.
- MIT License
- Documentation with introduction, instructions for installing, and quick
getting started guide covering the builder and all method and argument
annotations.
- README that contains GitHub API v3 example, installation instructions with
``pip``, and link to online documentation.


.. _Retrofit: http://square.github.io/retrofit/
.. _`Keep a Changelog`: http://keepachangelog.com/en/1.0.0/
.. _`Semantic Versioning`: https://packaging.python.org/tutorials/distributing-packages/#semantic-versioning-preferred
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include README.rst LICENSE requirements.txt
include README.rst CHANGELOG.rst LICENSE requirements.txt
recursive-include tests *.py
16 changes: 9 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ Python HTTP Made Expressive. Inspired by `Retrofit <http://square.github

|PyPI Version| |Build Status| |Coverage Status| |Documentation Status|

**A Quick Walkthrough, with GitHub API v3**
A Quick Walkthrough, with GitHub API v3
---------------------------------------

Using decorators and function annotations, you can turn any plain old Python
class into an HTTP API consumer:
class into a self-describing consumer of your favorite HTTP webservice:


.. code-block:: python
Expand All @@ -17,7 +19,7 @@ class into an HTTP API consumer:
# To register entities that are common to all API requests, you can
# decorate the enclosing class rather than each method separately:
@headers({"Accept": "application/vnd.github.v3.full+json"})
class GitHubService(object):
class GitHub(object):
@get("/users/{username}")
def get_user(self, username):
Expand All @@ -32,11 +34,11 @@ To construct a consumer instance, use the helper function ``uplink.build``:

.. code-block:: python
github = build(GitHubService, base_url="https://api.github.com/")
github = build(GitHub, base_url="https://api.github.com/")
To access the GitHub API with this instance, we simply invoke any of the methods
that we defined in the interface above. To illustrate, let's update my GitHub
user's bio:
profile bio:

.. code-block:: python
Expand All @@ -52,8 +54,8 @@ sends that synchronously over the network. Furthermore, the returned
print(response.json()) # {u'disk_usage': 216141, u'private_gists': 0, ...
In essence, **Uplink** delivers API consumers that are self-describing,
reusable, and fairly compact, with minimal user effort.
In essence, Uplink delivers reusable and self-sufficient objects for
accessing HTTP webservices, with minimal code and user pain ☺️.

Installation
------------
Expand Down
5 changes: 4 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

livehtml:
sphinx-autobuild -b html $(ALLSPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html"
7 changes: 5 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode']
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
25 changes: 25 additions & 0 deletions docs/source/decorators.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Method Annotations
******************

Assign HTTP :code:`headers`
===========================

Format POST/PUT/PATCH Request Body
==================================

``form_url_encoded``
--------------------

``multipart``
-------------

``json``
--------

Apply :code:`timeout` on Request
================================

Annotate Arguments with :code:`args`
====================================


0 comments on commit 4b975aa

Please sign in to comment.