bitvavo-api-upgraded 1.17.2__py3-none-any.whl → 2.2.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,10 @@
1
+ bitvavo_api_upgraded/__init__.py,sha256=27f1dd18199939f6f578ec9d6b1b0f9977ce219e7c8556b5a807c4e9012b507b,301
2
+ bitvavo_api_upgraded/bitvavo.py,sha256=b2b8b1cc2c98c4f47eacdbf93cd1ee0d36291c8df68d152c1feb3712b06b49df,164775
3
+ bitvavo_api_upgraded/dataframe_utils.py,sha256=25ffb6ce462e2b966cf6488c14994298ef8eca48d9c8522f5b669a30960f529a,5792
4
+ bitvavo_api_upgraded/helper_funcs.py,sha256=e2805d435c41f82d979104e637eade7f323359f3be214a300d25a139215d0915,3212
5
+ bitvavo_api_upgraded/py.typed,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
6
+ bitvavo_api_upgraded/settings.py,sha256=6ebd68a8ddcaf0ea229a629ad4996fccc82960d1dfaf690ad9fd78b42ef6765f,5311
7
+ bitvavo_api_upgraded/type_aliases.py,sha256=10e7772e1aeec8cd5a6589f8c7229885da12aa5f26647f3c69c374a86ccc31c9,1992
8
+ bitvavo_api_upgraded-2.2.0.dist-info/WHEEL,sha256=76443c98c0efcfdd1191eac5fa1d8223dba1c474dbd47676674a255e7ca48770,79
9
+ bitvavo_api_upgraded-2.2.0.dist-info/METADATA,sha256=900cbf71d10dc4813bc0e1e9d169ba7a0059e1839e05db8821a98770f691cc8c,25478
10
+ bitvavo_api_upgraded-2.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.8.12
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -1,320 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: bitvavo-api-upgraded
3
- Version: 1.17.2
4
- Summary: A unit-tested fork of the Bitvavo API
5
- Project-URL: homepage, https://github.com/Thaumatorium/bitvavo-api-upgraded
6
- Project-URL: repository, https://github.com/Thaumatorium/bitvavo-api-upgraded
7
- Project-URL: changelog, https://github.com/Thaumatorium/bitvavo-api-upgraded/blob/master/CHANGELOG.md
8
- Author: Bitvavo BV (original code)
9
- Author-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
10
- Maintainer-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
11
- License: ISC License
12
- License-File: LICENSE.txt
13
- Classifier: Development Status :: 5 - Production/Stable
14
- Classifier: Environment :: Console
15
- Classifier: Framework :: Pytest
16
- Classifier: Framework :: tox
17
- Classifier: Intended Audience :: Developers
18
- Classifier: Intended Audience :: Financial and Insurance Industry
19
- Classifier: License :: OSI Approved :: ISC License (ISCL)
20
- Classifier: Operating System :: MacOS :: MacOS X
21
- Classifier: Operating System :: Microsoft :: Windows
22
- Classifier: Operating System :: POSIX
23
- Classifier: Programming Language :: Python
24
- Classifier: Programming Language :: Python :: 3.9
25
- Classifier: Programming Language :: Python :: 3.10
26
- Classifier: Programming Language :: Python :: 3.11
27
- Classifier: Programming Language :: Python :: 3.12
28
- Classifier: Programming Language :: Python :: 3.13
29
- Classifier: Typing :: Typed
30
- Requires-Python: >=3.9
31
- Requires-Dist: pydantic-settings==2.*,>=2.6
32
- Requires-Dist: requests==2.*,>=2.26
33
- Requires-Dist: structlog==25.*,>=21.5
34
- Requires-Dist: websocket-client==1.*,>=1.2
35
- Description-Content-Type: text/markdown
36
-
37
- # Bitvavo API (upgraded)
38
-
39
- ## Userguide
40
-
41
- `pip install bitvavo_api_upgraded`
42
-
43
- Works the same as the official API lib, but I have:
44
-
45
- - typing for _all_ functions and classes
46
- - unit tests (I already found three bugs that I fixed, because the original code
47
- wasn't tested, at all)
48
- - a changelog, so you can track of the changes that I make
49
- - compatible with Python 3.7 and newer ([3.6 isn't supported as of
50
- 2021-12-23](https://endoflife.date/python))
51
-
52
- ## Devguide
53
-
54
- ```shell
55
- echo "install development requirements"
56
- uv sync
57
- echo "run tox, a program that creates separate environments for different python versions, for testing purposes (among other things)"
58
- uv run tox
59
- ```
60
-
61
- ### Semantic Versioning (SemVer)
62
-
63
- I'm using semantic versioning, which means that changes mean this:
64
-
65
- 1. MAJOR version when you make incompatible API changes,
66
- 1. MINOR version when you add functionality in a backwards compatible manner,
67
- and
68
- 1. PATCH version when you make backwards compatible bug fixes.
69
-
70
- ### Versioning
71
-
72
- Copy the following block to CHANGELOG.md and add all information since last
73
- version bump
74
-
75
- ```markdown
76
- ## $UNRELEASED
77
-
78
- ### Added
79
-
80
- ...
81
-
82
- ### Changed
83
-
84
- ...
85
-
86
- ### Removed
87
-
88
- ...
89
- ```
90
-
91
- Commit those changes.
92
-
93
- After that, run `bump-my-version bump (major|minor|patch)` to automatically
94
- replace `$UNRELEASED` with the new version number, and also automatically tag
95
- and commit (with tag) to release a new version via the Github workflow.
96
-
97
- ## py.typed
98
-
99
- Perhaps a curious file, but it simply exists to let `mypy` know that the code is
100
- typed: [Don't forget `py.typed` for your typed Python package
101
- ](https://blog.whtsky.me/tech/2021/dont-forget-py.typed-for-your-typed-python-package/)
102
-
103
- ## Last note
104
-
105
- _below this line is the old README.md_
106
-
107
- ---
108
-
109
- # Bitvavo SDK for Python
110
-
111
- Crypto starts with Bitvavo. You use Bitvavo SDK for Python to buy, sell, and
112
- store over 200 digital assets on Bitvavo from inside your app.
113
-
114
- To trade and execute your advanced trading strategies, Bitvavo SDK for Python is
115
- a wrapper that enables you to easily call every endpoint in [Bitvavo
116
- API](https://docs.bitvavo.com/).
117
-
118
- - [Prerequisites](#prerequisites) - what you need to start developing with
119
- Bitvavo SDK for Python
120
- - [Get started](#get-started) - rapidly create an app and start trading with
121
- Bitvavo
122
- - [About the SDK](#about-the-sdk) - general information about Bitvavo SDK for
123
- Python
124
- - [API reference](https://docs.bitvavo.com/) - information on the specifics of
125
- every parameter
126
-
127
- This page shows you how to use Bitvavo SDK for Python with WebSockets. For REST,
128
- see the [REST readme](docs/rest.md).
129
-
130
- ## Prerequisites
131
-
132
- To start programming with Bitvavo SDK for Python you need:
133
-
134
- - [Python3](https://www.python.org/downloads/) installed on your development
135
- environment
136
-
137
- If you are working on macOS, ensure that you have installed SSH certificates:
138
-
139
- ```terminal
140
- open /Applications/Python\ 3.12/Install\ Certificates.command
141
- open /Applications/Python\ 3.12/Update\ Shell\ Profile.command
142
- ```
143
-
144
- - A Python app. Use your favorite IDE, or run from the command line
145
- - An [API key and
146
- secret](https://support.bitvavo.com/hc/en-us/articles/4405059841809)
147
- associated with your Bitvavo account
148
-
149
- You control the actions your app can do using the rights you assign to the API
150
- key. Possible rights are:
151
-
152
- - **View**: retrieve information about your balance, account, deposit and
153
- withdrawals
154
- - **Trade**: place, update, view and cancel orders
155
- - **Withdraw**: withdraw funds
156
-
157
- Best practice is to not grant this privilege, withdrawals using the API do
158
- not require 2FA and e-mail confirmation.
159
-
160
- ## Get started
161
-
162
- Want to quickly make a trading app? Here you go:
163
-
164
- 1. **Install Bitvavo SDK for Python**
165
-
166
- In your Python app, add [Bitvavo SDK for
167
- Python](https://github.com/bitvavo/python-bitvavo-api) from
168
- [pypi.org](https://pypi.org/project/python-bitvavo-api/):
169
-
170
- ```shell
171
- python -m pip install python_bitvavo_api
172
- ```
173
-
174
- If you installed from `test.pypi.com`, update the requests library: `pip
175
- install --upgrade requests`.
176
-
177
- 1. **Create a simple Bitvavo implementation**
178
-
179
- Add the following code to a new file in your app:
180
-
181
- ```python
182
- from python_bitvavo_api.bitvavo import Bitvavo
183
- import json
184
- import time
185
-
186
- # Use this class to connect to Bitvavo and make your first calls.
187
- # Add trading strategies to implement your business logic.
188
- class BitvavoImplementation:
189
- api_key = "<Replace with your your API key from Bitvavo Dashboard>"
190
- api_secret = "<Replace with your API secret from Bitvavo Dashboard>"
191
- bitvavo_engine = None
192
- bitvavo_socket = None
193
-
194
- # Connect securely to Bitvavo, create the WebSocket and error callbacks.
195
- def __init__(self):
196
- self.bitvavo_engine = Bitvavo({
197
- 'APIKEY': self.api_key,
198
- 'APISECRET': self.api_secret
199
- })
200
- self.bitvavo_socket = self.bitvavo_engine.newWebsocket()
201
- self.bitvavo_socket.setErrorCallback(self.error_callback)
202
-
203
- # Handle errors.
204
- def error_callback(self, error):
205
- print("Add your error message.")
206
- #print("Errors:", json.dumps(error, indent=2))
207
-
208
- # Retrieve the data you need from Bitvavo in order to implement your
209
- # trading logic. Use multiple workflows to return data to your
210
- # callbacks.
211
- def a_trading_strategy(self):
212
- self.bitvavo_socket.ticker24h({}, self.a_trading_strategy_callback)
213
-
214
- # In your app you analyse data returned by the trading strategy, then make
215
- # calls to Bitvavo to respond to market conditions.
216
- def a_trading_strategy_callback(self, response):
217
- # Iterate through the markets
218
- for market in response:
219
-
220
- match market["market"]:
221
- case "ZRX-EUR":
222
- print("Eureka, the latest bid for ZRX-EUR is: ", market["bid"] )
223
- # Implement calculations for your trading logic.
224
- # If they are positive, place an order: For example:
225
- # self.bitvavo_socket.placeOrder("ZRX-EUR",
226
- # 'buy',
227
- # 'limit',
228
- # { 'amount': '1', 'price': '00001' },
229
- # self.order_placed_callback)
230
- case "a different market":
231
- print("do something else")
232
- case _:
233
- print("Not this one: ", market["market"])
234
-
235
-
236
-
237
- def order_placed_callback(self, response):
238
- # The order return parameters explain the quote and the fees for this trade.
239
- print("Order placed:", json.dumps(response, indent=2))
240
- # Add your business logic.
241
-
242
-
243
- # Sockets are fast, but asynchronous. Keep the socket open while you are
244
- # trading.
245
- def wait_and_close(self):
246
- # Bitvavo uses a weight based rate limiting system. Your app is limited to 1000 weight points per IP or
247
- # API key per minute. The rate weighting for each endpoint is supplied in Bitvavo API documentation.
248
- # This call returns the amount of points left. If you make more requests than permitted by the weight limit,
249
- # your IP or API key is banned.
250
- limit = self.bitvavo_engine.getRemainingLimit()
251
- try:
252
- while (limit > 0):
253
- time.sleep(0.5)
254
- limit = self.bitvavo_engine.getRemainingLimit()
255
- except KeyboardInterrupt:
256
- self.bitvavo_socket.closeSocket()
257
-
258
-
259
- # Shall I re-explain main? Naaaaaaaaaa.
260
- if __name__ == '__main__':
261
- bvavo = BitvavoImplementation()
262
- bvavo.a_trading_strategy()
263
- bvavo.wait_and_close()
264
- ```
265
-
266
- 1. **Add security information**
267
-
268
- You must supply your security information to trade on Bitvavo and see your
269
- account information using the authenticate methods. Replace the values of
270
- `api_key` and `api_secret` with your credentials from [Bitvavo
271
- Dashboard](https://account.bitvavo.com/user/api).
272
-
273
- You can retrieve public information such as available markets, assets and
274
- current market without supplying your key and secret. However,
275
- unauthenticated calls have lower rate limits based on your IP address, and
276
- your account is blocked for longer if you exceed your limit.
277
-
278
- 1. **Run your app**
279
-
280
- - Command line warriors: `python3 <filename>`.
281
- - IDE heroes: press the big green button.
282
-
283
- Your app connects to Bitvavo and returns a list the latest trade price for each
284
- market. You use this data to implement your trading logic.
285
-
286
- ## About the SDK
287
-
288
- This section explains global concepts about Bitvavo SDK for Python.
289
-
290
- ### Rate limit
291
-
292
- Bitvavo uses a weight based rate limiting system. Your app is limited to 1000
293
- weight points per IP or API key per minute. When you make a call to Bitvavo API,
294
- your remaining weight points are returned in the header of each REST request.
295
-
296
- Websocket methods do not return your returning weight points, you track your
297
- remaining weight points with a call to:
298
-
299
- ```python
300
- limit = bitvavo.getRemainingLimit()
301
- ```
302
-
303
- If you make more requests than permitted by the weight limit, your IP or API key
304
- is banned.
305
-
306
- The rate weighting for each endpoint is supplied in the [Bitvavo API
307
- documentation](https://docs.bitvavo.com/).
308
-
309
- ### Requests
310
-
311
- For all methods, required parameters are passed as separate values, optional
312
- parameters are passed as a dictionary. Return parameters are in dictionary
313
- format: `response['<key>'] = '<value>'`. However, as a limit order requires more
314
- information than a market order, some optional parameters are required when you
315
- place an order.
316
-
317
- ### Security
318
-
319
- You must set your API key and secret for authenticated endpoints, public
320
- endpoints do not require authentication.
@@ -1,10 +0,0 @@
1
- bitvavo_api_upgraded/__init__.py,sha256=CSK4JninN6nxMUqoT-S_Vl9UJc4NOqwfbbZf-Qnvpo4,222
2
- bitvavo_api_upgraded/bitvavo.py,sha256=s7l-cAl0FteBrm5iF-gnM_U9_-Yds9lpn5pN6f0oaZU,125981
3
- bitvavo_api_upgraded/helper_funcs.py,sha256=4oBdQ1xB-C2XkQTmN-refzIzWfO-IUowDSWhOSFdCRU,3212
4
- bitvavo_api_upgraded/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- bitvavo_api_upgraded/settings.py,sha256=ZH2sR9iUyOC_lSaqmT50wERngUuobvu8d0TLiYN5nTg,2266
6
- bitvavo_api_upgraded/type_aliases.py,sha256=NAnMSk5n6SaEIvHFeSMKnXOxfOwnbFuEnRKaAXlcmYw,932
7
- bitvavo_api_upgraded-1.17.2.dist-info/METADATA,sha256=U_5w2WGTB4xykCwIgh3KtcfsVzsYDS3NZWlHwVRz1Tk,11547
8
- bitvavo_api_upgraded-1.17.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- bitvavo_api_upgraded-1.17.2.dist-info/licenses/LICENSE.txt,sha256=hiFyor_njVlzVblnb-78mzx1Um3CGvuFxEH3YR735rc,744
10
- bitvavo_api_upgraded-1.17.2.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
3
- Root-Is-Purelib: true
4
- Tag: py3-none-any
@@ -1,15 +0,0 @@
1
- ISC License
2
-
3
- Copyright (c) 2024, Bitvavo B.V.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.