Skip to main content

A python wrapper for the mlkshk API.

Project description

Pyshk is a python client for the mlkshk.com api.

Documentation is available at http://pyshk.readthedocs.org/en/latest/

Installation

Install with

pip install pyshk

In order to get started, you have to sign up for mlkshk (yay!) and create an application on mlkshk.com. First, you’ll need to sign up for an account here: http://mlkshk.com/create-account.

Then, create we’ll create an application so that you can use the API. You should do that at http://mlkshk.com/developers/new-api-application. Give your application a title and a description. Make sure to fill in the “Redirect URL” cause we’ll use that later. The redirect url has to be exactly the same on mlkshk.com and in your code or the server will return a 500 server error when you try to authenticate.

Once you click the big “Create It!” button, you’ll be given a “Key” and a “Secret”. Write those down. We’ll need them later.

Usage

Start a python interpreter and then import the API:

from pyshk.api import Api

If you don’t have an access token (you won’t if this is the first run), start up the API using the Key and Secret from above:

a = Api(consumer_key=[Key], consumer_secret=[Secret])
a.get_auth(redirect_uri=[the redirect url from above])

At this point, your web browser will open and you’ll be prompted to allow your application (whatever you named it) to access your account. Allow the app access and you’ll be redirected to whatever redirect URL you specified when creating the app. The URL bar will have something like http://[redirect_url]?code=[code]. Copy and paste the [code] portion back into the python interpreter and hit enter. You’ll then be given the access code and the access secret; you should write those down so you don’t have to go through this again.

At this point, the API is authenticated and you can start making calls to the mlkshk server. If you went through this before and you already have an acces code & secret, you can pass those to the API when you instantiate it. Itl’ll be something like:

api = Api(consumer_key='blah',
                  consumer_secret='blahsecretblah',
                  access_token_key='blah',
                  access_token_secret='blahsupersecretblah')

API Coverage & Working resources::

  • GET /api/favorites

  • GET /api/favorites/after/(afterkey)

  • GET /api/favorites/before/(beforekey)


  • GET /api/friends

  • GET /api/friends/after/(afterkey)

  • GET /api/friends/before/(beforekey)


  • GET /api/incoming

  • GET /api/incoming/(id)/after/(afterkey)

  • GET /api/incoming/(id)/before/(beforekey)


  • GET /api/magicfiles

  • GET /api/magicfiles/(id)/after/(afterkey)

  • GET /api/magicfiles/(id)/before/(beforekey)


  • GET /api/shakes

  • GET /api/shakes/(id)

  • GET /api/shakes/(id)/after/(afterkey)

  • GET /api/shakes/(id)/before/(beforekey)


  • GET /api/sharedfile/(sharekey)

  • POST /api/sharedfile/(sharekey)

  • GET /api/sharedfile/(sharekey)/comments

  • POST /api/sharedfile/(sharekey)/comments

  • POST /api/sharedfile/(sharekey)/like

  • POST /api/sharedfile/(sharekey)/save


  • GET /api/user

  • GET /api/user_id/(user_id)

  • GET /api/user_name/(username)


  • POST /api/upload

Notes

  • POST /api/upload returns a 200 response, not 201 as stated in mlkshk docs.

  • GET /api/user_id/[x] & GET /api/user_name[x] for user x who does not exist raises a 500 Server Error, not 404 as in the API docs.

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

pyshk-1.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

pyshk-1.1.0-py2.py3-none-any.whl (12.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pyshk-1.1.0.tar.gz.

File metadata

  • Download URL: pyshk-1.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyshk-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0ba964a58560e2f34ff6a337d924b4def14c20b44ef744fd2e59931c5b090f92
MD5 34542e8ee64c5ca4c7acebcec8415db8
BLAKE2b-256 7038b6aa851d1b324302801fffe631fa2d8c14ec932f17fbc3f0a6325847faad

See more details on using hashes here.

File details

Details for the file pyshk-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyshk-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9c6d38e0363f8c72bd3ef428ee110e000bb694893aa66a0878927344e86340b3
MD5 4f5ff202cc1c069af9c953139a1cf11f
BLAKE2b-256 8d08ecd1ac5005297ae39f98db7d1ec6e3df6644bd20bb03d95fb3d5ba7a46c8

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