-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from carlzoo/docs/pydocs
Add Documentation
- Loading branch information
Showing
24 changed files
with
313 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Module sportsbooklib.calculators.exceptions | ||
=========================================== | ||
|
||
Classes | ||
------- | ||
|
||
`InvalidNumberOfInputsException(*args, **kwargs)` | ||
: Must input at least 2 odds | ||
|
||
### Ancestors (in MRO) | ||
|
||
* builtins.Exception | ||
* builtins.BaseException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Module sportsbooklib.calculators.hold_calc | ||
========================================== | ||
|
||
Functions | ||
--------- | ||
|
||
|
||
`get_hold(odds: List[sportsbooklib.models.odds.odds.Odds]) ‑> decimal.Decimal` | ||
: Calculate hold, given list of Odds, where length of list > 1 | ||
|
||
Parameters | ||
---------- | ||
odds : List[Odds] | ||
List of odds to calculate hold | ||
|
||
Returns | ||
------- | ||
Decimal | ||
The hold value as a Decimal | ||
|
||
|
||
`get_hold_for_selections(selections: List[sportsbooklib.models.selection.selection.Selection]) ‑> decimal.Decimal` | ||
: Calculate hold, given list of Selection's odds, where length of list > 1 | ||
|
||
Parameters | ||
---------- | ||
odds : List[Selection] | ||
List of Selection to calculate hold | ||
|
||
Returns | ||
------- | ||
Decimal | ||
The hold value as a Decimal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Module sportsbooklib.calculators.implied_odds_calc | ||
================================================== | ||
|
||
Functions | ||
--------- | ||
|
||
|
||
`get_implied_probability(odds: List[sportsbooklib.models.odds.odds.Odds]) ‑> Mapping[str, List[decimal.Decimal]]` | ||
: Given list of Odds, calculate the implied probability and fair odds. | ||
Based on https://github.com/octosport/octopy/blob/master/octopy/implied.py | ||
|
||
Parameters | ||
---------- | ||
odds : List[Odds] | ||
List of odds for calculation. | ||
|
||
Returns | ||
------- | ||
Dict: | ||
<implied_probability> List[Decimal]: List of implied probability in the respective order of the input odds | ||
<fair_odds> List[Decimal]: List of fair odds in the respective order of the input odds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Module sportsbooklib.calculators | ||
================================ | ||
The calculator submodule. | ||
|
||
Sub-modules | ||
----------- | ||
* sportsbooklib.calculators.exceptions | ||
* sportsbooklib.calculators.hold_calc | ||
* sportsbooklib.calculators.implied_odds_calc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Module sportsbooklib | ||
==================== | ||
Top-level package for sportsbooklib. | ||
|
||
Sub-modules | ||
----------- | ||
* sportsbooklib.calculators | ||
* sportsbooklib.models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Module sportsbooklib.models | ||
=========================== | ||
The models submodule. | ||
|
||
Sub-modules | ||
----------- | ||
* sportsbooklib.models.odds | ||
* sportsbooklib.models.selection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Module sportsbooklib.models.odds.enums | ||
====================================== | ||
|
||
Classes | ||
------- | ||
|
||
`OddsFormat(value, names=None, *, module=None, qualname=None, type=None, start=1)` | ||
: OddsFormat: | ||
|
||
- US - US Format (-110) | ||
- EU - European Format (1.909) | ||
- HK - Hong Kong Format (0.909) | ||
- UK - UK Fractional Format (10/11) | ||
|
||
### Ancestors (in MRO) | ||
|
||
* enum.Enum | ||
|
||
### Class variables | ||
|
||
`EU` | ||
: | ||
|
||
`HK` | ||
: | ||
|
||
`UK` | ||
: | ||
|
||
`US` | ||
: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Module sportsbooklib.models.odds.exceptions | ||
=========================================== | ||
|
||
Classes | ||
------- | ||
|
||
`InvalidOddsFormatException(*args, **kwargs)` | ||
: Odds value and/or format is invalid | ||
|
||
### Ancestors (in MRO) | ||
|
||
* builtins.Exception | ||
* builtins.BaseException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Module sportsbooklib.models.odds | ||
================================ | ||
The submodule with the Odds class. | ||
|
||
Sub-modules | ||
----------- | ||
* sportsbooklib.models.odds.enums | ||
* sportsbooklib.models.odds.exceptions | ||
* sportsbooklib.models.odds.odds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Module sportsbooklib.models.odds.odds | ||
===================================== | ||
|
||
Classes | ||
------- | ||
|
||
`Odds(value: Union[int, fractions.Fraction, decimal.Decimal], format: sportsbooklib.models.odds.enums.OddsFormat)` | ||
: The Odds Object. | ||
|
||
Attributes | ||
---------- | ||
value : Union[int, Fraction, Decimal] | ||
The odds value as an integer, Decimal or Fraction | ||
format : OddsFormat | ||
The format of the odds as OddsFormat (US, EU, HK, UK) | ||
|
||
### Methods | ||
|
||
`convert_to_eu_odds(self)` | ||
: | ||
|
||
`convert_to_hk_odds(self)` | ||
: | ||
|
||
`convert_to_uk_odds(self)` | ||
: | ||
|
||
`convert_to_us_odds(self)` | ||
: | ||
|
||
`parse_odds_value(self)` | ||
: | ||
|
||
`set_eu_odds(self)` | ||
: | ||
|
||
`set_hk_odds(self)` | ||
: | ||
|
||
`set_uk_odds(self)` | ||
: | ||
|
||
`set_us_odds(self)` | ||
: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Module sportsbooklib.models.selection | ||
===================================== | ||
The selection submodule. | ||
|
||
Sub-modules | ||
----------- | ||
* sportsbooklib.models.selection.selection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Module sportsbooklib.models.selection.selection | ||
=============================================== | ||
|
||
Classes | ||
------- | ||
|
||
`Selection(name: str, odds: sportsbooklib.models.odds.odds.Odds)` | ||
: The Selection Object. | ||
|
||
Attributes | ||
---------- | ||
name : str | ||
Name of the selection. | ||
odds : Odds | ||
The Odds object associated with the selection. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
The calculators submodule. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
The models submodule. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
__all__ = ["echo", "surround", "reverse"] | ||
""" | ||
The submodule with the Odds class. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
The selection submodule. | ||
""" |
Oops, something went wrong.