Skip to main content

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.

Metadata

Release files for pyshk 1.1.0

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

Source distribution (sdist)

Source distribution for pyshk 1.1.0
File Size Uploaded
pyshk-1.1.0.tar.gz 9.7 kB Details

Built distribution (wheel)

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

Total release size: 22.2 kB

Release files / pyshk-1.1.0.tar.gz

Download URL pyshk-1.1.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0ba964a58560e2f34ff6a337d924b4def14c20b44ef744fd2e59931c5b090f92
BLAKE2b-256 checksum
How to use checksums
7038b6aa851d1b324302801fffe631fa2d8c14ec932f17fbc3f0a6325847faad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyshk-1.1.0-py2.py3-none-any.whl

Download URL pyshk-1.1.0-py2.py3-none-any.whl
Size 12.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9c6d38e0363f8c72bd3ef428ee110e000bb694893aa66a0878927344e86340b3
BLAKE2b-256 checksum
How to use checksums
8d08ecd1ac5005297ae39f98db7d1ec6e3df6644bd20bb03d95fb3d5ba7a46c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

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