Skip to content

Commit 5d676cf

Browse files
Merge pull request #40 from bitvavo/FAVO-7518_Release-Python-SDK-v123_Iain
Favo 7518 release python sdk v123 iain
2 parents 0ba4f0e + 3870120 commit 5d676cf

File tree

5 files changed

+52
-19
lines changed

5 files changed

+52
-19
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.DS_Store
2-
setup.py
32
dist
4-
python_bitvavo_api.egg-info
3+
python_bitvavo_api.egg-info
4+
.idea

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ISC License
22

3-
Copyright (c) 2018, Bitvavo
3+
Copyright (c) 2023, Bitvavo B.V.
44

55
Permission to use, copy, modify, and/or distribute this software for any
66
purpose with or without fee is hereby granted, provided that the above

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11

2-
<table>
3-
<tr>
4-
<td><a href="https://bitvavo.com"><img alt="Bitvavo" src="docs/assets/bitvavo-mark-square-blue.svg" width="100" title="Bitvavo Logo"></a></td>
5-
<td><h1>Bitvavo SDK for Python</h1></td>
6-
</tr>
7-
</table>
2+
# Bitvavo SDK for Python
83

94
Crypto starts with Bitvavo.
105
You use Bitvavo SDK for Python to buy, sell, and store over 200 digital assets on Bitvavo from inside your app.
@@ -51,6 +46,10 @@ Want to quickly make a trading app? Here you go:
5146
```terminal
5247
python -m pip install python_bitvavo_api
5348
```
49+
50+
If you installed from `test.pypi.com`, update the requests library: `pip install --upgrade requests`.
51+
52+
5453
1. **Create a simple Bitvavo implementation**
5554
5655
Add the following code to a new file in your app:
@@ -79,7 +78,8 @@ Want to quickly make a trading app? Here you go:
7978
8079
# Handle errors.
8180
def error_callback(self, error):
82-
print("Errors:", json.dumps(error, indent=2))
81+
print("Add your error message.")
82+
#print("Errors:", json.dumps(error, indent=2))
8383
8484
# Retrieve the data you need from Bitvavo in order to implement your
8585
# trading logic. Use multiple workflows to return data to your
@@ -90,22 +90,24 @@ Want to quickly make a trading app? Here you go:
9090
# In your app you analyse data returned by the trading strategy, then make
9191
# calls to Bitvavo to respond to market conditions.
9292
def a_trading_strategy_callback(self, response):
93-
print("All the latest trades:", json.dumps(response, indent=2))
94-
# Iterate through the
93+
# Iterate through the markets
9594
for market in response:
96-
print("Iterate through markets:", market["market"] )
95+
9796
match market["market"]:
98-
case "ABC-EUR":
99-
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"] )
10099
# Implement calculations for your trading logic.
101100
# If they are positive, place an order: For example:
102-
# self.bitvavo_socket.placeOrder("ABC-EUR",
101+
# self.bitvavo_socket.placeOrder("ZRX-EUR",
103102
# 'buy',
104103
# 'limit',
105104
# { 'amount': '1', 'price': '00001' },
106105
# self.order_placed_callback)
107106
case "a different market":
108107
print("do something else")
108+
case _:
109+
print("Not this one: ", market["market"])
110+
109111
110112
111113
def order_placed_callback(self, response):
@@ -128,8 +130,8 @@ Want to quickly make a trading app? Here you go:
128130
limit = self.bitvavo_engine.getRemainingLimit()
129131
except KeyboardInterrupt:
130132
self.bitvavo_socket.closeSocket()
131-
132-
133+
134+
133135
# Shall I re-explain main? Naaaaaaaaaa.
134136
if __name__ == '__main__':
135137
bvavo = BitvavoImplementation()
@@ -143,7 +145,8 @@ Want to quickly make a trading app? Here you go:
143145
Replace the values of `api_key` and `api_secret` with your credentials from [Bitvavo Dashboard](https://account.bitvavo.com/user/api).
144146
145147
You can retrieve public information such as available markets, assets and current market without supplying your key and secret.
146-
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.
147150
148151
1. **Run your app**
149152

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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from setuptools import setup, find_packages
2+
from os import path
3+
4+
# read the contents of your README file
5+
this_directory = path.abspath(path.dirname(__file__))
6+
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
7+
long_description = f.read()
8+
9+
setup(
10+
name="python_bitvavo_api",
11+
long_description=long_description,
12+
long_description_content_type='text/markdown',
13+
version="1.2.3",
14+
author="Bitvavo",
15+
description="Use Bitvavo SDK for Python to buy, sell, and store over 200 digital assets on Bitvavo from inside your app.",
16+
url="https://github.com/bitvavo/python-bitvavo-api",
17+
packages=find_packages(),
18+
install_requires=[
19+
'websocket-client',
20+
'requests==2.31.0',
21+
'setuptools'
22+
],
23+
classifiers=[
24+
"Programming Language :: Python :: 3",
25+
"License :: OSI Approved :: ISC License (ISCL)",
26+
"Operating System :: OS Independent",
27+
],
28+
python_requires=">=3.6",
29+
)

0 commit comments

Comments
 (0)