bitvavo-api-upgraded 1.17.2__tar.gz → 2.0.0__tar.gz

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.
Files changed (29) hide show
  1. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/PKG-INFO +276 -51
  2. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/README.md +265 -40
  3. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/pyproject.toml +15 -16
  4. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/src/bitvavo_api_upgraded/bitvavo.py +240 -11
  5. bitvavo_api_upgraded-1.17.2/.github/README.md +0 -3
  6. bitvavo_api_upgraded-1.17.2/.github/copilot-instructions.md +0 -109
  7. bitvavo_api_upgraded-1.17.2/.github/workflows/release.yml +0 -30
  8. bitvavo_api_upgraded-1.17.2/.gitignore +0 -28
  9. bitvavo_api_upgraded-1.17.2/.pre-commit-config.yaml +0 -32
  10. bitvavo_api_upgraded-1.17.2/.python-version +0 -5
  11. bitvavo_api_upgraded-1.17.2/.vscode/settings.json +0 -22
  12. bitvavo_api_upgraded-1.17.2/CHANGELOG.md +0 -504
  13. bitvavo_api_upgraded-1.17.2/LICENSE.txt +0 -15
  14. bitvavo_api_upgraded-1.17.2/README.pypi.md +0 -60
  15. bitvavo_api_upgraded-1.17.2/docs/assets/bitvavo-mark-square-blue.svg +0 -5
  16. bitvavo_api_upgraded-1.17.2/docs/rest.md +0 -72
  17. bitvavo_api_upgraded-1.17.2/scripts/bootstrap.sh +0 -17
  18. bitvavo_api_upgraded-1.17.2/tests/__init__.py +0 -0
  19. bitvavo_api_upgraded-1.17.2/tests/conftest.py +0 -65
  20. bitvavo_api_upgraded-1.17.2/tests/test_bitvavo.py +0 -1677
  21. bitvavo_api_upgraded-1.17.2/tests/test_helper_funcs.py +0 -27
  22. bitvavo_api_upgraded-1.17.2/tests/test_settings.py +0 -36
  23. bitvavo_api_upgraded-1.17.2/tox.ini +0 -24
  24. bitvavo_api_upgraded-1.17.2/uv.lock +0 -1444
  25. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/src/bitvavo_api_upgraded/__init__.py +0 -0
  26. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/src/bitvavo_api_upgraded/helper_funcs.py +0 -0
  27. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/src/bitvavo_api_upgraded/py.typed +0 -0
  28. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/src/bitvavo_api_upgraded/settings.py +0 -0
  29. {bitvavo_api_upgraded-1.17.2 → bitvavo_api_upgraded-2.0.0}/src/bitvavo_api_upgraded/type_aliases.py +0 -0
@@ -1,15 +1,10 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: bitvavo-api-upgraded
3
- Version: 1.17.2
3
+ Version: 2.0.0
4
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)
5
+ Author: Bitvavo BV (original code), NostraDavid
9
6
  Author-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
10
- Maintainer-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
11
7
  License: ISC License
12
- License-File: LICENSE.txt
13
8
  Classifier: Development Status :: 5 - Production/Stable
14
9
  Classifier: Environment :: Console
15
10
  Classifier: Framework :: Pytest
@@ -20,93 +15,323 @@ Classifier: License :: OSI Approved :: ISC License (ISCL)
20
15
  Classifier: Operating System :: MacOS :: MacOS X
21
16
  Classifier: Operating System :: Microsoft :: Windows
22
17
  Classifier: Operating System :: POSIX
23
- Classifier: Programming Language :: Python
24
18
  Classifier: Programming Language :: Python :: 3.9
25
19
  Classifier: Programming Language :: Python :: 3.10
26
20
  Classifier: Programming Language :: Python :: 3.11
27
21
  Classifier: Programming Language :: Python :: 3.12
28
22
  Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python
29
24
  Classifier: Typing :: Typed
30
- Requires-Python: >=3.9
31
25
  Requires-Dist: pydantic-settings==2.*,>=2.6
32
26
  Requires-Dist: requests==2.*,>=2.26
