jockmkt_sdk package

Submodules

jockmkt_sdk.client module

class jockmkt_sdk.client.Client(secret, api_key, request_params=None, verbose=False)

Bases: object

The user should initialize an instance of this class: e.g. Client(secret, api_key) and then they should call whichever method they wish. The class will automatically obtain an auth token. Functionality included to auto update expired auth tokens or retreive new one if necessary.

Variables
  • secret – The user’s secret key: xxx

  • api_key – the user’s api key: jm_api_xxx

ACCOUNT = {}
API_VERSION = 'v1'
BASE_URL = 'https://api.jockmkt.net'
LEAGUES = ['nba', 'nfl', 'nhl', 'pga', 'mlb', 'nascar']
MLB_SCORING = {'at_bat': 0.5, 'double': 3, 'home_run': 4, 'rbi': 2, 'run': 2, 'single': 2.5, 'stolen_base': 3, 'strikeout': -1, 'triple': 3.5, 'walk': 2}
NASCAR_SCORING = {'lap_complete': 1, 'position': -1, 'start_bonus': 40, 'win': 10}
NBA_SCORING = {'10_pt_bonus': 1.5, '3pm': 0.5, 'assist': 1.5, 'block': 2, 'missed_fg': -0.5, 'point': 1, 'rebound': 1.25, 'steal': 2, 'turnover': -0.5}
NFL_SCORING = {'100_yd_passing_bonus': 1, '100_yd_receiving_bonus': 3, '100_yd_rushing_bonus': 3, 'fumble_lost': -3, 'int_thrown': -3, 'pass_td': 4, 'pass_yards': 0.04, 'receiving_td': 6, 'receiving_yards': 0.1, 'reception': 1, 'return_td': 6, 'rush_td': 6, 'rush_yards': 0.1, 'two_pt_conversion': 2}
NHL_SCORING = {'35_plus_saves': 3, '3_plus_blocks': 3, '3_plus_pts': 3, 'assist': 5, 'blocked_shot': 2, 'goal': 8.5, 'goal_allowed': -3.5, 'goalie_save': 0.5, 'goalie_win': 6, 'hat_trick': 3, 'hits': 1, 'ot_loss': 2, 'penalty_mins': -0.5, 'shootout_goal': 1.5, 'shorthanded_pt': 2, 'shot_on_goal': 1.5, 'shutout': 4}
PGA_SCORING = {'albatross': 4, 'birdie': 2, 'bogey': 0, 'double_bogey': -1, 'eagle': 3, 'par': 1, 'quadruple_bogey': -3, 'quintuple_bogey': -4, 'triple_bogey': -2, 'win': 5}
WS_BASE_URL = 'wss://api.jockmkt.net/streaming/'
balance = {}
create_entry(event_id: str) Dict

create an entry to an event given an event_id e.g. evt_60dbec530d2197a973c5dddcf6f65e12

Parameters

event_id (str, required) – the event_id for which the user would like to create an entry to

delete_order(order_id: str) Dict

delete a specific order

Parameters

order_id (str, required) – order id for which the user is attempting to delete (e.g. ord_601b5ad6538ec34875ee1687c4a657f8)

Returns

json response with information about the order deletion

get_account() Dict
get_account_activity(start: int = 0, limit: int = 100) List[jockmkt_sdk.objects.AccountActivity]

returns a user’s most recent account activity

Parameters
  • start (int, optional) – the page of account activity which the user wants to display, default = 0 (first page of responses)

  • limit (int, optional) – the quantitiy of account activity objects the user wants to see, default = 100

Returns

a list of objects.AccountActivity

Return type

List[AccountActivity]

get_account_bal() Dict

method retreiving user’s USD balance

get_entities(start: int = 0, limit: int = 100, include_team: bool = True, league: Optional[str] = None, include_count: bool = False) Union[List[jockmkt_sdk.objects.Entity], Tuple[List[jockmkt_sdk.objects.Entity], int]]

