Skip to main content

Wrap REST APIs to fit nicely into your python code

Project description

https://img.shields.io/pypi/v/snug.svg https://img.shields.io/pypi/l/snug.svg https://img.shields.io/pypi/pyversions/snug.svg https://travis-ci.org/ariebovenberg/snug.svg?branch=master https://coveralls.io/repos/github/ariebovenberg/snug/badge.svg?branch=master Documentation Status Maintainability

Wrap web APIs to fit nicely into your python code For python 3.5+.

Quickstart

 import json
 import snug

 @snug.querytype()
 def repo(name: str, owner: str):
    """a repo lookup by owner and name"""
    request = snug.http.GET(f'https://api.github.com/repos/{owner}/{name}')
    response = yield request
    return json.loads(response.data)

exec = snug.http.simple_exec()

Check the examples/ directory for some samples.

Release history

development

0.3.0 (2018-01-14)

  • generator-based queries

0.1.2

  • fixes to documentation

0.1.1

  • improvements to versioning info

0.1.0

  • implement basic resource and simple example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snug-0.3.0.tar.gz (11.9 kB view hashes)

Uploaded Source

Built Distribution

snug-0.3.0-py3-none-any.whl (17.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page