Skip to content

Commit 7e6b39c

Browse files
👷 build the package and test.
1 parent e2302b7 commit 7e6b39c

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

README.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,16 @@ Want to quickly make a trading app? Here you go:
4646
```terminal
4747
python -m pip install python_bitvavo_api
4848
```
49+
50+
If you installed from `test.pypi.com`, update the requests library: `pip install --upgrade requests`.
51+
52+
4953
1. **Create a simple Bitvavo implementation**
5054
5155
Add the following code to a new file in your app:
5256
5357
```python
54-
from python_bitvavo_api.bitvavo import Bitvavo
58+
from python_bitvavo_api.bitvavo import Bitvavo
5559
import json
5660
import time
5761
@@ -74,7 +78,8 @@ Want to quickly make a trading app? Here you go:
7478
7579
# Handle errors.
7680
def error_callback(self, error):
77-
print("Errors:", json.dumps(error, indent=2))
81+
print("Add your error message.")
82+
#print("Errors:", json.dumps(error, indent=2))
7883
7984
# Retrieve the data you need from Bitvavo in order to implement your
8085
# trading logic. Use multiple workflows to return data to your
@@ -85,22 +90,24 @@ Want to quickly make a trading app? Here you go:
8590
# In your app you analyse data returned by the trading strategy, then make
8691
# calls to Bitvavo to respond to market conditions.
8792
def a_trading_strategy_callback(self, response):
88-
print("All the latest trades:", json.dumps(response, indent=2))
89-
# Iterate through the
93+
# Iterate through the markets
9094
for market in response:
91-
print("Iterate through markets:", market["market"] )
95+
9296
match market["market"]:
93-
case "ABC-EUR":
94-
print("Check data against your trading strategy. For example, the bid is: ", market["bid"] )
97+
case "ZRX-EUR":
98+
print("Eureka, the latest bid for ZRX-EUR is: ", market["bid"] )
9599
# Implement calculations for your trading logic.
96100
# If they are positive, place an order: For example:
97-
# self.bitvavo_socket.placeOrder("ABC-EUR",
101+
# self.bitvavo_socket.placeOrder("ZRX-EUR",
98102
# 'buy',
99103
# 'limit',
100104
# { 'amount': '1', 'price': '00001' },
101105
# self.order_placed_callback)
102106
case "a different market":
103107
print("do something else")
108+
case _:
109+
print("Not this one: ", market["market"])
110+
104111
105112
106113
def order_placed_callback(self, response):
@@ -123,8 +130,8 @@ Want to quickly make a trading app? Here you go:
123130
limit = self.bitvavo_engine.getRemainingLimit()
124131
except KeyboardInterrupt:
125132
self.bitvavo_socket.closeSocket()
126-
127-
133+
134+
128135
# Shall I re-explain main? Naaaaaaaaaa.
129136
if __name__ == '__main__':
130137
bvavo = BitvavoImplementation()
@@ -138,7 +145,8 @@ Want to quickly make a trading app? Here you go:
138145
Replace the values of `api_key` and `api_secret` with your credentials from [Bitvavo Dashboard](https://account.bitvavo.com/user/api).
139146
140147
You can retrieve public information such as available markets, assets and current market without supplying your key and secret.
141-
However, Bitvavo returns an error.
148+
However, unauthenticated calls have lower rate limits based on your IP address, and your account is blocked for longer if
149+
you exceed your limit.
142150
143151
1. **Run your app**
144152

python_bitvavo_api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name = "pythonBitvavoApi"

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
name="python_bitvavo_api",
1111
long_description=long_description,
1212
long_description_content_type='text/markdown',
13-
version="0.0.4",
13+
version="1.2.3",
1414
author="Bitvavo",
1515
description="Use Bitvavo SDK for Python to buy, sell, and store over 200 digital assets on Bitvavo from inside your app.",
1616
url="https://github.com/bitvavo/python-bitvavo-api",
1717
packages=find_packages(),
1818
install_requires=[
19-
'websocket-client==0.57.0',
20-
'requests'
19+
'websocket-client',
20+
'requests==2.31.0',
21+
'setuptools'
2122
],
2223
classifiers=[
2324
"Programming Language :: Python :: 3",

0 commit comments

Comments
 (0)