fetch entities (players of any sport). The user will have to paginate.

Parameters
  • start (int, optional) – page at which the user wants to start their search, default: 0 (first page of entities)

  • limit (int, optional) – number of entities the user wants to display, default: 100 (displays 100 entities)

  • include_team (bool, optional) – include team information for the entity, default: False

  • league (str, optional) – filter by league, must be one of: [‘nba’, ‘nfl’, ‘nhl’, ‘pga’, ‘mlb’, ‘nascar’]

  • include_count (bool, optional) – include the count of available entities for this request as part of a tuple in the return value

Returns

a list of league-specific Entity objects, or a tuple of the list and the available entity count.

Return type

List[objects.Entity] | Tuple[List[objects.Entity], int]

get_entity(entity_id: str, include_team: bool = False) jockmkt_sdk.objects.Entity

fetch a specific entity based on their entity id

Parameters
  • entity_id (str, required) – The chosen entity’s id (e.g “en_9af7d442f918404feced51d877989aa0”)

  • include_team (bool, optional) – include team information for the entity, default: False

Returns

a league-specific entity object, one of: objects.NBAEntity, objects.NFLEntity, objects.NHLEntity, objects.NascarEntity, objects.PGAEntity, MLBEntity which are all children of the objects.Entity

Return type

objects.Entity

get_entries(start: int = 0, limit: int = 10, include_payouts: bool = False, include_tradeables: bool = False, include_count: bool = False) Union[List[jockmkt_sdk.objects.Entry], Tuple[List[jockmkt_sdk.objects.Entry], int]]

obtain information about events a user has entered

Parameters
  • start (int, optional) – Page at which the user wants to start their search, default: 0 (first page of entries)

  • limit (int, optional) – Number of entities the user wants to display, default: 10 (displays 10 recent and upcoming entries)

  • include_payouts (bool, optional) – Option to include payouts of completed entries, default: False

  • include_tradeables (bool, optional) – Option to include entry-relevant objects.Tradeable objects

  • include_count (bool, optional) – Include the total entry count as part of a returned tuple

Returns

A list of objects.Entry objects, or a tuple of the list and an int representing the total number of entries.

Return type

object.Entry | tuple(list[object.Entry], int)

get_entry(entry_id: str, include_event: bool = False, include_payouts: bool = False, include_tradeables: bool = False) jockmkt_sdk.objects.Entry

Method to obtain information about an event that a user has entered. include_payouts and include_tradeables will only provide info after the event is paid out.

Parameters
  • entry_id (str, required) – The entry_id for which the user wishes to get information (e.g. evt_60dbec530d2197a973c5dddcf6f65e12)

  • include_event (bool, optional) – Include objects.Event information related to the entry

  • include_payouts (bool, optional) – Include payouts for the user’s holdings of a completed event

  • include_tradeables (bool, optional) – Include relevant event object.Tradeable objects

Returns

a list of objects.Entry objects, containing the user’s chosen fields

Return type

objects.Entry

get_event(event_id: str) jockmkt_sdk.objects.Event

fetch a particular event, by default includes games, payouts and tradeables. This is easier than pulling payouts, tradeables, and games separately

Parameters

event_id (str, required) – The event_id for your chosen event, (e.g. evt_60dbec530d2197a973c5dddcf6f65e12)

Returns

An objects.Event, including its payouts, tradeables and games

Return type

objects.Event

get_event_games(event_id: str) List[jockmkt_sdk.objects.Game]

get all games in an event

Parameters

event_id (str, required) – the event_id for your chosen event, (e.g. evt_60dbec530d2197a973c5dddcf6f65e12)

Returns

a list of event-relevant objects.Game objects

Return type

List[objects.Game]

get_event_payouts(event_id: str) dict

get payouts for each rank of an event

Parameters

