Skip to content

Commit

Permalink
57 remove the unnecessary client when importing clients (#59)
Browse files Browse the repository at this point in the history
* moved client contents into __init__.py files to avoid importing via the client module
* removed unused file
  • Loading branch information
btschwertfeger authored Apr 2, 2023
1 parent 3fefc5b commit 417a864
Show file tree
Hide file tree
Showing 48 changed files with 3,357 additions and 3,276 deletions.
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@ install:
##
test:

## Upload to testpypi
##
test_upload:
twine upload -r testpypi dist/*

## Upload to PyPI
##
live_upload:
twine upload dist/*
doc:
cd docs && make html

## Clean the workspace
##
clean:
rm -rf .pytest_cache build/ dist/ python_kraken_sdk.egg-info
rm -f .coverage kraken/_version.py
rm -rf .pytest_cache build/ dist/ python_kraken_sdk.egg-info docs/_build
rm -f .coverage kraken/_version.py *.log *.csv *.zip tests/*.zip tests/.csv
find tests -name "__pycache__" | xargs rm -rf
find kraken -name "__pycache__" | xargs rm -rf
find examples -name "__pycache__" | xargs rm -rf
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
![CI/CD](https://github.com/btschwertfeger/kraken-python-sdk/actions/workflows/cicd.yml/badge.svg)
![codecov](https://codecov.io/gh/btschwertfeger/Python-Kraken-SDK/branch/master/badge.svg)

![release](https://shields.io/github/release-date/btschwertfeger/python-kraken-sdk)
![release](https://shields.io/github/v/release/btschwertfeger/python-kraken-sdk?display_name=tag)
[![DOI](https://zenodo.org/badge/510751854.svg)](https://zenodo.org/badge/latestdoi/510751854)

</div>
Expand All @@ -27,10 +29,6 @@ There is no guarantee that this software will work flawlessly at this or later t

---

## Package Update

- March 27, 2023

## Features

Clients:
Expand Down Expand Up @@ -113,7 +111,7 @@ A template Spot trading bot using both websocket and REST clients can be found i
... can be found in `/examples/spot_examples.py`

```python
from kraken.spot.client import User, Market, Trade, Funding, Staking
from kraken.spot import User, Market, Trade, Funding, Staking

def main() -> None:
key = 'Kraken-public-key'
Expand Down Expand Up @@ -159,7 +157,7 @@ if __name__ == '__main__': main()

```python
import asyncio, time
from kraken.spot.client import KrakenSpotWSClient
from kraken.spot import KrakenSpotWSClient

async def main() -> None:

Expand Down Expand Up @@ -242,7 +240,7 @@ A template Futures trading bot using both websocket and REST clients can be foun
The following example can be found in `/examples/futures_examples.py`.

```python
from kraken.futures.client import Market, User, Trade, Funding
from kraken.futures import Market, User, Trade, Funding

def main() -> None:

Expand Down Expand Up @@ -315,7 +313,7 @@ The following example can be found in `/examples/futures_ws_examples.py`.

```python
import asyncio
from kraken.futures.client import KrakenFuturesWSClient
from kraken.futures import KrakenFuturesWSClient

async def main() -> None:

Expand Down Expand Up @@ -379,7 +377,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## User

`kraken.spot.client.User`
`kraken.spot.User`

| Method | Documentation |
| -------------------------- | ----------------------------------------------------------------------------- |
Expand All @@ -405,7 +403,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## Trade

`kraken.spot.client.Trade`
`kraken.spot.Trade`

| Method | Documentation |
| --------------------------- | ------------------------------------------------------------ |
Expand All @@ -421,7 +419,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## Market

`kraken.spot.client.Market`
`kraken.spot.Market`

| Method | Documentation |
| ------------------------- | ------------------------------------------------------------- |
Expand All @@ -438,7 +436,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## Funding

`kraken.spot.client.Funding`
`kraken.spot.Funding`

| Method | Documentation |
| ---------------------------- | ------------------------------------------------------------------ |
Expand All @@ -455,7 +453,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## Staking

`kraken.spot.client.Staking`
`kraken.spot.Staking`

| Method | Documentation |
| ---------------------------------- | ----------------------------------------------------------------- |
Expand All @@ -469,7 +467,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## KrakenSpotWSClient

`kraken.spot.client.KrakenSpotWSClient`
`kraken.spot.KrakenSpotWSClient`

| Method | Documentation |
| ------------------------------ | ------------------------------------------------------------------------- |
Expand Down Expand Up @@ -497,7 +495,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## User

`kraken.futures.client.User`
`kraken.futures.User`

| Method | Documentation |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -514,7 +512,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## Trade

`kraken.futures.client.Trade`
`kraken.futures.Trade`

| Method | Documentation |
| -------------------- | -------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -531,7 +529,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## Market

`kraken.futures.client.Market`
`kraken.futures.Market`

| Method | Documentation |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -562,7 +560,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## Funding

`kraken.futures.client.Funding`
`kraken.futures.Funding`

| Method | Documentation |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------- |
Expand All @@ -575,7 +573,7 @@ Note: Authenticated Futures websocket clients can also un/subscribe from/to publ

## KrakenFuturesWSClient

`kraken.futures.client.KrakenFuturesWSClient`
`kraken.futures.KrakenFuturesWSClient`

| Method | Documentation |
| ------------------------------------------ | -------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion examples/futures_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import time

from kraken.futures.client import Funding, Market, Trade, User
from kraken.futures import Funding, Market, Trade, User

logging.basicConfig(
format="%(asctime)s %(module)s,line: %(lineno)d %(levelname)8s | %(message)s",
Expand Down
2 changes: 1 addition & 1 deletion examples/futures_trading_bot_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import urllib3

from kraken.exceptions.exceptions import KrakenExceptions
from kraken.futures.client import Funding, KrakenFuturesWSClient, Market, Trade, User
from kraken.futures import Funding, KrakenFuturesWSClient, Market, Trade, User

logging.basicConfig(
format="%(asctime)s %(module)s,line: %(lineno)d %(levelname)8s | %(message)s",
Expand Down
2 changes: 1 addition & 1 deletion examples/futures_ws_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
import time

from kraken.futures.client import KrakenFuturesWSClient
from kraken.futures import KrakenFuturesWSClient

logging.basicConfig(
format="%(asctime)s %(module)s,line: %(lineno)d %(levelname)8s | %(message)s",
Expand Down
7 changes: 1 addition & 6 deletions examples/market_client_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" from kraken.spot.client import Market\n",
"except ModuleNotFoundError:\n",
" import sys\n",
" sys.path.append('/Users/benjamin/repositories/Trading/python-kraken-sdk')\n",
" from kraken.spot.client import Market"
"from kraken.spot import Market"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/spot_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
import time

from kraken.spot.client import Funding, Market, Staking, Trade, User
from kraken.spot import Funding, Market, Staking, Trade, User

logging.basicConfig(
format="%(asctime)s %(module)s,line: %(lineno)d %(levelname)8s | %(message)s",
Expand Down
2 changes: 1 addition & 1 deletion examples/spot_trading_bot_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import urllib3

from kraken.exceptions.exceptions import KrakenExceptions
from kraken.spot.client import Funding, KrakenSpotWSClient, Market, Staking, Trade, User
from kraken.spot import Funding, KrakenSpotWSClient, Market, Staking, Trade, User

logging.basicConfig(
format="%(asctime)s %(module)s,line: %(lineno)d %(levelname)8s | %(message)s",
Expand Down
2 changes: 1 addition & 1 deletion examples/spot_ws_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
import time

from kraken.spot.client import KrakenSpotWSClient
from kraken.spot import KrakenSpotWSClient

logging.basicConfig(
format="%(asctime)s %(module)s,line: %(lineno)d %(levelname)8s | %(message)s",
Expand Down
Loading

0 comments on commit 417a864

Please sign in to comment.