pybinbot 0.1.6__py3-none-any.whl → 0.4.15__py3-none-any.whl

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 (36) hide show
  1. pybinbot/__init__.py +162 -0
  2. pybinbot/apis/binance/base.py +588 -0
  3. pybinbot/apis/binance/exceptions.py +17 -0
  4. pybinbot/apis/binbot/base.py +327 -0
  5. pybinbot/apis/binbot/exceptions.py +56 -0
  6. pybinbot/apis/kucoin/base.py +208 -0
  7. pybinbot/apis/kucoin/exceptions.py +9 -0
  8. pybinbot/apis/kucoin/market.py +92 -0
  9. pybinbot/apis/kucoin/orders.py +663 -0
  10. pybinbot/apis/kucoin/rest.py +33 -0
  11. pybinbot/models/__init__.py +0 -0
  12. {models → pybinbot/models}/bot_base.py +5 -5
  13. {models → pybinbot/models}/deal.py +24 -16
  14. {models → pybinbot/models}/order.py +41 -33
  15. pybinbot/models/routes.py +6 -0
  16. {models → pybinbot/models}/signals.py +5 -10
  17. pybinbot/py.typed +0 -0
  18. pybinbot/shared/__init__.py +0 -0
  19. pybinbot/shared/cache.py +32 -0
  20. {shared → pybinbot/shared}/enums.py +33 -22
  21. pybinbot/shared/handlers.py +89 -0
  22. pybinbot/shared/heikin_ashi.py +198 -0
  23. pybinbot/shared/indicators.py +271 -0
  24. {shared → pybinbot/shared}/logging_config.py +1 -3
  25. {shared → pybinbot/shared}/timestamps.py +5 -4
  26. pybinbot/shared/types.py +12 -0
  27. {pybinbot-0.1.6.dist-info → pybinbot-0.4.15.dist-info}/METADATA +22 -2
  28. pybinbot-0.4.15.dist-info/RECORD +32 -0
  29. pybinbot-0.4.15.dist-info/top_level.txt +1 -0
  30. pybinbot-0.1.6.dist-info/RECORD +0 -15
  31. pybinbot-0.1.6.dist-info/top_level.txt +0 -3
  32. pybinbot.py +0 -93
  33. shared/types.py +0 -8
  34. {shared → pybinbot/shared}/maths.py +0 -0
  35. {pybinbot-0.1.6.dist-info → pybinbot-0.4.15.dist-info}/WHEEL +0 -0
  36. {pybinbot-0.1.6.dist-info → pybinbot-0.4.15.dist-info}/licenses/LICENSE +0 -0