event_id (str, required) – The event_id for your chosen event, (e.g. evt_60dbec530d2197a973c5dddcf6f65e12)

Returns

a dictionary of the chosen event’s payouts

Return type

dict

get_event_tradeables(event_id: str) List[jockmkt_sdk.objects.Tradeable]

get all tradeables in an event

Parameters

event_id (str, required) – The event_id for your chosen event, (e.g. evt_60dbec530d2197a973c5dddcf6f65e12)

Returns

a list of objects.Tradeable objects participating in the chosen event

Return type

List[objects.Tradeable]

get_events(start: int = 0, limit: int = 25, league: Optional[str] = None, include_sims: bool = False, include_count: bool = False) Union[List[jockmkt_sdk.objects.Event], Tuple[List[jockmkt_sdk.objects.Event], int]]

Populates event objects with recent and upcoming events

Parameters
  • start (int, optional) – Page at which the user wants to start their search, default: 0 (first page of events)

  • limit (int, optional) – Number of entities the user wants to display, default: 25 (displays 25 recent and upcoming events)

  • league (str, optional) – Filter by league, must be one of: [‘nba’, ‘nfl’, ‘nhl’, ‘pga’, ‘mlb’, ‘nascar’]

  • include_sims (bool, optional) – Will return all events, including Horse Sims for test use

  • include_count (bool, optional) – include the count of available events for this request as part of a tuple in the return value

Returns

list of objects.Events, containing the event_id and information for each

Return type

List[objects.Event]

get_game(game_id: str) jockmkt_sdk.objects.Game

fetch a specific entity based on their entity id

Parameters

game_id (str, required) – a string of the game id (e.g. “game_60bb686586eaf95a5e8dafa3823d89cb”)

Returns

a objects.Game object, containing the relevant fields

Return type

objects.Game

get_game_logs(start: int = 0, limit: int = 100, log_id: Optional[str] = None, entity_id: Optional[str] = None, game_id: Optional[str] = None, include_ent: bool = True, include_game: bool = False, include_team: bool = False, include_count: bool = False) Union[List[jockmkt_sdk.objects.GameLog], Tuple[List[jockmkt_sdk.objects.GameLog], int]]

fetch game logs

Parameters
  • start (int, optional) – Page at which the user wants to start their search, default: 0 (first page of game_logs)

  • limit (int, optional) – Number of entities the user wants to display, default: 100 (displays 100 game_logs)

  • log_id (str or list of str, optional) – Filter for a specific log or list of logs (e.g. “gl_60cde7f973f9e00674785e5e144a802b”)

  • entity_id (str, optional) – Filter all game logs for a specific player, (e.g. “en_67c8368a3905f8beee69393ccec854e5”)

  • game_id (str, optional) – filter all game logs for all players in a specific game, (e.g. “game_60cde69ee06e791b99ed71e6013fc4a7”)

  • include_ent (bool, optional) – Returns entity information attached to the game log (entity name, team, etc.)

  • include_game (bool, optional) – Returns game information (game name, teams, status)

  • include_team (bool, optional) – Returns team information (team name, location, league, etc.)

  • include_count (bool, optional) – include the count of available game logs for this request as part of a tuple in the return value

Returns

a list of objects.GameLogs, containing scoring information for a player in a specific game.

If include_count == True, it will be at tuple of the list of logs and an integer for count of game logs available. :rtype: objects.GameLog | Tuple[objects.GameLog, int]

get_games(start: int = 0, limit: int = 100, league: Optional[str] = None, include_count: bool = False) Union[List[jockmkt_sdk.objects.Game], Tuple[List[jockmkt_sdk.objects.Game], int]]

provides a list of teams for all or chosen leagues that have team structure the user will have to paginate.

