Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Commit bb123c5

Browse files
committed
updating README and setup.cfg
1 parent dc3ca3c commit bb123c5

File tree

3 files changed

+61
-14
lines changed

3 files changed

+61
-14
lines changed

README.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
# python-ctapi
1+
python-ctapi
2+
============
23

34
Python interface for [CoinTracking.info API](https://cointracking.info/api/api.php).
45

5-
I am not associated -- use at your own risk!
6+
I am not associated to cointracking.info -- use at your own risk!
67

7-
# Requirements:
8+
Requirements:
9+
=============
810

9-
* requests
10-
* futures
11+
- requests
12+
13+
Install
14+
=======
1115

12-
# Install
1316
```
1417
python setup.py install
1518
```
1619

17-
# How to Use
20+
How to Use
21+
==========
1822

1923
This is an example about how you can use the library
24+
2025
```
2126
#!/usr/bin/env python2
2227
@@ -35,25 +40,29 @@ if trades['success']:
3540
3641
else:
3742
print "got no orders"
38-
43+
3944
print api.getBalance()
4045
print api.getHistoricalSummary()
4146
print api.getHistoricalCurrency()
4247
print api.getGroupedBalance()
4348
print api.getGains()
4449
```
4550

46-
# Running Tests
51+
Running Tests
52+
=============
53+
4754
```
4855
venv/bin/python -m unittest -v ctapi.test.ctapi_tests
4956
```
50-
**be aware of the API requests limit of 20 req/h**
5157

52-
# Contribute
53-
Do you have an idea or found a bug in python-ctapi? Please file an issue and make a PR! :)
58+
**be aware of the API requests limit of 20 req/h**
5459

55-
## Support Me
56-
If you like the API and wanna support its developer, use the following referral link when registering at cointracking: https://cointracking.info?ref=T161519
60+
Contribute
61+
==========
5762

63+
Do you have an idea or found a bug in python-ctapi? Please file an issue and make a PR! :)
5864

65+
Support Me
66+
----------
5967

68+
If you like the API and wanna support its developer, use the following referral link when registering at cointracking: https://cointracking.info?ref=T161519

getMyBalances.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import json
2+
import yaml
3+
4+
from ctapi import CTAPI
5+
6+
if __name__ == "__main__":
7+
8+
with open("secrets.yml") as f:
9+
secrets = yaml.load(f)
10+
f.close()
11+
12+
# api = CTAPI(secrets['key'], secrets['secret'], debug=True)
13+
api = CTAPI(secrets['key'], secrets['secret'])
14+
balances = api.getBalance()
15+
16+
if balances['result']['success']:
17+
sum = 0
18+
print "+-------+------------+------------+------------+"
19+
print "| SYM | amount | price_fiat | value_fiat |"
20+
print "+-------+------------+------------+------------+"
21+
for b in balances['result']['details']:
22+
details = balances['result']['details'][b]
23+
if float(details['value_fiat']) > 0.01:
24+
sum = sum + float(details['value_fiat'])
25+
print "| %5s | %10.2f | %10.2f | %10.2f |" % (b, float(details['amount']),
26+
float(details['price_fiat']), float(details['value_fiat']) )
27+
28+
print "+-------+------------+------------+------------+"
29+
print ""
30+
print "Sum: %15.2f EUR" % (sum)
31+
print "=" * 24
32+
else:
33+
print "got no balances"

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[bdist_wheel]
2+
universal=1
3+
4+
[metadata]
5+
description-file = README.md

0 commit comments

Comments
 (0)