33
- Requires-Dist: structlog==25.*,>=21.5
27
+ Requires-Dist: structlog>=21.5,==25.*
34
28
  Requires-Dist: websocket-client==1.*,>=1.2
29
+ Maintainer: NostraDavid
30
+ Maintainer-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
31
+ Requires-Python: >=3.9
32
+ Project-URL: changelog, https://github.com/Thaumatorium/bitvavo-api-upgraded/blob/master/CHANGELOG.md
33
+ Project-URL: homepage, https://github.com/Thaumatorium/bitvavo-api-upgraded
34
+ Project-URL: repository, https://github.com/Thaumatorium/bitvavo-api-upgraded
35
35
  Description-Content-Type: text/markdown
36
36
 
37
37
  # Bitvavo API (upgraded)
38
38
 
39
- ## Userguide
39
+ A **typed, tested, and enhanced** Python wrapper for the Bitvavo cryptocurrency exchange API. This is an "upgraded" fork of the official Bitvavo SDK with comprehensive type hints, unit tests, and improved developer experience.
40
+
41
+ ## Quick Start
42
+
43
+ ```bash
44
+ pip install bitvavo_api_upgraded
45
+ ```
46
+
47
+ Scroll down for detailed usage examples and configuration instructions.
48
+
49
+ ## What Makes This "Upgraded"?
50
+
51
+ This wrapper improves upon the official Bitvavo SDK with:
52
+
53
+ - 🎯 **Complete type annotations** for all functions and classes
54
+ - 🧪 **Comprehensive test suite** (found and fixed multiple bugs in the original)
55
+ - 📋 **Detailed changelog** tracking all changes and improvements
56
+ - 🔄 **Up-to-date API compliance** including MiCA regulatory requirements
57
+ - 📚 **Enhanced documentation** with examples and clear usage patterns
58
+ - 🐍 **Modern Python support** (3.9+, dropped EOL versions)
59
+ - ⚡ **Better error handling** and rate limiting
60
+ - 🔧 **Developer-friendly tooling** (ruff, mypy, pre-commit hooks)
61
+
62
+ ## Features
40
63
 
41
- `pip install bitvavo_api_upgraded`
64
+ ### Full API Coverage
42
65
 
43
- Works the same as the official API lib, but I have:
66
+ - All REST endpoints (public and private)
67
+ - ✅ WebSocket support with reconnection logic
68
+ - ✅ Rate limiting with automatic throttling
69
+ - ✅ MiCA compliance reporting endpoints
44
70
 
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))
71
+ ### Developer Experience
51
72
 