Parameters
  • start (int, optioanl) – page at which the user wants to start their search, default: 0 (first page of games)

  • limit (int, optional) – number of entities the user wants to display, default: 100 (displays 100 recent and upcoming games)

  • league (str, optional) – filter by league, must be one of: [‘nba’, ‘nfl’, ‘nhl’, ‘pga’, ‘mlb’, ‘nascar’]

  • include_count (bool, optional) – include the count of available games for this request as part of a tuple in the return value

Returns

A list of objects.Game objects

Return type

list

get_order(order_id: str) jockmkt_sdk.objects.Order

get information about a specific order

Parameters

order_id (str, required) – Order id for which the user is searching (e.g. ord_601b5ad6538ec34875ee1687c4a657f8)

Returns

objects.Order

Return type

Order

get_orders(start: int = 0, limit: int = 100, event_id: Optional[str] = None, active: bool = False, updated_after: Optional[int] = None, include_count=False) Union[List[jockmkt_sdk.objects.Order], Tuple[List[jockmkt_sdk.objects.Order], int]]

Get all of a user’s orders. The user is required to paginate if they want to see more than 1 page

Parameters
  • start (int, optional) – Page at which the user wants to start their search, default: 0 (first page of entities)

  • limit (int, optional) – Number of entities the user wants to display, default: 100 (displays 100 entities)

  • event_id (str, optional) – the event_id for your chosen event, (e.g. evt_60dbec530d2197a973c5dddcf6f65e12)

  • active (bool, optional) – Whether to display only orders that are active (either created or accepted), default = False

  • updated_after (int, optional) – filter orders updated after 13 digit epoch timestamp (orders with fills, partial fills, cancellations, outbids, etc. after that time)

  • include_count (bool, option) – Include the number of TOTAL orders in the return value.

Returns

a list of objects.Order objects | a tuple of a list of objects.Order and an int representing total order count.

Return type

objects.Order

get_positions(include_count: bool = False) Union[List[jockmkt_sdk.objects.Position], Tuple[List[jockmkt_sdk.objects.Position], int]]
Parameters

include_count (bool, optional) – Include the total positions count as the second part of a tuple in return value

Returns

a user’s open positions in all current events, and if include_count==True, the total count of positions.

get_scoring(league: str) Dict[str, Dict[str, float]]

method to retreive information about scoring for different league events

Parameters

league (str, required) – the league for which you’d like to retreive scoring

Returns

scoring information for the chosen league

Return type

dict

get_team(team_id: str) jockmkt_sdk.objects.Team

fetch a specific team based on their team id

Parameters

team_id (str, required) – a team id, starting with team (e.g. “team_8fe94ef0d1f0a00e1285301c4092650f”)

Returns

a dictionary with team information

Return type

objects.Team

get_teams(start: int = 0, league: Optional[str] = None) List[jockmkt_sdk.objects.Team]

provides a list of teams for all or chosen leagues that have team structure. displays only the first page, the user can paginate via:

Parameters
  • start (int, optional) – Which page the user wants to display. Default: 0 (first 100 teams)

  • league (str, optional) – which league the user is searching for teams, one of: [‘nba’, ‘nfl’, ‘nhl’, ‘pga’, ‘mlb’, ‘nascar’]

Returns

a list of Team objects

Return type

List[Team]

get_ws_topics() Dict[str, Dict]

returns a dictionary of websocket topics and their required arguments

place_order(id: str, price: float, qty: int = 1, side: str = 'buy', phase: str = 'ipo', **kwargs) Union[jockmkt_sdk.objects.Order, Dict]

Places an order of the user’s chosen tradeable (player) and the chosen price. It defaults to buy 1 share during the ipo phase. The user may specify an amount of money they want to buy and automatically buy x shares at the chosen price (param: order_size), such that the total cost is less than their specified amount. If the user wants to make a live they must specify phase=’live’, or if they want to sell a share side=’sell’.

