Skip to main content

Trace Python Client

https://img.shields.io/pypi/v/py-trace.svg https://img.shields.io/travis/aiguofer/py-trace.svg Documentation Status

Python client for interacting with the Trace api. For information on the API see the api documentation

Getting Started

from py_trace import Trace

client = Trace(<client_key>, <client_secret>)
client.get_authorization_url()
# output should be like https://www.alpinereplay.com/api/oauth_login?oauth_token=<token>, go to the url and authorize the app
# after authorization, you should see a url like http://snow.traceup.com/api/oauth_login?oauth_token=<token>&oauth_verifier=<verifier>
client.get_access_token(<verifier>)
client.get_user()

To use in a web app (using a very basic Flask example):

from flask import Flask, request, redirect
import json

app = Flask(__name__)
trace = Trace(<client_key>, <client_secret>, host + '/auth_callback')

@app.route('/auth_callback')
def handle_redirect():
    trace.get_access_token(request.args['oauth_verifier'])
    return redirect('/user')

@app.route('/auth')
def get_user_token():
    url = trace.get_auth_url()
    return redirect(url)

@app.route('/user')
def get_user():
    return json.dumps(trace.get_user())

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2018-07-22)

  • First release on PyPI.

Release files for py-trace 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-trace 0.1.1
File Size Uploaded
py_trace-0.1.1.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-trace 0.1.1
File Interpreter ABI Platform
py_trace-0.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 25.4 kB

Release files / py_trace-0.1.1.tar.gz

Download URL py_trace-0.1.1.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e42f2e2148a5efe47b446b30d7fcd9fbe85779a15b07d4be886247f2a5d3068e
BLAKE2b-256 checksum
How to use checksums
fa4dc5f72253a4faa35c2dbd84467c7d9289e946c55d82f40afaa45be32f0213
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / py_trace-0.1.1-py2.py3-none-any.whl

Download URL py_trace-0.1.1-py2.py3-none-any.whl
Size 8.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e2331535ec5da3395001707d4df4cc133599ecec66ce95d541ab13bad8364562
BLAKE2b-256 checksum
How to use checksums
e6bb5c0ab8da171f342981ba970e46ad88ee3b8afda5768cc65f9e85bcf5fd54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page