pybinbot/__init__.py ADDED
@@ -0,0 +1,162 @@
1
+ """Public API for the ``pybinbot`` distribution.
2
+
3
+ This package exposes a flat, convenient API for common types, enums and
4
+ models, while still allowing access to the structured subpackages via
5
+ ``pybinbot.shared`` and ``pybinbot.models``.
6
+ """
7
+
8
+ from pybinbot.shared.maths import (
9
+ format_ts,
10
+ interval_to_millisecs,
11
+ round_numbers,
12
+ round_numbers_ceiling,
13
+ round_numbers_floor,
14
+ supress_notation,
15
+ supress_trailling,
16
+ zero_remainder,
17
+ )
18
+ from pybinbot.shared.timestamps import (
19
+ ms_to_sec,
20
+ round_timestamp,
21
+ sec_to_ms,
22
+ timestamp,
23
+ timestamp_to_datetime,
24
+ ts_to_day,
25
+ ts_to_humandate,
26
+ )
27
+ from pybinbot.shared.enums import (
28
+ AutotradeSettingsDocument,
29
+ BinanceKlineIntervals,
30
+ BinanceOrderModel,
31
+ CloseConditions,
32
+ DealType,
33
+ ExchangeId,
34
+ KafkaTopics,
35
+ KucoinKlineIntervals,
36
+ MarketDominance,
37
+ OrderSide,
38
+ OrderStatus,
39
+ OrderType,
40
+ QuoteAssets,
41
+ Status,
42
+ Strategy,
43
+ TimeInForce,
44
+ TrendEnum,
45
+ UserRoles,
46
+ )
47
+ from pybinbot.shared.indicators import Indicators
48
+ from pybinbot.shared.heikin_ashi import HeikinAshi
49
+ from pybinbot.shared.logging_config import configure_logging
50
+ from pybinbot.shared.types import Amount, CombinedApis
51
+ from pybinbot.shared.cache import cache
52
+ from pybinbot.shared.handlers import handle_binance_errors, aio_response_handler
53
+ from pybinbot.models.bot_base import BotBase
54
+ from pybinbot.models.deal import DealBase
55
+ from pybinbot.models.order import OrderBase
56
+ from pybinbot.models.signals import HABollinguerSpread, SignalsConsumer
57
+ from pybinbot.models.routes import StandardResponse
58
+ from pybinbot.apis.binance.base import BinanceApi
59
+ from pybinbot.apis.binbot.base import BinbotApi
60
+ from pybinbot.apis.binbot.exceptions import (
61
+ BinbotErrors,
62
+ QuantityTooLow,
63
+ IsolateBalanceError,
64
+ DealCreationError,
65
+ MarginShortError,
66
+ MarginLoanNotFound,
67
+ DeleteOrderError,
68
+ LowBalanceCleanupError,
69
+ SaveBotError,
70
+ InsufficientBalance,
71
+ )
72
+ from pybinbot.apis.kucoin.base import KucoinApi
73
+ from pybinbot.apis.kucoin.exceptions import KucoinErrors
74
+ from pybinbot.apis.binance.exceptions import (
75
+ BinanceErrors,
76
+ InvalidSymbol,
77
+ NotEnoughFunds,
78
+ )
79
+
80
+
81
+ from . import models, shared, apis
82
+
83
+ __all__ = [
84
+ # subpackages
85
+ "shared",
86
+ "models",
87
+ "apis",
88
+ # models
89
+ "BotBase",
90
+ "OrderBase",
91
+ "DealBase",
92
+ "StandardResponse",
93
+ "HABollinguerSpread",
94
+ "SignalsConsumer",
95
+ # misc
96
+ "Amount",
97
+ "CombinedApis",
98
+ "configure_logging",
99
+ "cache",
100
+ "handle_binance_errors",
101
+ "aio_response_handler",
102
+ # maths helpers
103
+ "supress_trailling",
104
+ "round_numbers",
105
+ "round_numbers_ceiling",
106
+ "round_numbers_floor",
107
+ "supress_notation",
108
+ "interval_to_millisecs",
109
+ "format_ts",
110
+ "zero_remainder",
111
+ # timestamp helpers
112
+ "timestamp",
113
+ "round_timestamp",
114
+ "ts_to_day",
115
+ "ms_to_sec",
116
+ "sec_to_ms",
117
+ "ts_to_humandate",
118
+ "timestamp_to_datetime",
119
+ # dataframes
120
+ "Indicators",
121
+ "HeikinAshi",
122
+ # enums
123
+ "CloseConditions",
124
+ "KafkaTopics",
125
+ "DealType",
126
+ "BinanceOrderModel",
127
+ "Status",
128
+ "Strategy",
129
+ "OrderType",
130
+ "TimeInForce",
131
+ "OrderSide",
132
+ "OrderStatus",
133
+ "TrendEnum",
134
+ "BinanceKlineIntervals",
135
+ "KucoinKlineIntervals",
136
+ "AutotradeSettingsDocument",
137
+ "UserRoles",
138
+ "QuoteAssets",
139
+ "ExchangeId",
140
+ "HABollinguerSpread",
141
+ "SignalsConsumer",
142
+ "MarketDominance",
143
+ # exchange apis
144
+ "BinbotApi",
145
+ "BinanceApi",
146
+ "KucoinApi",
147
+ "KucoinErrors",
148
+ # exceptions
149
+ "BinanceErrors",
150
+ "InvalidSymbol",
151
+ "NotEnoughFunds",
152
+ "BinbotErrors",
153
+ "QuantityTooLow",
154
+ "IsolateBalanceError",
155
+ "MarginShortError",
156
+ "MarginLoanNotFound",
157
+ "DeleteOrderError",
158
+ "LowBalanceCleanupError",
159
+ "DealCreationError",
160
+ "SaveBotError",
161
+ "InsufficientBalance",
162
+ ]