Parameters
  • id (str, required) – The chosen player’s tradeable id, obtained by calling a Tradeable object

  • price (int, required) – The user’s chosen price at which to place their order

  • side (str, optional) – default: ‘buy’ - the user must specify ‘sell’ if they wish to sell

  • phase (str, optional) – default: ‘ipo’ - If the Event.status is ‘ipo’, should be ipo, else specify ‘live’

  • qty (int, optional) – default: 1 - The desired number of shares the user wants to buy, the user may specify order_size instead.

  • order_size (int, optional) – The user can specify the total amount they wish to spend on shares of a player. Calculated by: (order_size)//price (it will always round down)

Returns

A json response with information about the order that was sent

ws_connect(loop: Union[asyncio.events.AbstractEventLoop, asyncio.base_events.BaseEventLoop], queue: List, error_handler: Callable, callback=None)

Initialize a websocket connection. See docs for example code.

Parameters
  • loop (asyncio.Event, required) – An asyncio loop, i.e. asyncio.get_event_loop

  • queue (iterable, required) – A list that websocket messages will be pushed to

  • error_handler (Callable, required) – a method for handling errors. The user can pass socket.reconnect here

ws_connect_new(loop: Union[asyncio.events.AbstractEventLoop, asyncio.base_events.BaseEventLoop], queue: List, error_handler: Callable, subscriptions: List[Dict], callback: Optional[Callable] = None)

Initialize a websocket connection. See docs for example code.

Parameters
  • loop (asyncio.Event, required) – An asyncio loop, i.e. asyncio.get_event_loop

  • queue (iterable, required) – A list that websocket messages will be pushed to

  • error_handler (Callable, required) – a method for handling errors. The user can pass socket.reconnect here

  • subscriptions – A list of subscriptions, each is a dictionary: {‘endpoint’: endpoint, ‘event_id’: event_id, ‘league’: league}

ws_token_generator()

jockmkt_sdk.exception module

exception jockmkt_sdk.exception.JockAPIException(response)

Bases: Exception

code – type – explanation 400 – bad_request – required parameter not included or typo in required parameter 401 – not_authorized – token is not valid; expired or keys not functioning 402 – request_failed – event status error, user has not joined event, insufficient funds 404 – not_found – incorrect api endpoint 429 – rate_limit – max 10 orders (post, delete) per minute, max 250 other requests per minute. This limit resets at the beginning of every new clock minute (e.g 12:00:00, 12:01:00) 50x – internal_error – request failed due to platform or network error. This SDK will automatically retry 3 times.

jockmkt_sdk.objects module

class jockmkt_sdk.objects.AccountActivity(aact)

Bases: object

object dedicated to all different kinds of account activity. There are numerous unique instance vars so the user should call self.available_attributes to see what instance vars are available

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

class jockmkt_sdk.objects.Entity(entity: dict)

Bases: object

parent class for all entity objects, containing all universal fields shared between entity types

the user can print any entity object via print(entity) – see docs for information regarding responses

Variables
  • entity_id – the entity’s ID, which can be used to search for a specific entity’s information

  • league – the league in which the entity plays

  • name – the entity’s full name

  • first_name – the entity’s first name

  • last_name – the entity’s last name

  • updated_at – when the entity was last updated

  • news – a dict containing news related to the entity

class jockmkt_sdk.objects.Entry(entry: dict)

Bases: object

object containing information about a user’s entry into an event, such as profit, leaderboard position

Variables
  • entry_id – the entry’s identifier

  • event_id – the event’s identifier

  • leaderboard_pos – the user’s leaderboard position

  • profit – the user’s profit in this entry, not including fees

  • updated_at – when this entry was last updated

  • favorites – a list of favorited tradeables

  • eventobjects.Event object containing event specific information

  • payouts – after the event is finished, a list of payouts made to the user for their holdings

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

class jockmkt_sdk.objects.Event(event: dict)

Bases: object

Class dedicated to storing event-related info. May contain list of Game objects, Tradeable objects and other information related to payouts and whether the event is a contest.

