Name | betfair-parser JSON |
Version |
0.14.4
JSON |
| download |
home_page | None |
Summary | A betfair parser |
upload_time | 2025-02-17 13:59:35 |
maintainer | None |
docs_url | None |
author | Bradley McElroy |
requires_python | >=3.10 |
license | Copyright 2023, betfair_parser developers
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
keywords |
parser
betfair
api
json
streaming
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|

[](https://github.com/limx0/betfair_parser/actions)
[](https://pypi.org/project/betfair_parser/)


[](https://github.com/psf/black)
# betfair_parser
A simple and fast betfair parser. Why you might like this library:
- Complete: All betfair (non-vendor) client API included
- Conventions: The API strictly follows pythonic naming conventions
- Consistency: All data is type checked, API requests as well as responses
- Comfort: All betfair enums and type definitions are included, to support IDE syntax completion
- Clear errors: API errors don't just throw cryptic codes, but contain documentation about that error
- Compatible: Use it with any HTTP library you like, including async libraries
- Cheetah fast: Thanks to the magic of [msgspec](https://github.com/jcrist/msgspec), megabytes of input
parse in milliseconds
## Usage
`betfair_parser` is built out of API building blocks, that can be used with any HTTP client
you like. All API operations provide `.headers()`, `.body()` and a `.parse_response()` method.
The [`client`](https://github.com/limx0/betfair_parser/blob/main/betfair_parser/client.py) module
contains a sample, minimalistic client implementation. It may be used as is with any `requests`-compatible
HTTP client or serve as an example, how to integrate `betfair_parser` with other HTTP clients.
```python
import requests
from betfair_parser import client
from betfair_parser.spec import accounts, betting
session = requests.Session() # or anything similar like httpx.Client()
client.login(session, "username", "password", "app_key")
client.request(session, accounts.GetAccountFunds.with_params())
# AccountFundsResponse(available_to_bet_balance=10000.0, exposure=0.0,
# retained_commission=0.0, exposure_limit=-10000.0, discount_rate=0.0,
# points_balance=10, wallet=<Wallet.UK: 'UK'>)
# Request with an invalid wallet parameter:
client.request(session, accounts.GetAccountFunds.with_params(wallet="AUS"))
# >>> AccountAPINGException: INVALID_PARAMETERS: Problem parsing the parameters,
# or a mandatory parameter was not found
client.request(session, betting.ListCurrentOrders.with_params())
# CurrentOrderSummaryReport(current_orders=[], more_available=False)
# Support for other countries
from betfair_parser.endpoints import endpoint
endpoint_cfg = endpoint("ITA") # alpha-3 code
client.login(session, "username", "password", "app_key", endpoints=endpoint_cfg)
```
See [`test_live.py`](https://github.com/limx0/betfair_parser/blob/main/tests/integration/test_live.py)
for more API call examples.
## Releasing
Releases are published automatically when a tag is pushed to GitHub.
```bash
# Set next version number
export RELEASE=x.x.x
# Create tags
git commit --allow-empty -m "Release $RELEASE"
git tag -a $RELEASE -m "Version $RELEASE"
# Push
git push --tags
git push
```
Raw data
{
"_id": null,
"home_page": null,
"name": "betfair-parser",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "parser, betfair, api, json, streaming",
"author": "Bradley McElroy",
"author_email": "bradley.mcelroy@live.com",
"download_url": "https://files.pythonhosted.org/packages/76/d6/3f7e97eaddf97dd3c48fdc97701583dcbdb3962ac734e0e343cc961ca709/betfair_parser-0.14.4.tar.gz",
"platform": null,
"description": "\n\n[](https://github.com/limx0/betfair_parser/actions)\n[](https://pypi.org/project/betfair_parser/)\n\n\n[](https://github.com/psf/black)\n\n# betfair_parser\n\nA simple and fast betfair parser. Why you might like this library:\n\n- Complete: All betfair (non-vendor) client API included\n- Conventions: The API strictly follows pythonic naming conventions\n- Consistency: All data is type checked, API requests as well as responses\n- Comfort: All betfair enums and type definitions are included, to support IDE syntax completion\n- Clear errors: API errors don't just throw cryptic codes, but contain documentation about that error\n- Compatible: Use it with any HTTP library you like, including async libraries\n- Cheetah fast: Thanks to the magic of [msgspec](https://github.com/jcrist/msgspec), megabytes of input\nparse in milliseconds\n\n\n## Usage\n\n`betfair_parser` is built out of API building blocks, that can be used with any HTTP client\nyou like. All API operations provide `.headers()`, `.body()` and a `.parse_response()` method.\n\nThe [`client`](https://github.com/limx0/betfair_parser/blob/main/betfair_parser/client.py) module\ncontains a sample, minimalistic client implementation. It may be used as is with any `requests`-compatible\nHTTP client or serve as an example, how to integrate `betfair_parser` with other HTTP clients.\n\n```python\nimport requests\nfrom betfair_parser import client\nfrom betfair_parser.spec import accounts, betting\n\nsession = requests.Session() # or anything similar like httpx.Client()\nclient.login(session, \"username\", \"password\", \"app_key\")\nclient.request(session, accounts.GetAccountFunds.with_params())\n# AccountFundsResponse(available_to_bet_balance=10000.0, exposure=0.0,\n# retained_commission=0.0, exposure_limit=-10000.0, discount_rate=0.0,\n# points_balance=10, wallet=<Wallet.UK: 'UK'>)\n\n# Request with an invalid wallet parameter:\nclient.request(session, accounts.GetAccountFunds.with_params(wallet=\"AUS\"))\n# >>> AccountAPINGException: INVALID_PARAMETERS: Problem parsing the parameters,\n# or a mandatory parameter was not found\n\nclient.request(session, betting.ListCurrentOrders.with_params())\n# CurrentOrderSummaryReport(current_orders=[], more_available=False)\n\n# Support for other countries\nfrom betfair_parser.endpoints import endpoint\nendpoint_cfg = endpoint(\"ITA\") # alpha-3 code\nclient.login(session, \"username\", \"password\", \"app_key\", endpoints=endpoint_cfg)\n```\n\nSee [`test_live.py`](https://github.com/limx0/betfair_parser/blob/main/tests/integration/test_live.py)\nfor more API call examples.\n\n\n## Releasing\n\nReleases are published automatically when a tag is pushed to GitHub.\n\n```bash\n# Set next version number\nexport RELEASE=x.x.x\n\n# Create tags\ngit commit --allow-empty -m \"Release $RELEASE\"\ngit tag -a $RELEASE -m \"Version $RELEASE\"\n\n# Push\ngit push --tags\ngit push\n```\n\n",
"bugtrack_url": null,
"license": "Copyright 2023, betfair_parser developers\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
"summary": "A betfair parser",
"version": "0.14.4",
"project_urls": {
"Bug Tracker": "https://github.com/limx0/betfair_parser/issues",
"Documentation": "https://limx0.github.io/betfair_parser/",
"Homepage": "https://github.com/limx0/betfair_parser"
},
"split_keywords": [
"parser",
" betfair",
" api",
" json",
" streaming"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f4bbe054ad61d387786382f97a73a611d2519bf94ccd43e6c3d97b283969b052",
"md5": "7cbc3e8d2aa1443039736df394758ddf",
"sha256": "57422cb5d4d5a2ae87de229526bee8ddfdc8d719283e8513906fc6bb4c9b15aa"
},
"downloads": -1,
"filename": "betfair_parser-0.14.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7cbc3e8d2aa1443039736df394758ddf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 66340,
"upload_time": "2025-02-17T13:59:33",
"upload_time_iso_8601": "2025-02-17T13:59:33.364250Z",
"url": "https://files.pythonhosted.org/packages/f4/bb/e054ad61d387786382f97a73a611d2519bf94ccd43e6c3d97b283969b052/betfair_parser-0.14.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "76d63f7e97eaddf97dd3c48fdc97701583dcbdb3962ac734e0e343cc961ca709",
"md5": "fc8b63ab84f4fe1f334ddf8fa39ec61b",
"sha256": "a6abd8c89c3c5486d35c7d7966a8c35600c7fba11678b3b9a8bc07f3fb45ba09"
},
"downloads": -1,
"filename": "betfair_parser-0.14.4.tar.gz",
"has_sig": false,
"md5_digest": "fc8b63ab84f4fe1f334ddf8fa39ec61b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 54644,
"upload_time": "2025-02-17T13:59:35",
"upload_time_iso_8601": "2025-02-17T13:59:35.365828Z",
"url": "https://files.pythonhosted.org/packages/76/d6/3f7e97eaddf97dd3c48fdc97701583dcbdb3962ac734e0e343cc961ca709/betfair_parser-0.14.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-17 13:59:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "limx0",
"github_project": "betfair_parser",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "betfair-parser"
}