Skip to main content

A very easy to use OAuth python library for Yahoo! APIs.

Project description

yahoo_oauth

Build Status Documentation Status Code Health PyPI PyPI PyPI PyPI Coverage Status PyPI

Yahoo_OAuth is a very easy to use OAuth library for Yahoo! APIs.

Installation

pip install yahoo_oauth

Quickstart

Only 2 parameters are required to get started

  • consumer_key
  • consumer_secret

I recommend putting those two into a file. Only json and yaml files are supported

{
    "consumer_key": "my_very_long_and_weird_consumer_key",
    "consumer_secret": "my_not_that_long_consumer_secret"
}

Once you acquired your access_token, this file will look like :

  • OAuth2
{
    "access_token": "DELvMgOYvwPQJS8eFW_2hRN5rJxz6dnHAOk2s.qB0iMIeRg5.ZpW3xZF0p8CABLjZ2gfNdE602dCN2wTHdGHHLtChF3ls9BUuZ1QDdqIVq.yWclfweleyZSq6dAzlPEHiskWmfItjHK5VERY_LONG_ACCESS_TOKEN_oyyD4cIKvdNJsJ9k779mAUqN02_5ugBeDfCLebqjL8uVuunObew0ERa2MxE6jywNY0TTCe9W0nqTd6n0lKoN4PSP1Dw_Ifwx6enGuhUUAhhpa7nNMyhNy_pe6PfDf7IJ5gbkdtw3mD1o2T218ZTV0owdrKDLSF9oZrNvZ75xDlqaaI5yeW_.L63zk11PjsWUd5K8LGhWSTgRbyhffCDBcqVwTYEqHwCyVqHX4z2kgHhGsc0ies6WMG33kSw5Cgun0fnPbdDuHBgQziXU.GMv4hIDoIDMSLGpzpcpkyx4GS1CC_RUQwKxLilR3MQy7X2gI3cJA4lhRPlXEOdhS5HIQiQTgMWO9nWt7.RR7XtXVg-",
    "consumer_key": "dj0yJmk9eFJINERDYWMY_CONSUMER_KEYmRGTnpZbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1iNQ--",
    "consumer_secret": "08802b459ab48eeaMY_CONSUMER_SECRET_0af6a4b75789f7",
    "guid": "AJHDHJMYGUID",
    "refresh_token": "APIENFXij.bjFW1tEcr2THE_REFRESH_TOKEN_Xn.4.DOIYOR37",
    "token_time": 1433553339.706037,
    "token_type": "bearer"
}

With that you should be good to go.

Normally, once your got all that, you can use the same credentials FOREVER, you just have to REFRESH THEM.

Examples

OAuth2

from yahoo_oauth import OAuth2
oauth = OAuth2(None, None, from_file='oauth2.json')
...

if not oauth.token_is_valid():
    oauth.refresh_access_token()
# Example
response = oauth.session.get(url, params=payload)

Tips

  • How to get your Global Unique Identifier (GUID)
from yahoo_oauth import OAuth2

oauth = OAuth2('consumer_key', 'consumer_secret')
guid = oauth.guid
  • How to disable Yahoo_OAuth Logger
import logging
oauth_logger = logging.getLogger('yahoo_oauth')
oauth_logger.disabled = True

Contribute

Any kind of contribution is welcomed.

  1. report bug by opening an issue
  2. Fork the repository
  3. Make your changes
  4. Test your changes
  5. Submit a pull request

Have fun guys :wink:

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

yahoo_oauth-2.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

yahoo_oauth-2.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file yahoo_oauth-2.1.0.tar.gz.

File metadata

  • Download URL: yahoo_oauth-2.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.7 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for yahoo_oauth-2.1.0.tar.gz
Algorithm Hash digest
SHA256 cac85f48a2007150ea70c104ed48601241b3f42b328c7a70e2dc083d6d46356f
MD5 b13b204f22bef390976b57b2bd635811
BLAKE2b-256 ade114ca99762c658d839be78fb15d959a3bfc72ba4cbe4b6d79b76b0b5532b2

See more details on using hashes here.

File details

Details for the file yahoo_oauth-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: yahoo_oauth-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.7 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for yahoo_oauth-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4762e3139690f0c1e6af8109a9b8abe99ed4ba5853f269c69554135be6eeed8
MD5 33c7298577f87805d9e5b0fa593dec3f
BLAKE2b-256 e41394d5ce4266f46964e3fe4042e09857c95043f90dfec71665bf3dd1fbdc03

See more details on using hashes here.

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