Variables
  • event_id – event_id for the chosen event, accessed via self.event_id. Used to access other event-specific info

  • name – the event’s name as displayed on the app

  • description – the event’s description

  • type – the type of event, either a contest or a cash market

  • status – the event’s status. One of: scheduled, cancelled, halted, ipo, ipo_closed, live, live_closed, payouts_completed, prizes_paid or contests_paid

  • league – the league to which this event’s scoring, games and players apply

  • ipo_start – timestamp at which the ipo opens

  • ipo_end – estimated time at which the ipo should end

  • est_close – estimated time the event will close

  • amt_completed – percentage of the event completed

  • updated_at – last timestamp at which the event was updated

  • payouts – a list of payouts for the event in the following format: ‘payouts’: [{‘position’: 1, ‘amount’: 25},…, {‘position’: n, ‘amount’: k}]

  • games – a list of objects.Game objects

  • tradeables – a list of :class`objects.Tradeable` objects

  • contest – information about the contest, if it’s a contest-type market see: objects.Event.type

  • share_count – the number of shares available for that market

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

class jockmkt_sdk.objects.Game(game: dict)

Bases: object

Games differ significantly, and you can expect significantly different information under “state” depending on the league. See docs for more info, or use self.print_game to get an idea of what the keys are.

use Game.available_attributes to see available attributes.

Variables
  • game_id – Jock MKT’s id for this game

  • game_name – game’s name (e.g. Lakers vs Warriors)

  • league – which league the game applies to

  • start – what time the game is supposed to start

  • venue – a dict containing venue location, such as whether it is to be played outdoors or venue name

  • status – is the game scheduled, in_progress or final

  • amount_completed – percentage of the game that has been completed

  • state – a dict containing information such as the clock, period/quarter/inning, length, etc.

  • weather – information about the weather, only applies to some sports & outdoor venues

  • home_info – information about the home team, such as score, runs, hits, etc.

  • away_info – information about the away team, such as score, runs, hits, etc.

available_attributes()
class jockmkt_sdk.objects.GameLog(game_log: dict)

Bases: object

different leagues will return different dictionaries of stats/projected. There is currently no league identifier.

use GameLog.available_attributes() to see what attributes can be called.

Variables
  • id – Jock MKT’s unique identifier for this game log

  • entity_id – entity_id for the player to which this game log applies

  • game_id – game_id to which this game log applies

  • team_id – team that this player is one

  • scheduled_start – time that the game was scheduled to start

  • updated_at – when this log was last updated

  • projected_stats – a dictionary of stat projections, which will be unique for each league

  • actual_stats – a dictionary of actual, scored stats, unique by league

  • league – league to which this game log applies

  • entityobjects.Entity information about the entity to which this log applies

  • gameobjects.Game information about the game to which this log applies

  • teamobjects.Team information about the team this player is on

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

class jockmkt_sdk.objects.MLBEntity(entity)

Bases: jockmkt_sdk.objects.Entity

MLB-specific entity data

Variables
  • team_id – the entity’s team_id for use collecting team info

  • team – a dict containing team-related information

  • preferred_name – player’s preferred name

  • position – player’s position

  • jersey_number – player’s jersey number

  • college – player’s alma mater

  • debut – player’s rookie year and date

  • status – whether the player is currently active

  • birthdate – player’s birthdate

  • injury_status – player’s current injury status (day-to-day, injured reserve, etc.)

  • injury_type – type of injury (concussion, knee, etc.)

class jockmkt_sdk.objects.NASCAREntity(entity)

Bases: jockmkt_sdk.objects.Entity

Nascar-specific entity data

Variables
  • team_id – the entity’s team_id for use collecting team info

  • team – a dict containing team-related information

  • points_eligible – is the driver eligible to score points

  • in_chase – is the driver in the chase

  • cars – a list of cars that the driver races

  • birthday – driver’s birthday

  • birthplace – where the driver was born

  • rookie_year – when did the driver first start racing

  • status – is the driver active or inactive

  • injury_status – is driver in, out or questionable (day-to-day, etc.)

  • injury_type – type of injury the driver is experiencing