52
- ## Devguide
73
+ - ✅ Type hints for better IDE support
74
+ - ✅ Comprehensive error handling
75
+ - ✅ Detailed logging with `structlog`
76
+ - ✅ Configuration via `.env` files
77
+ - ✅ Extensive test coverage
78
+
79
+ ### Production Ready
80
+
81
+ - ✅ Automatic rate limit management
82
+ - ✅ Connection retry logic
83
+ - ✅ Proper error responses
84
+ - ✅ Memory efficient WebSocket handling
85
+
86
+ ## Configuration
87
+
88
+ Create a `.env` file in your project root:
89
+
90
+ ```env
91
+ BITVAVO_APIKEY=your-api-key-here
92
+ BITVAVO_APISECRET=your-api-secret-here
93
+ ```
94
+
95
+ Then use the settings:
96
+
97
+ ```python
98
+ from bitvavo_api_upgraded import Bitvavo, BitvavoSettings
99
+
100
+ # Option 1: Manual configuration
101
+ bitvavo = Bitvavo({
102
+ 'APIKEY': 'your-key',
103
+ 'APISECRET': 'your-secret'
104
+ })
105
+
106
+ # Option 2: Auto-load from .env
107
+ settings = BitvavoSettings()
108
+ bitvavo = Bitvavo(settings.model_dump())
109
+ ```
110
+
111
+ ## WebSocket Usage
112
+
113
+ ```python
114
+ from bitvavo_api_upgraded import Bitvavo
115
+
116
+ def handle_ticker(data):
117
+ print(f"Ticker update: {data}")
118
+
119
+ def handle_error(error):
120
+ print(f"Error: {error}")
121
+
122
+ # Initialize WebSocket
123
+ bitvavo = Bitvavo({'APIKEY': 'key', 'APISECRET': 'secret'})
124
+ ws = bitvavo.newWebsocket()
125
+ ws.setErrorCallback(handle_error)
126
+
127
+ # Subscribe to ticker updates
128
+ ws.subscriptionTicker("BTC-EUR", handle_ticker)
129
+
130
+ # Keep connection alive
131
+ try:
132
+ while True:
133
+ time.sleep(1)
134
+ except KeyboardInterrupt:
135
+ ws.closeSocket()
136
+ ```
137
+
138
+ ## API Examples
139
+
140
+ ### Public Endpoints (No Authentication)
141
+
142
+ ```python
143
+ # Get server time
144
+ time_resp = bitvavo.time()
145
+
146
+ # Get all markets
147
+ markets = bitvavo.markets({})
148
+
149
+ # Get specific market
150
+ btc_market = bitvavo.markets({'market': 'BTC-EUR'})
151
+
152
+ # Get order book
153
+ book = bitvavo.book('BTC-EUR', {})
154
+
155
+ # Get recent trades
156
+ trades = bitvavo.publicTrades('BTC-EUR', {})
157
+
158
+ # Get 24h ticker
159
+ ticker = bitvavo.ticker24h({'market': 'BTC-EUR'})
160
+ ```
161
+
162
+ ### Private Endpoints (Authentication Required)
163
+
164
+ ```python
165
+ # Get account info
166
+ account = bitvavo.account()
167
+
168
+ # Get balance
169
+ balance = bitvavo.balance({})
170
+
171
+ # Place order (requires operatorId for MiCA compliance)
172
+ order = bitvavo.placeOrder(
173
+ market="BTC-EUR",
174
+ side="buy",
175
+ orderType="limit",
176
+ body={"amount": "0.01", "price": "45000"},
177
+ operatorId=12345
178
+ )
179
+
180
+ # Get order history
181
+ orders = bitvavo.getOrders('BTC-EUR', {})
182
+
183
+ # Cancel order
184
+ cancel_result = bitvavo.cancelOrder(
185
+ market="BTC-EUR",
186
+ orderId="order-id-here",
187
+ operatorId=12345
188
+ )
189
+ ```
190
+
191
+ ### MiCA Compliance Features
192
+
193
+ ```python
194
+ # Generate trade report
195
+ trade_report = bitvavo.reportTrades(
196
+ market="BTC-EUR",
197
+ options={
198
+ "startDate": "2025-01-01T00:00:00.000Z",
199
+ "endDate": "2025-01-31T23:59:59.999Z"
200
+ }
201
+ )
202
+
203
+ # Generate order book report
204
+ book_report = bitvavo.reportBook(
205
+ market="BTC-EUR",
206
+ options={
207
+ "startDate": "2025-01-01T00:00:00.000Z",
208
+ "endDate": "2025-01-31T23:59:59.999Z"
209
+ }
210
+ )
211
+
212
+ # Get account history
213
+ history = bitvavo.accountHistory(options={})
214
+ ```
215
+
216
+ ## Error Handling
217
+
218
+ ```python
219
+ from bitvavo_api_upgraded import Bitvavo
220
+
221
+ bitvavo = Bitvavo({'APIKEY': 'key', 'APISECRET': 'secret'})
222
+
223
+ response = bitvavo.placeOrder(
224
+ market="BTC-EUR",
225
+ side="buy",
226
+ orderType="limit",
227
+ body={"amount": "0.01", "price": "45000"},
228
+ operatorId=12345
229
+ )
230
+
231
+ # Check for errors
232
+ if isinstance(response, dict) and 'errorCode' in response:
233
+ print(f"Error {response['errorCode']}: {response['error']}")
234
+ else:
235
+ print(f"Order placed successfully: {response['orderId']}")
236
+ ```
237
+
238
+ ## Rate Limiting
239
+
240
+ ```python
241
+ # Check remaining rate limit
242
+ remaining = bitvavo.getRemainingLimit()
243
+ print(f"Remaining API calls: {remaining}")
244
+
245
+ # The library automatically handles rate limiting
246
+ # But you can check limits before making calls
247
+ if remaining > 10:
248
+ # Safe to make API calls
249
+ response = bitvavo.balance({})
250
+ ```
251
+
252
+ ## Development & Contributing
53
253
 
