Skip to main content

A basic package allowing the user to interact with Jock MKTs API

Project description

https://img.shields.io/pypi/v/jockmkt-sdk https://img.shields.io/github/license/nysugfx/jockmkt-sdk https://img.shields.io/pypi/pyversions/jockmkt-sdk

This is an unofficial wrapper built to interface with the Jock MKT API.

The developer of this sdk is in no way affiliated with Jock MKT – please use at your own risk.

The aim of this SDK is to build a host of easy-to-use tools for users to interact with the Jock MKT API. It includes every possible api call, every optional argument, and objects that organize all of their responses. In the future, additions will be made to further simplify these api calls with the addition of useful tools.

JockMKT Official API Docs

Code snippet

# the following code will buy $50 worth of shares for every player in an event
# whose last traded price is less than the estimated price
client = Client()
client.get_auth_token(secret_key, api_key)
event = client.get_event(event_id, include_tradeables=True)
for tradeable in event.tradeables:
     if tradeable.last < tradeable.estimated:
         auth.place_order(tradeable.id, price=tradeable.estimated, size=50)

Installation (via PyPi)

  pip install jockmkt-sdk

- pypi link

Contribute

Docs

  • readthedocs

Features

  • Calls for every API endpoint

  • Exception handling

  • Simple auth token generation & use

  • Simple order placement

Todo

  • implement different order types (i.e. market & immediate or cancel)

  • user uploaded projections

  • filter players, events, games, etc. based on team, position, if playing today, etc.

Getting Started

Obviously, create an account at jockmkt.com

Contact developers@jockmkt.com for your auth keys

Authorization & basic calls:
from jockmkt-sdk.client import Client
api_key = '<jm_key_xxx>'
secret_key = '<xxx>'

client = Client()
client.get_auth_token(secret_key, api_key)

#display the first 100 nba entities
players = client.get_entities(start=0, league='nba')

#get 25 recent and upcoming events:
events = client.get_events()

#get the last 500 events:
fetchall_events = []
for i in range(5):
     fetchall_events.append(client.get_events(start=i, limit=100))

#get a single event:
event_id = events[0].event_id
event = client.get_event(event_id, include_tradeables=True)

#join an event:
entry = client.create_entry(event_id)

#view event profit:
print(entry.profit)

#view event tradeables:
tradeables = event.tradeables

#pick a specific player and place an order during IPO phase at the Jock MKT estimated price:
for player in tradeables:
     if player.name == 'Paul George':
          client.place_order(player.tradeable_id, player.estimated)

#buy a specified $ amount worth of a player at the market price, during live trading:
order = client.create_order(id=player.tradeable_id, price=player.ask,
     phase='live', order_size=100)

#cancel order
client.cancel_order(order['order']['id'])

Contact

nysu.gfx@gmail.com

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

jockmkt-sdk-0.1.3.tar.gz (18.4 kB view hashes)

Uploaded Source

Built Distribution

jockmkt_sdk-0.1.3-py3-none-any.whl (17.6 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