class jockmkt_sdk.objects.NBAEntity(entity)

Bases: jockmkt_sdk.objects.Entity

NBA-specific entity data

Variables
  • team_id – the entity’s team_id for use collecting team info

  • team – a dict containing team-related information

  • preferred_name – player’s preferred name

  • position – player’s position

  • height – player’s height

  • weight – player’s weight

  • jersey_number – player’s jersey number

  • college – player’s college

  • birthdate – player’s birthdate

  • rookie_year – player’s rookie year

  • status – whether the player is currently active

  • injury_status – player’s current injury status (day-to-day, injured reserve, etc.)

  • injury_type – type of injury (concussion, knee, etc.)

class jockmkt_sdk.objects.NFLEntity(entity)

Bases: jockmkt_sdk.objects.Entity

NFL-specific entity data

Variables
  • team_id – the entity’s team_id for use collecting team info

  • team – a dict containing team-related information

  • preferred_name – player’s preferred name

  • position – player’s position

  • height – player’s height

  • weight – player’s weight

  • jersey_number – player’s jersey number

  • college – player’s college

  • birthdate – player’s birthdate

  • rookie_year – player’s rookie year

  • status – whether the player is currently active

  • injury_status – player’s current injury status (day-to-day, injured reserve, etc.)

  • injury_type – type of injury (concussion, knee, etc.)

class jockmkt_sdk.objects.NHLEntity(entity)

Bases: jockmkt_sdk.objects.Entity

NHL-specific entity data

Variables
  • team_id – the entity’s team_id for use collecting team info

  • team – a dict containing team-related information

  • preferred_name – player’s preferred name

  • position – player’s position

  • height – player’s height

  • weight – player’s weight

  • jersey_number – player’s jersey number

  • handedness – is the player right or left-handed

  • rookie_year – player’s rookie year

  • status – whether the player is currently active

  • injury_status – player’s current injury status (day-to-day, injured reserve, etc.)

  • injury_type – type of injury (concussion, knee, etc.)

class jockmkt_sdk.objects.Order(order: dict)

Bases: object

object dedicated to storing information about orders that the user has placed

Variables
  • account – The account associated with the order, only available from event_activity endpoint from ws feed.

  • order_id – the order’s specific identification

  • tradeable_id – the tradeable that the order was placed for

  • entity_id – the underlying entity_id for which the order was placed

  • event_id – the event in which the order was placed

  • status – current status, one of: created, accepted, filled, outbid, cancelled, or expired

  • side – side of the order (buy or sell)

  • phase – phase during which the order was placed (live or ipo)

  • quantity – amount of shares the user wants to buy

  • limit_price – the price the user specified in their order

  • cost_basis – how much the user spent on shares (only present on buy orders)

  • fee_paid – sum of fees paid for the order

  • proceeds – how much the user received for their sell order (if it was a sell order)

  • filled_quantity – quantity of shares that have been filled,

  • created_at – timestamp at which the order was created

  • accepted_at – timestamp at which the order was accepted

  • updated_at – timestamp at which the order last updated (some shares bought or sold)

  • filled_at – time at which the order was completely filled

  • cancellation_requested_at – when a cancellation was requested

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

class jockmkt_sdk.objects.PGAEntity(entity)

Bases: jockmkt_sdk.objects.Entity

PGA-specific entity data

Variables
  • preferred_name – player’s preferred name

  • birthday – player’s birthday

  • height – player’s height

  • weight – player’s weight

  • college – player’s attended college - not applicable to international players

  • rookie_year – player’s rookie year

  • country – player’s country of origin

  • injury_status – player’s current injury status (day-to-day, injured reserve, etc.)

  • injury_type – type of injury (concussion, knee, etc.)