54
254
  ```shell
55
255
  echo "install development requirements"
56
256
  uv sync
57
257
  echo "run tox, a program that creates separate environments for different python versions, for testing purposes (among other things)"
58
258
  uv run tox
59
- ```
60
-
61
- ### Semantic Versioning (SemVer)
259
+ ## Development & Contributing
62
260
 
63
- I'm using semantic versioning, which means that changes mean this:
261
+ ### Setup Development Environment
64
262
 
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.
263
+ ```shell
264
+ # Install uv (modern Python package manager)
265
+ curl -LsSf https://astral.sh/uv/install.sh | sh
69
266
 
70
- ### Versioning
267
+ # Clone and setup
268
+ git clone https://github.com/Thaumatorium/bitvavo-api-upgraded.git
269
+ cd bitvavo-api-upgraded
71
270
 
72
- Copy the following block to CHANGELOG.md and add all information since last
73
- version bump
271
+ # Install dependencies
272
+ uv sync
74
273
 
75
- ```markdown
76
- ## $UNRELEASED
274
+ # Run tests across Python versions
275
+ uv run tox
77
276
 
78
- ### Added
277
+ # Run tests for current Python version
278
+ uv run pytest
79
279
 
80
- ...
280
+ # Type checking
281
+ uv run mypy src/
81
282
 
82
- ### Changed
283
+ # Linting and formatting
284
+ uv run ruff check
285
+ uv run ruff format
286
+ ```
83
287
 
84
- ...
288
+ ### Project Structure
85
289
 
86
- ### Removed
290
+ ```text
291
+ src/bitvavo_api_upgraded/ # Source code
292
+ ├── __init__.py # Main exports
293
+ ├── bitvavo.py # Core API class
294
+ ├── settings.py # Pydantic settings
295
+ ├── helper_funcs.py # Utility functions
296
+ └── type_aliases.py # Type definitions
87
297
 
88
- ...
298
+ tests/ # Comprehensive test suite
299
+ docs/ # Documentation
89
300
  ```
90
301
 
91
- Commit those changes.
302
+ ### Semantic Versioning
303
+
304
+ This project follows [semantic versioning](https://semver.org/):
92
305
 
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.
306
+ 1. **MAJOR** version for incompatible API changes
307
+ 2. **MINOR** version for backwards-compatible functionality additions
308
+ 3. **PATCH** version for backwards-compatible bug fixes
96
309
 
97
- ## py.typed
310
+ ## Type Annotations
98
311
 
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/)
312
+ This package includes a `py.typed` file to enable type checking. Reference: [Don't forget py.typed for your typed Python package](https://blog.whtsky.me/tech/2021/dont-forget-py.typed-for-your-typed-python-package/)
102
313
 
103
- ## Last note
314
+ ## Migration from Official SDK
104
315
 
105
- _below this line is the old README.md_
316
+ ### Key Differences
317
+
318
+ - Import: `from bitvavo_api_upgraded import Bitvavo` (instead of `from python_bitvavo_api.bitvavo import Bitvavo`)
319
+ - **Breaking Change**: Trading operations require `operatorId` parameter
320
+ - Enhanced error handling and type safety
321
+ - Better configuration management with `.env` support
322
+
323
+ ### Migration Steps
324
+
325
+ 1. Update import statements
326
+ 2. Add `operatorId` to trading method calls
327
+ 3. Optional: Migrate to `.env` configuration
328
+ 4. Enjoy improved type hints and error handling!
106
329
 
107
330
  ---
108
331
 
109
- # Bitvavo SDK for Python
332
+ ## Original Bitvavo SDK Documentation
333
+
334
+ The following is preserved from the original Bitvavo SDK for reference.
110
335
 
111
336
  Crypto starts with Bitvavo. You use Bitvavo SDK for Python to buy, sell, and
112
337
  store over 200 digital assets on Bitvavo from inside your app.