whitebird-api 0.1.1__tar.gz
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.
- whitebird_api-0.1.1/.gitignore +31 -0
- whitebird_api-0.1.1/CHANGELOG.md +31 -0
- whitebird_api-0.1.1/LICENSE +21 -0
- whitebird_api-0.1.1/PKG-INFO +98 -0
- whitebird_api-0.1.1/README.md +66 -0
- whitebird_api-0.1.1/pyproject.toml +83 -0
- whitebird_api-0.1.1/src/whitebird/__init__.py +78 -0
- whitebird_api-0.1.1/src/whitebird/_auth.py +670 -0
- whitebird_api-0.1.1/src/whitebird/_client.py +496 -0
- whitebird_api-0.1.1/src/whitebird/_config.py +66 -0
- whitebird_api-0.1.1/src/whitebird/_engine.py +716 -0
- whitebird_api-0.1.1/src/whitebird/_exceptions.py +267 -0
- whitebird_api-0.1.1/src/whitebird/_generated/__init__.py +2 -0
- whitebird_api-0.1.1/src/whitebird/_generated/models.py +5855 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/__init__.py +249 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/accounting.py +398 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/auth.py +617 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/balance.py +1068 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/brokerage.py +2226 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/client.py +194 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/current_account.py +494 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/exchange.py +1010 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/ico.py +3262 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/kyc.py +1480 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/market.py +238 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/merchant.py +789 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/notifications.py +246 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/payments.py +501 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/providers.py +1716 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/referral.py +310 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/registration.py +638 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/reports.py +437 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/support.py +98 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/trading.py +1054 -0
- whitebird_api-0.1.1/src/whitebird/_generated/resources/user.py +1297 -0
- whitebird_api-0.1.1/src/whitebird/_generated/services.py +74 -0
- whitebird_api-0.1.1/src/whitebird/_http.py +329 -0
- whitebird_api-0.1.1/src/whitebird/_json.py +80 -0
- whitebird_api-0.1.1/src/whitebird/_models.py +102 -0
- whitebird_api-0.1.1/src/whitebird/_resource.py +19 -0
- whitebird_api-0.1.1/src/whitebird/_version.py +3 -0
- whitebird_api-0.1.1/src/whitebird/models.py +13 -0
- whitebird_api-0.1.1/src/whitebird/otp.py +54 -0
- whitebird_api-0.1.1/src/whitebird/pagination.py +145 -0
- whitebird_api-0.1.1/src/whitebird/py.typed +0 -0
- whitebird_api-0.1.1/src/whitebird/streaming.py +312 -0
- whitebird_api-0.1.1/src/whitebird/tokens.py +147 -0
- whitebird_api-0.1.1/src/whitebird/types.py +80 -0
- whitebird_api-0.1.1/tests/__init__.py +0 -0
- whitebird_api-0.1.1/tests/conftest.py +63 -0
- whitebird_api-0.1.1/tests/support.py +76 -0
- whitebird_api-0.1.1/tests/test_auth.py +702 -0
- whitebird_api-0.1.1/tests/test_captcha.py +273 -0
- whitebird_api-0.1.1/tests/test_models.py +100 -0
- whitebird_api-0.1.1/tests/test_operation_mfa.py +229 -0
- whitebird_api-0.1.1/tests/test_otp.py +54 -0
- whitebird_api-0.1.1/tests/test_pagination.py +192 -0
- whitebird_api-0.1.1/tests/test_requests.py +610 -0
- whitebird_api-0.1.1/tests/test_streaming.py +348 -0
- whitebird_api-0.1.1/tests/test_tokens.py +97 -0
- whitebird_api-0.1.1/uv.lock +677 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Tooling caches
|
|
2
|
+
.cache/
|
|
3
|
+
node_modules/
|
|
4
|
+
dist/
|
|
5
|
+
target/
|
|
6
|
+
site/
|
|
7
|
+
coverage/
|
|
8
|
+
.venv/
|
|
9
|
+
__pycache__/
|
|
10
|
+
*.pyc
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.mypy_cache/
|
|
13
|
+
.ruff_cache/
|
|
14
|
+
*.egg-info/
|
|
15
|
+
.coverage
|
|
16
|
+
htmlcov/
|
|
17
|
+
|
|
18
|
+
# Local secrets
|
|
19
|
+
.env
|
|
20
|
+
.env.*
|
|
21
|
+
!.env.example
|
|
22
|
+
|
|
23
|
+
# Editors
|
|
24
|
+
.idea/
|
|
25
|
+
.vscode/
|
|
26
|
+
*.swp
|
|
27
|
+
.DS_Store
|
|
28
|
+
|
|
29
|
+
docs/reference/generated/
|
|
30
|
+
scripts/docs/node_modules/
|
|
31
|
+
site/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.1](https://github.com/joolertan/whitebird-api/compare/python-v0.1.0...python-v0.1.1) (2026-11-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* generate account, KYC and notification resources ([24c57c0](https://github.com/joolertan/whitebird-api/commit/24c57c058342df5e2146fcbd42949606af78292d))
|
|
9
|
+
* generate exchange, balance and merchant resources ([b63943c](https://github.com/joolertan/whitebird-api/commit/b63943c55c9875660b9f9e85f83fcf7712d52553))
|
|
10
|
+
* generate ICO resources ([690d30a](https://github.com/joolertan/whitebird-api/commit/690d30a8f1b409714a74309b1b1fa461ddf256db))
|
|
11
|
+
* generate market data and trading resources ([641bc73](https://github.com/joolertan/whitebird-api/commit/641bc731f29e10593d1fbf4dc812832bc63af540))
|
|
12
|
+
* generate payment provider resources ([babefc3](https://github.com/joolertan/whitebird-api/commit/babefc38d112af3dd4d658ef2ef44b09744c3a38))
|
|
13
|
+
* **python:** accept coroutine code providers in AsyncWhitebird ([b761b4a](https://github.com/joolertan/whitebird-api/commit/b761b4a9dff0b4417ce60bb097014c247502ed36))
|
|
14
|
+
* **python:** add sync and async clients with auth, retries, pagination and SSE ([832e23e](https://github.com/joolertan/whitebird-api/commit/832e23ec957cb365efabf4c695f0720f106ee241))
|
|
15
|
+
* **python:** captcha solver, operation MFA and examples ([fbc9b83](https://github.com/joolertan/whitebird-api/commit/fbc9b835c71da1754721a8934c1183f5c57aff79))
|
|
16
|
+
* **python:** generate brokerage resources ([175ec45](https://github.com/joolertan/whitebird-api/commit/175ec458e2fc3c7839dce050b8e932c8778bcfd2))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* check two-factor status before every password login ([b180779](https://github.com/joolertan/whitebird-api/commit/b1807797a0652b961e8a1ffb4033d3087f64fead))
|
|
22
|
+
* **python:** accept union response types in the engine ([50cbba7](https://github.com/joolertan/whitebird-api/commit/50cbba728aa589d16a370cee24aae83752b6c60c))
|
|
23
|
+
* **python:** sign in, refresh and retry like the web app ([5b1e4de](https://github.com/joolertan/whitebird-api/commit/5b1e4de419ec075f3e78d367c6249b9f81308233))
|
|
24
|
+
* **python:** use Decimal for brokerage amounts ([9e750d5](https://github.com/joolertan/whitebird-api/commit/9e750d5dcc377f04c8cdeba20928931dadfb30c4))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
|
|
29
|
+
* add READMEs, contributing guide and security policy ([1d42f36](https://github.com/joolertan/whitebird-api/commit/1d42f366470d26b7986b04a6a504ee0e26704722))
|
|
30
|
+
* describe what the SDKs do instead of how the spec is built ([5260784](https://github.com/joolertan/whitebird-api/commit/526078462e652d3d15e90d5ac48dfcf6d3285807))
|
|
31
|
+
* **spec:** describe ICO operation types in English ([ce94835](https://github.com/joolertan/whitebird-api/commit/ce94835377e65b2c3e51ad04eaf9091f33ca33bb))
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joolertan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: whitebird-api
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Unofficial Whitebird API client
|
|
5
|
+
Project-URL: Homepage, https://github.com/joolertan/whitebird-api
|
|
6
|
+
Project-URL: Repository, https://github.com/joolertan/whitebird-api
|
|
7
|
+
Project-URL: Documentation, https://whitebird-api.readthedocs.io
|
|
8
|
+
Project-URL: Issues, https://github.com/joolertan/whitebird-api/issues
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: api,client,crypto,cryptocurrency,exchange,sdk,trading,whitebird
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Requires-Dist: httpx>=0.27
|
|
27
|
+
Requires-Dist: pydantic>=2.11
|
|
28
|
+
Requires-Dist: typing-extensions>=4.12
|
|
29
|
+
Provides-Extra: otp
|
|
30
|
+
Requires-Dist: pyotp>=2.9; extra == 'otp'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# whitebird-api
|
|
34
|
+
|
|
35
|
+
[](https://pypi.org/project/whitebird-api/)
|
|
36
|
+
[](https://pypi.org/project/whitebird-api/)
|
|
37
|
+
[](https://whitebird-api.readthedocs.io)
|
|
38
|
+
|
|
39
|
+
Unofficial Python client for the [Whitebird](https://whitebird.io) crypto exchange API, sync and
|
|
40
|
+
async, fully typed.
|
|
41
|
+
|
|
42
|
+
Covers market data, exchange and spot trading, deposits and withdrawals, payment cards,
|
|
43
|
+
brokerage, ICO tokens, KYC, notifications and account settings.
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pip install whitebird-api
|
|
47
|
+
pip install "whitebird-api[otp]" # TOTP codes for accounts with two-factor authentication
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import os
|
|
52
|
+
|
|
53
|
+
from whitebird import Whitebird
|
|
54
|
+
from whitebird.otp import TOTP
|
|
55
|
+
|
|
56
|
+
client = Whitebird(
|
|
57
|
+
os.environ["WHITEBIRD_USERNAME"],
|
|
58
|
+
os.environ["WHITEBIRD_PASSWORD"],
|
|
59
|
+
otp=TOTP(os.environ["WHITEBIRD_TOTP_SECRET"]),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
book = client.market.orderbook(symbol="BTCUSDT", limit=5)
|
|
63
|
+
|
|
64
|
+
# Paginated methods are iterable; pages are fetched as the loop goes.
|
|
65
|
+
for order in client.exchange.orders.history(size=50):
|
|
66
|
+
print(order.number, order.status)
|
|
67
|
+
|
|
68
|
+
# Real-time notifications, reconnecting on their own.
|
|
69
|
+
with client.notifications.stream() as events:
|
|
70
|
+
for event in events:
|
|
71
|
+
print(event.data.type, event.data.payload)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`AsyncWhitebird` offers the same methods as coroutines, with `async for` over listings and
|
|
75
|
+
streams.
|
|
76
|
+
|
|
77
|
+
- **Sessions:** the client signs in on the first call that needs it, refreshes the token a minute
|
|
78
|
+
before it expires and keeps it in a token store (`FileTokenStore` survives restarts);
|
|
79
|
+
`client.user.logout()` ends the session.
|
|
80
|
+
- **Two-factor codes:** `otp=` takes `TOTP(secret)`, a function returning the current code (one
|
|
81
|
+
that asks the user keeps the secret out of the program; coroutine functions with
|
|
82
|
+
`AsyncWhitebird`) or a fixed code. It is asked for a code only when Whitebird wants one.
|
|
83
|
+
- **Captcha:** accounts without two-factor authentication sign in through a slider captcha; pass
|
|
84
|
+
`captcha=` a function that returns the slider position.
|
|
85
|
+
- **Withdrawals:** when Whitebird refuses an operation for MFA and `otp` is configured, the client
|
|
86
|
+
obtains the operation MFA token and sends the operation again;
|
|
87
|
+
`client.confirm_operation("WITHDRAWAL", code)` does it explicitly.
|
|
88
|
+
- **Errors and retries:** `APIError` subclasses carry `status_code`, `error_code`, `sub_status`,
|
|
89
|
+
`message` and `fields`; network failures raise `TransportError`. Reads are retried after
|
|
90
|
+
network errors, timeouts and HTTP 429/502/503/504, other requests only when Whitebird surely
|
|
91
|
+
did not process them (HTTP 429, connection failures).
|
|
92
|
+
- **Escape hatch:** `client.request(service, method, path, ...)` calls endpoints the SDK does not
|
|
93
|
+
cover yet.
|
|
94
|
+
|
|
95
|
+
Documentation: <https://whitebird-api.readthedocs.io> ·
|
|
96
|
+
Examples: [`examples/python`](https://github.com/joolertan/whitebird-api/tree/main/examples/python)
|
|
97
|
+
|
|
98
|
+
This project is not affiliated with Whitebird.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# whitebird-api
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/whitebird-api/)
|
|
4
|
+
[](https://pypi.org/project/whitebird-api/)
|
|
5
|
+
[](https://whitebird-api.readthedocs.io)
|
|
6
|
+
|
|
7
|
+
Unofficial Python client for the [Whitebird](https://whitebird.io) crypto exchange API, sync and
|
|
8
|
+
async, fully typed.
|
|
9
|
+
|
|
10
|
+
Covers market data, exchange and spot trading, deposits and withdrawals, payment cards,
|
|
11
|
+
brokerage, ICO tokens, KYC, notifications and account settings.
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pip install whitebird-api
|
|
15
|
+
pip install "whitebird-api[otp]" # TOTP codes for accounts with two-factor authentication
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
import os
|
|
20
|
+
|
|
21
|
+
from whitebird import Whitebird
|
|
22
|
+
from whitebird.otp import TOTP
|
|
23
|
+
|
|
24
|
+
client = Whitebird(
|
|
25
|
+
os.environ["WHITEBIRD_USERNAME"],
|
|
26
|
+
os.environ["WHITEBIRD_PASSWORD"],
|
|
27
|
+
otp=TOTP(os.environ["WHITEBIRD_TOTP_SECRET"]),
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
book = client.market.orderbook(symbol="BTCUSDT", limit=5)
|
|
31
|
+
|
|
32
|
+
# Paginated methods are iterable; pages are fetched as the loop goes.
|
|
33
|
+
for order in client.exchange.orders.history(size=50):
|
|
34
|
+
print(order.number, order.status)
|
|
35
|
+
|
|
36
|
+
# Real-time notifications, reconnecting on their own.
|
|
37
|
+
with client.notifications.stream() as events:
|
|
38
|
+
for event in events:
|
|
39
|
+
print(event.data.type, event.data.payload)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`AsyncWhitebird` offers the same methods as coroutines, with `async for` over listings and
|
|
43
|
+
streams.
|
|
44
|
+
|
|
45
|
+
- **Sessions:** the client signs in on the first call that needs it, refreshes the token a minute
|
|
46
|
+
before it expires and keeps it in a token store (`FileTokenStore` survives restarts);
|
|
47
|
+
`client.user.logout()` ends the session.
|
|
48
|
+
- **Two-factor codes:** `otp=` takes `TOTP(secret)`, a function returning the current code (one
|
|
49
|
+
that asks the user keeps the secret out of the program; coroutine functions with
|
|
50
|
+
`AsyncWhitebird`) or a fixed code. It is asked for a code only when Whitebird wants one.
|
|
51
|
+
- **Captcha:** accounts without two-factor authentication sign in through a slider captcha; pass
|
|
52
|
+
`captcha=` a function that returns the slider position.
|
|
53
|
+
- **Withdrawals:** when Whitebird refuses an operation for MFA and `otp` is configured, the client
|
|
54
|
+
obtains the operation MFA token and sends the operation again;
|
|
55
|
+
`client.confirm_operation("WITHDRAWAL", code)` does it explicitly.
|
|
56
|
+
- **Errors and retries:** `APIError` subclasses carry `status_code`, `error_code`, `sub_status`,
|
|
57
|
+
`message` and `fields`; network failures raise `TransportError`. Reads are retried after
|
|
58
|
+
network errors, timeouts and HTTP 429/502/503/504, other requests only when Whitebird surely
|
|
59
|
+
did not process them (HTTP 429, connection failures).
|
|
60
|
+
- **Escape hatch:** `client.request(service, method, path, ...)` calls endpoints the SDK does not
|
|
61
|
+
cover yet.
|
|
62
|
+
|
|
63
|
+
Documentation: <https://whitebird-api.readthedocs.io> ·
|
|
64
|
+
Examples: [`examples/python`](https://github.com/joolertan/whitebird-api/tree/main/examples/python)
|
|
65
|
+
|
|
66
|
+
This project is not affiliated with Whitebird.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "whitebird-api"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "Unofficial Whitebird API client"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
|
+
keywords = ["whitebird", "crypto", "cryptocurrency", "exchange", "trading", "api", "client", "sdk"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 3 - Alpha",
|
|
12
|
+
"Intended Audience :: Developers",
|
|
13
|
+
"Intended Audience :: Financial and Insurance Industry",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Programming Language :: Python :: 3.14",
|
|
21
|
+
"Topic :: Office/Business :: Financial :: Investment",
|
|
22
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
23
|
+
"Typing :: Typed",
|
|
24
|
+
]
|
|
25
|
+
dependencies = ["httpx>=0.27", "pydantic>=2.11", "typing-extensions>=4.12"]
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
otp = ["pyotp>=2.9"]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://github.com/joolertan/whitebird-api"
|
|
32
|
+
Repository = "https://github.com/joolertan/whitebird-api"
|
|
33
|
+
Documentation = "https://whitebird-api.readthedocs.io"
|
|
34
|
+
Issues = "https://github.com/joolertan/whitebird-api/issues"
|
|
35
|
+
|
|
36
|
+
[dependency-groups]
|
|
37
|
+
dev = [
|
|
38
|
+
"mypy>=1.13",
|
|
39
|
+
"pyotp>=2.9",
|
|
40
|
+
"pytest>=8",
|
|
41
|
+
"pytest-asyncio>=0.24",
|
|
42
|
+
"respx>=0.21",
|
|
43
|
+
"ruff==0.17.4",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[build-system]
|
|
47
|
+
requires = ["hatchling"]
|
|
48
|
+
build-backend = "hatchling.build"
|
|
49
|
+
|
|
50
|
+
[tool.hatch.version]
|
|
51
|
+
path = "src/whitebird/_version.py"
|
|
52
|
+
|
|
53
|
+
[tool.hatch.build.targets.wheel]
|
|
54
|
+
packages = ["src/whitebird"]
|
|
55
|
+
|
|
56
|
+
[tool.ruff]
|
|
57
|
+
line-length = 100
|
|
58
|
+
target-version = "py311"
|
|
59
|
+
|
|
60
|
+
[tool.ruff.lint]
|
|
61
|
+
select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF", "D", "N", "PT", "PL", "C4", "PIE", "RET"]
|
|
62
|
+
ignore = ["D105", "D107", "PLR0911", "PLR0913", "PLR2004"]
|
|
63
|
+
|
|
64
|
+
[tool.ruff.lint.isort]
|
|
65
|
+
known-first-party = ["whitebird"]
|
|
66
|
+
|
|
67
|
+
[tool.ruff.lint.pydocstyle]
|
|
68
|
+
convention = "google"
|
|
69
|
+
|
|
70
|
+
[tool.ruff.lint.per-file-ignores]
|
|
71
|
+
"tests/**" = ["D", "PLC0415"]
|
|
72
|
+
# API values quoted in docstrings can be Cyrillic.
|
|
73
|
+
"src/whitebird/_generated/**" = ["RUF002"]
|
|
74
|
+
|
|
75
|
+
[tool.mypy]
|
|
76
|
+
strict = true
|
|
77
|
+
files = ["src", "tests", "../examples/python"]
|
|
78
|
+
|
|
79
|
+
[tool.pytest.ini_options]
|
|
80
|
+
asyncio_mode = "auto"
|
|
81
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
82
|
+
testpaths = ["tests"]
|
|
83
|
+
filterwarnings = ["error"]
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Unofficial client of the Whitebird crypto exchange API.
|
|
2
|
+
|
|
3
|
+
Examples:
|
|
4
|
+
```python
|
|
5
|
+
from whitebird import Whitebird
|
|
6
|
+
|
|
7
|
+
with Whitebird("me@example.com", "password") as client:
|
|
8
|
+
print(client.brokerage.subaccounts.me())
|
|
9
|
+
```
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from ._client import AsyncWhitebird, Whitebird
|
|
13
|
+
from ._exceptions import (
|
|
14
|
+
APIError,
|
|
15
|
+
AuthenticationError,
|
|
16
|
+
BadRequestError,
|
|
17
|
+
CaptchaRequiredError,
|
|
18
|
+
ConflictError,
|
|
19
|
+
MFARequiredError,
|
|
20
|
+
NotFoundError,
|
|
21
|
+
PermissionDeniedError,
|
|
22
|
+
RateLimitError,
|
|
23
|
+
ServerError,
|
|
24
|
+
TransportError,
|
|
25
|
+
VerificationRequiredError,
|
|
26
|
+
WhitebirdError,
|
|
27
|
+
)
|
|
28
|
+
from ._generated.services import Environment
|
|
29
|
+
from ._version import __version__
|
|
30
|
+
from .pagination import AsyncPager, Page, SyncPager
|
|
31
|
+
from .streaming import AsyncEventStream, EventStream, ServerSentEvent
|
|
32
|
+
from .tokens import FileTokenStore, MemoryTokenStore, Tokens, TokenStore
|
|
33
|
+
from .types import (
|
|
34
|
+
AsyncCaptchaSolver,
|
|
35
|
+
AsyncCodeProvider,
|
|
36
|
+
Captcha,
|
|
37
|
+
CaptchaSolver,
|
|
38
|
+
CodeProvider,
|
|
39
|
+
FileContent,
|
|
40
|
+
RequestOptions,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
__all__ = [
|
|
44
|
+
"APIError",
|
|
45
|
+
"AsyncCaptchaSolver",
|
|
46
|
+
"AsyncCodeProvider",
|
|
47
|
+
"AsyncEventStream",
|
|
48
|
+
"AsyncPager",
|
|
49
|
+
"AsyncWhitebird",
|
|
50
|
+
"AuthenticationError",
|
|
51
|
+
"BadRequestError",
|
|
52
|
+
"Captcha",
|
|
53
|
+
"CaptchaRequiredError",
|
|
54
|
+
"CaptchaSolver",
|
|
55
|
+
"CodeProvider",
|
|
56
|
+
"ConflictError",
|
|
57
|
+
"Environment",
|
|
58
|
+
"EventStream",
|
|
59
|
+
"FileContent",
|
|
60
|
+
"FileTokenStore",
|
|
61
|
+
"MFARequiredError",
|
|
62
|
+
"MemoryTokenStore",
|
|
63
|
+
"NotFoundError",
|
|
64
|
+
"Page",
|
|
65
|
+
"PermissionDeniedError",
|
|
66
|
+
"RateLimitError",
|
|
67
|
+
"RequestOptions",
|
|
68
|
+
"ServerError",
|
|
69
|
+
"ServerSentEvent",
|
|
70
|
+
"SyncPager",
|
|
71
|
+
"TokenStore",
|
|
72
|
+
"Tokens",
|
|
73
|
+
"TransportError",
|
|
74
|
+
"VerificationRequiredError",
|
|
75
|
+
"Whitebird",
|
|
76
|
+
"WhitebirdError",
|
|
77
|
+
"__version__",
|
|
78
|
+
]
|