class jockmkt_sdk.objects.Position(position: dict)

Bases: object

an object containing information about open positions or holdings. Note that instance variables do not include fees

Variables
  • tradeable_id – the player’s tradeable_id for the position

  • event_id – identifier for the event to which the position applies

  • sold_count – total quantity sold over the course of the event

  • bought_count – total quantity purchased over the course of the event

  • buy_interest – amount of shares the user is currently trying to buy

  • sell_interest – amount of shares the user is currently trying to sell

  • quantity_owned – number of shares the user owns

  • cost_basis – total amount spent on shares of the player that the user currently owns

  • proceeds – total amount of income for open position

  • cost_basis_all_time – total amount spent on shares of the player whether they are currently owned or not

  • proceeds_all_time – total realized profit and loss for selling shares of this tradeable

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

class jockmkt_sdk.objects.PublicOrder(order: dict)

Bases: object

Public order object for use with websockets

Variables
  • user_id – the user’s unique identifier

  • user_tags – the user’s tags (if they are a marketmaker, etc.)

  • username – the user’s display name

  • member_since – when the user joined

  • event_id – the event id to which this order applies

  • tradeable_id – the player who is being traded’s event-specific id

  • entity_id – the player’s global JM identifier

  • side – the side of the order (buy or sell)

  • phase – the phase in which the order was placed (ipo or live)

  • created_at – when the order was created

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

class jockmkt_sdk.objects.Team(team)

Bases: object

Team object containing team-related attributes, such as: team_id, location, name, league and abbreviation

user can call instance.available_attributes to see what instance variables are available.

Variables
  • team_id – the team’s Jock MKT identifier

  • location – home city for the team (e.g. Los Angeles, New York, etc.)

  • name – team’s name (e.g. Lakers, 49ers, etc.)

  • league – which league the team is a part of (e.g. nfl, nhl, etc.)

  • abbreviation – shortened team name (e.g. LAL, SF, BKN, etc.)

available_attributes()

user can call self.available_attributes to see what instance variables are available for that instance of the class

class jockmkt_sdk.objects.Trade(trade)

Bases: object

Public trade info including price and quantity. Available only with websockets.

Variables
  • trade_id – The id of the trade

  • price – The price at which the trade went through

  • quantity – The size of the trade

  • tradeable_id – The id of the player stock that was traded

  • created_at – Time at which the order went through

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

class jockmkt_sdk.objects.Tradeable(tradeable: dict)

Bases: object

object containing information about an event-specific tradeable object, including prices and projections

Variables
  • tradeable_id – this entity’s event-specific identifier, used to place orders

  • league – league this entity participates in

  • updated_at – when this tradeable was last updated

  • entity_id – the entity’s unique identifier, event-agnostic

  • event_id – event to which this tradeable_id applies

  • game_id – game to which this tradeable applies

  • next_game_id – only exists when there’s a double header in MLB - player’s next game

  • projected_games_remaining – how many games the player has left to play in this slate (exclusive to MLB double headers)

  • projected_games_total – total number of games the player will play in this slate (exclusive to MLB double headers)

  • fpts_proj_pregame – the tradeable’s pregame projected fantasy points

  • fpts_proj_live – tradeable’s live projected fantasy points

  • fpts_scored – tradeable’s fantasy points scored

  • ipo – price at which the tradeable IPOs. Will be None if the event status is not “live”, “live_closed”, or “payouts_completed

  • high – the highest price at which this tradeable was traded

  • low – lowest traded price

  • last – last traded price

  • estimated – Jock MKT’s estimated price

  • bid – highest active bid

  • ask – lowest active ask

  • final – final payout

  • stats – a list or dict of applicable statistics

  • name – the player’s name

  • entityobject.Entity object containing entity info

available_attributes()

The purpose of this method is to display the available instance variables so the user knows what they can access in each instance of the class

jockmkt_sdk.jm_sockets.sockets module

Module contents