ps3838api 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,176 @@
1
+ Metadata-Version: 2.4
2
+ Name: ps3838api
3
+ Version: 1.1.0
4
+ Summary: A lightweight Python library to interact with the Pinnacle API (PS3838, Pinnacle888 etc.) and place bets.
5
+ Author-email: Ilias Dzhabbarov <ilias.dzabbarov@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/iliyasone/ps3838api
8
+ Project-URL: Issues, https://github.com/iliyasone/ps3838api/issues
9
+ Keywords: ps3838,sports betting,api,pinnacle,odds,python
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.12
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: rapidfuzz>=3.14.3
17
+ Requires-Dist: requests>=2.32.5
18
+ Dynamic: license-file
19
+
20
+ # Modern PS3838 API
21
+
22
+ A lightweight Python library to interact with the PS3838 (Pinnacle) API and place bets.
23
+
24
+ ## ๐Ÿ”‘ Key Idea
25
+
26
+ This project aims to keep all method names and behavior as close as possible to the official [PS3838 API documentation](https://ps3838api.github.io/docs/). No abstraction layers that get in your way โ€” just a clean, Pythonic functional interface to the raw API.
27
+
28
+ If you need assistance, contact me directly on Telegram: [@iliyasone](https://t.me/iliyasone) ๐Ÿ’ฌ
29
+
30
+ If you have any questions or need additional tools, join Betting API PS3838 & Pinnacle Telegram Group Chat: [@ps3838api](https://t.me/ps3838api/77/78)
31
+
32
+ If you donโ€™t have access to the PS3838 API (Pinnacle) yet, feel free to reach out โ€” I can help you get started with obtaining access.
33
+
34
+ ## โœจ Features
35
+
36
+ ### `ps3838api.api` โ€” Minimalist, Typed API Wrapper
37
+
38
+ - **PinnacleClient-First:** Instantiate `ps3838api.api.client.PinnacleClient` with credentials supplied via environment variables and call methods directly. Legacy module-level helpers still work for backwards compatibility, but marked as deprecated.
39
+ - **Type-Safe:** Responses are structured using precise `TypedDict` definitions based directly on the official docs.
40
+ - **Clean Data:** Say goodbye to messy, undocumented JSON blobs.
41
+ - **Lightweight:** No bloated ORMs or clunky third-party wrappers โ€” just clean, readable code.
42
+
43
+ ### Bet Placement
44
+
45
+ - Place bets with simple functions that eliminate unnecessary overhead.
46
+
47
+ ## ๐Ÿš€ Setup
48
+
49
+ > You can also check out the [๐Ÿ““ examples.ipynb](https://github.com/iliyasone/ps3838api/blob/release/1.0.1/examples/examples.ipynb) for a quick start!
50
+
51
+ This project has been created and tested on the Python 3.13.7, however it should work also on Python>=3.12
52
+
53
+ ### 1. Create PinnacleClient
54
+
55
+ ```python
56
+ from ps3838api.api.client import PinnacleClient
57
+ from ps3838api.models.sports import Sport
58
+
59
+ client = PinnacleClient(
60
+ login='YOUR_LOGIN',
61
+ password='YOUR_PASSWORD',
62
+ api_base_url='https://api.ps3838.com', # default
63
+ default_sport=Sport.SOCCER_SPORT_ID # default
64
+ )
65
+ ```
66
+
67
+ `PinnacleClient` could also use `PS3838_LOGIN`, `PS3838_PASSWORD` environment variables.
68
+ It is also possible to change default `PS3838_API_BASE_URL` from https://api.ps3838.com/ to a different Pinnacle mirror
69
+
70
+ > Pinnacle888 is yet another one popular Pinnacle mirror, and its documentation and endpoints are identical to the PS3838
71
+ >
72
+ > Docs: https://pinny888.github.io/
73
+ >
74
+ > API Base URL: https://api.pinnacle888.com
75
+
76
+ ### 2. Check PinnacleClient Balance
77
+
78
+ Quickly check your account balance by calling the API:
79
+
80
+ ```python
81
+ from ps3838api.api.client import PinnacleClient
82
+
83
+ client = PinnacleClient()
84
+ balance = client.get_client_balance()
85
+ print("PinnacleClient Balance:", balance)
86
+ ```
87
+
88
+ Expected output:
89
+
90
+ ```json
91
+ {
92
+ "availableBalance": 200.0,
93
+ "outstandingTransactions": 0.0,
94
+ "givenCredit": 0.0,
95
+ "currency": "USD"
96
+ }
97
+ ```
98
+
99
+ ## ๐ŸŽฏ Retrieve Events and Fixtures Place Bet
100
+
101
+ Find and use events with ease:
102
+
103
+ ```python
104
+ fixtures = client.get_fixtures()
105
+ odds = client.get_odds()
106
+ ```
107
+
108
+ Using fixtures and odds, find events according to the method interfaces and [official Pinnacle API Response schemas](https://ps3838api.github.io/docs/#tag/Odds/operation/Odds_Straight_V3_Get)
109
+
110
+ ### V4 API Endpoints
111
+
112
+ For enhanced odds responses with alternative team total lines, use the V4 client:
113
+
114
+ ```python
115
+ # Get V4 odds with array-based team totals
116
+ v4_odds = client.v4.get_odds(sport_id=1)
117
+
118
+ # Get V4 parlay odds
119
+ v4_parlay_odds = client.v4.get_parlay_odds(sport_id=1)
120
+ ```
121
+
122
+ V4 endpoints provide the same parameters as V3 but return enhanced response structures where team totals are arrays, allowing multiple alternative lines per team.
123
+
124
+ > note: in a future version the package will include `magic_find_event` function which would make finding events more
125
+ straightforward
126
+
127
+ ## ๐Ÿ’ธ Place a Bet
128
+
129
+ Once you have your event and total line, place your bet:
130
+
131
+ ```python
132
+ event_id: int
133
+ line_id: int
134
+ alt_line_id: int | None
135
+ total_line_points: float
136
+
137
+ stake_usdt = 1.0
138
+
139
+ place_bet_response = client.place_straight_bet(
140
+ stake=stake_usdt,
141
+ event_id=event['eventId'],
142
+ bet_type='TOTAL_POINTS',
143
+ line_id=total_line.get('lineId', None),
144
+ alt_line_id=total_line.get('altLineId', None),
145
+ side='OVER',
146
+ handicap=total_line['points']
147
+ )
148
+ print("Unique Request ID:", place_bet_response['uniqueRequestId'])
149
+ ```
150
+
151
+ You can also check your bet status:
152
+
153
+ ```python
154
+ bets = client.get_bets(unique_request_ids=[place_bet_response['uniqueRequestId']])
155
+ # Verify the bet status
156
+ ```
157
+
158
+ ## ๐Ÿ› ๏ธ Local Installation
159
+
160
+ To install the library locally, install `uv` and run the following commands:
161
+
162
+ ```bash
163
+ git clone https://github.com/iliyasone/ps3838api.git
164
+ cd ps3838api
165
+ uv sync --all-groups
166
+ ```
167
+
168
+ ## Run checkers
169
+
170
+ ```bash
171
+ uv run ruff check
172
+ uv run ruff format
173
+ uv run pyright
174
+ ```
175
+
176
+ Happy coding
@@ -0,0 +1,26 @@
1
+ ps3838api/__init__.py,sha256=uKk_wbA5NMb_YDjUapMmQw4b0g09HquFlQHgMcS2dnI,192
2
+ ps3838api/matching.py,sha256=oRloXgk2DzMiiPYskTWFAEH34C2sAUsWbnyxTQNLJew,4794
3
+ ps3838api/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ ps3838api/tank.py,sha256=wQDAiw6F9ywUoDXdvzuRCxgqvp2NO0_JLR8uY9qJSuM,3546
5
+ ps3838api/totals.py,sha256=NmQjfQcaARJV1SGkGuGMjNJ5UX1t7OBezY7JMBT50uc,1690
6
+ ps3838api/api/__init__.py,sha256=pXLOXGLDoZ-zOBo0wA62AsRAq9yZ3PlkV-zFyXSTFis,1557
7
+ ps3838api/api/client.py,sha256=I4G7hFbZufum0GKj36_uAN61BKz1sWEOv5kDAJVUzxs,19323
8
+ ps3838api/api/default_client.py,sha256=MK9HGit4GXSpO09jpUxnzngoWw06cg80Jt6nsLBt39c,6811
9
+ ps3838api/api/v4client.py,sha256=FOIl2cJ6IIGJrYVAEqd8cWz_lnoIkcsrIrvRmCIQQ4A,3982
10
+ ps3838api/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ ps3838api/models/bets.py,sha256=CSxfl4pRjac_WbRoxdYiPGE9cwAFmbDANMIfHjmN6hw,6511
12
+ ps3838api/models/client.py,sha256=8v6H6pBjOA9_zCZAQXOaMzPL-lo4VtCst1GYCmsbcFo,1324
13
+ ps3838api/models/errors.py,sha256=EM2ZpuvmrXpI3scQdkC1FBohrwKRQsAqKGitsN-9g7o,877
14
+ ps3838api/models/event.py,sha256=9uj1jHaY-krf4bF-npqrjdEsCcXcw9W58YNUithQLU0,960
15
+ ps3838api/models/fixtures.py,sha256=GMvpRHaqN24jud3wAmVGRrLghWBlZfI2y38WUpxdSwY,1421
16
+ ps3838api/models/lines.py,sha256=7MYbhv1Qnrfna7SvpDJTF8p4GY12iQH_P2l6hzp_7Cg,588
17
+ ps3838api/models/odds.py,sha256=kpu2gEqQQk_DZmgf3aaR-uvgd1Ez7LuRpb9Fp7gLsgE,9376
18
+ ps3838api/models/sports.py,sha256=4-39JvsOyk34peXnnuiGV5a26rHNjgube8k0vHp5af0,8748
19
+ ps3838api/models/tank.py,sha256=hyrhWC2NHzkDhJioXEz2XENTSbCm0VihDRbcUF7LsA0,94
20
+ ps3838api/utils/match_leagues.py,sha256=tcJUc2TkMMhR8jtwLzvnDtSlp2V3cixnc85K4WpTtwE,3490
21
+ ps3838api/utils/ops.py,sha256=rfvU2BKQJM5jwI32tXcfLuyYaXGFYXOnZKqgNqAFPzk,5606
22
+ ps3838api-1.1.0.dist-info/licenses/LICENSE,sha256=h3bmeb_pl9XMAwVOrS4n7f0umjAj2Kwx2jcwYlCfBU0,1065
23
+ ps3838api-1.1.0.dist-info/METADATA,sha256=BHnA7pis2StCNG3yirrpQV59d-ClhACLB9SEOVBWZNE,5581
24
+ ps3838api-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ ps3838api-1.1.0.dist-info/top_level.txt,sha256=ec8CzKfcDq10-rMF_IM-9kxxxlnT4euiLfVrwQrmO0s,10
26
+ ps3838api-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,8 @@
1
+ Copyright 2025 Ilias Dzhabbarov
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the โ€œSoftwareโ€), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED โ€œAS ISโ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
+
@@ -0,0 +1 @@
1
+ ps3838api