A wrapper for Veikkaus (veikkaus.fi) betting API.
Project description
Veikkaaja
Veikkaaja is a straight-forward wrapper for the Veikkaus betting API. This package is not affiliated with Veikkaus in any way, use at your own peril. An official description of the API and the entrypoints can be found at Veikkaus reference implementation
The Veikkaus API is quite extensive, endpoints for getting the game information and enabling betting are supported for the following game modes:
| API Name | oikea nimi | implemented |
|---|---|---|
| MULTISCORE | Moniveto | - |
| SCORE | Tulosveto | - |
| SPORT | Vakio | - |
| WINNER | Voittajavedot | - |
| PICKTWO | Päivän pari | - |
| PICKTHREE | Päivän trio | - |
| PERFECTA | Superkaksari | - |
| TRIFECTA | Supertripla | - |
| EBET | Pitkäveto | 👍 |
| RAVI | Moniveikkaus | - |
Currently, only endpoints for EBET (Pitkäveto) are implemented in this wrapper. Contributions for the rest of the endpoints are welcome.
Installation
This package is available at PyPI. Install with pip:
pip install veikkaaja
Usage
For accessing the API endpoints, you need a valid Veikkaus-account. You can provide the account information as arguments to the VeikkausClient upon initialization or as environment variables. If not provided as arguments to the client, the account information is read from the following environment variables:
export VEIKKAUS_ACCOUNT=user.name
export VEIKKAUS_PASSWORD=my-password
Betting is quite straight-forward
from veikkaaja import VeikkausClient
client = VeikkausClient('user.name', 'my-password')
Getting you account balance
client.get_balance())
0.0
Get the available games:
# get upcoming EBET (Pitkäveto) draws
games = client.upcoming_events(GameTypes.EBET)
print(games[0])
Game type: '12 ' 25.10.2020 02:58 : Khabib - J.Gaethje id: 2170768 event_id: 98816225 status: OPEN, odds: ( 131.0 - 0 - 320.0)
Select a game and bet:
# place bet on the selected game
game = games[0]
success = client.place_bet(game,
BetDecision(BetTarget.HOME, 100), # The amount to bet is given in cents
test=True)
Veikkaus API also provides a testing endpoint, which can be used to validate your bets before actually submitting them. If you set the test=True argument in the betting function call, the testing endpoint is used instead.
Note: The testing endpoint is the default, set test=False to actually place bets.
Contributing
I am happy if someone is interested in adding contributions to other endpoints other than EBET. To run test and install used dev-tools one should clone this repository and install the optional dependencies
git clone https://github.com/miikama/veikkaaja
cd veikkaaja
pip install -e .[dev]
See description of our testing approach in testing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veikkaaja-0.1.0.tar.gz.
File metadata
- Download URL: veikkaaja-0.1.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9c86387d26a9b9972c613d2b0eef472efa5a4e26320902f22f96372597863ac
|
|
| MD5 |
e11ef58e58f3075e4e8ca8b642f6d1bd
|
|
| BLAKE2b-256 |
3285e73199a1b6e8680a19f87d83eef884ec1612de74d7599ac324a8f2d846b7
|
File details
Details for the file veikkaaja-0.1.0-py3-none-any.whl.
File metadata
- Download URL: veikkaaja-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
998eaf605014f7b86f19ccd0a875afb55103ae0cd499eaec81a10edf0b9b7b51
|
|
| MD5 |
b29aaa02fe92652ca230488752c73873
|
|
| BLAKE2b-256 |
867d7e4a8debb1cb7f8c1c2ed93f5232d764dca6be0a2a03eea1f235cbb1ba80
|