finatic-server-python 0.1.6__tar.gz → 0.9.0__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.
- finatic_server_python-0.9.0/.editorconfig +20 -0
- finatic_server_python-0.9.0/.gitignore +101 -0
- finatic_server_python-0.9.0/CHANGELOG.md +16 -0
- finatic_server_python-0.9.0/PKG-INFO +126 -0
- finatic_server_python-0.9.0/README.md +81 -0
- finatic_server_python-0.9.0/demo-app/README.md +115 -0
- finatic_server_python-0.9.0/demo-app/api_server.py +1120 -0
- finatic_server_python-0.9.0/demo-app/demo_cli.py +634 -0
- finatic_server_python-0.9.0/demo-app/env.example +6 -0
- finatic_server_python-0.9.0/demo-app/pyproject.toml +122 -0
- finatic_server_python-0.9.0/demo-app/run_api.py +48 -0
- finatic_server_python-0.9.0/demo-app/uv.lock +3249 -0
- finatic_server_python-0.9.0/finatic_server_python/__init__.py +26 -0
- {finatic_server_python-0.1.6 → finatic_server_python-0.9.0}/pyproject.toml +57 -9
- finatic_server_python-0.9.0/pytest.ini +5 -0
- finatic_server_python-0.9.0/quality_check.py +114 -0
- finatic_server_python-0.9.0/src/__init__.py +14 -0
- finatic_server_python-0.9.0/src/custom/FinaticServer.py +31 -0
- finatic_server_python-0.9.0/src/custom/__init__.py +15 -0
- finatic_server_python-0.9.0/src/custom/wrappers/brokers.py +21 -0
- finatic_server_python-0.9.0/src/custom/wrappers/company.py +19 -0
- finatic_server_python-0.9.0/src/custom/wrappers/session.py +23 -0
- finatic_server_python-0.9.0/src/generated/FinaticServer.py +2660 -0
- finatic_server_python-0.9.0/src/generated/__init__.py +186 -0
- finatic_server_python-0.9.0/src/generated/api/__init__.py +7 -0
- finatic_server_python-0.9.0/src/generated/api/brokers_api.py +4489 -0
- finatic_server_python-0.9.0/src/generated/api/company_api.py +565 -0
- finatic_server_python-0.9.0/src/generated/api/session_api.py +1221 -0
- finatic_server_python-0.9.0/src/generated/api_client.py +807 -0
- finatic_server_python-0.9.0/src/generated/api_response.py +21 -0
- finatic_server_python-0.9.0/src/generated/config.py +111 -0
- finatic_server_python-0.9.0/src/generated/configuration.py +581 -0
- finatic_server_python-0.9.0/src/generated/exceptions.py +216 -0
- finatic_server_python-0.9.0/src/generated/models/__init__.py +83 -0
- finatic_server_python-0.9.0/src/generated/models/account_status.py +37 -0
- finatic_server_python-0.9.0/src/generated/models/accounts.py +219 -0
- finatic_server_python-0.9.0/src/generated/models/balances.py +188 -0
- finatic_server_python-0.9.0/src/generated/models/broker_data_account_type_enum.py +38 -0
- finatic_server_python-0.9.0/src/generated/models/broker_data_asset_type_enum.py +41 -0
- finatic_server_python-0.9.0/src/generated/models/broker_data_connection_status_enum.py +41 -0
- finatic_server_python-0.9.0/src/generated/models/broker_data_order_side_enum.py +37 -0
- finatic_server_python-0.9.0/src/generated/models/broker_data_order_status_enum.py +46 -0
- finatic_server_python-0.9.0/src/generated/models/broker_data_position_status_enum.py +38 -0
- finatic_server_python-0.9.0/src/generated/models/broker_info.py +127 -0
- finatic_server_python-0.9.0/src/generated/models/company_response.py +196 -0
- finatic_server_python-0.9.0/src/generated/models/disconnect_action_result.py +109 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_error.py +107 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_company_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_disconnect_action_result.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_accounts.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_balances.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_broker_info.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_order_event_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_order_fill_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_order_group_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_order_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_position_lot_fill_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_position_lot_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_position_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_list_user_broker_connections.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_portal_url_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_session_response_data.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_session_user_response.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/finatic_response_token_response_data.py +120 -0
- finatic_server_python-0.9.0/src/generated/models/http_validation_error.py +108 -0
- finatic_server_python-0.9.0/src/generated/models/order_event_response.py +133 -0
- finatic_server_python-0.9.0/src/generated/models/order_fill_response.py +140 -0
- finatic_server_python-0.9.0/src/generated/models/order_group_order.py +126 -0
- finatic_server_python-0.9.0/src/generated/models/order_group_response.py +141 -0
- finatic_server_python-0.9.0/src/generated/models/order_leg.py +126 -0
- finatic_server_python-0.9.0/src/generated/models/order_response.py +162 -0
- finatic_server_python-0.9.0/src/generated/models/portal_url_response.py +100 -0
- finatic_server_python-0.9.0/src/generated/models/position_lot_fill_response.py +133 -0
- finatic_server_python-0.9.0/src/generated/models/position_lot_response.py +162 -0
- finatic_server_python-0.9.0/src/generated/models/position_response.py +258 -0
- finatic_server_python-0.9.0/src/generated/models/public_subscription_status_enum.py +43 -0
- finatic_server_python-0.9.0/src/generated/models/session_response_data.py +115 -0
- finatic_server_python-0.9.0/src/generated/models/session_start_request.py +105 -0
- finatic_server_python-0.9.0/src/generated/models/session_status.py +40 -0
- finatic_server_python-0.9.0/src/generated/models/session_user_response.py +112 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_company_response.py +118 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_disconnect_action_result.py +118 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_accounts.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_balances.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_broker_info.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_order_event_response.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_order_fill_response.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_order_group_response.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_order_response.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_position_lot_fill_response.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_position_lot_response.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_position_response.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_list_user_broker_connections.py +122 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_portal_url_response.py +118 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_session_response_data.py +118 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_session_user_response.py +118 -0
- finatic_server_python-0.9.0/src/generated/models/success_payload_token_response_data.py +118 -0
- finatic_server_python-0.9.0/src/generated/models/token_response_data.py +103 -0
- finatic_server_python-0.9.0/src/generated/models/user_broker_connections.py +170 -0
- finatic_server_python-0.9.0/src/generated/models/validation_error.py +112 -0
- finatic_server_python-0.9.0/src/generated/models/validation_error_loc_inner.py +138 -0
- finatic_server_python-0.9.0/src/generated/rest.py +213 -0
- finatic_server_python-0.9.0/src/generated/types.py +22 -0
- finatic_server_python-0.9.0/src/generated/utils/__init__.py +45 -0
- finatic_server_python-0.9.0/src/generated/utils/cache.py +72 -0
- finatic_server_python-0.9.0/src/generated/utils/enum_coercion.py +63 -0
- finatic_server_python-0.9.0/src/generated/utils/error_handling.py +129 -0
- finatic_server_python-0.9.0/src/generated/utils/interceptors.py +102 -0
- finatic_server_python-0.9.0/src/generated/utils/logger.py +69 -0
- finatic_server_python-0.9.0/src/generated/utils/plain_object.py +58 -0
- finatic_server_python-0.9.0/src/generated/utils/request_id.py +12 -0
- finatic_server_python-0.9.0/src/generated/utils/retry.py +99 -0
- finatic_server_python-0.9.0/src/generated/utils/url_utils.py +74 -0
- finatic_server_python-0.9.0/src/generated/utils/validation.py +46 -0
- finatic_server_python-0.9.0/src/generated/wrappers/__init__.py +15 -0
- finatic_server_python-0.9.0/src/generated/wrappers/brokers.py +3149 -0
- finatic_server_python-0.9.0/src/generated/wrappers/company.py +285 -0
- finatic_server_python-0.9.0/src/generated/wrappers/session.py +981 -0
- finatic_server_python-0.9.0/tests/conftest.py +27 -0
- finatic_server_python-0.9.0/tests/unit/test_brokers.py +44 -0
- finatic_server_python-0.9.0/tests/unit/test_company.py +43 -0
- finatic_server_python-0.9.0/tests/unit/test_market_data.py +44 -0
- finatic_server_python-0.9.0/tests/unit/test_session.py +44 -0
- finatic_server_python-0.9.0/uv.lock +3245 -0
- finatic_server_python-0.1.6/PKG-INFO +0 -472
- finatic_server_python-0.1.6/README.md +0 -434
- finatic_server_python-0.1.6/setup.cfg +0 -4
- finatic_server_python-0.1.6/src/finatic_server/__init__.py +0 -143
- finatic_server_python-0.1.6/src/finatic_server/core/__init__.py +0 -6
- finatic_server_python-0.1.6/src/finatic_server/core/api_client.py +0 -1770
- finatic_server_python-0.1.6/src/finatic_server/core/client.py +0 -1028
- finatic_server_python-0.1.6/src/finatic_server/types/__init__.py +0 -117
- finatic_server_python-0.1.6/src/finatic_server/types/auth.py +0 -142
- finatic_server_python-0.1.6/src/finatic_server/types/broker.py +0 -222
- finatic_server_python-0.1.6/src/finatic_server/types/common.py +0 -177
- finatic_server_python-0.1.6/src/finatic_server/types/orders.py +0 -93
- finatic_server_python-0.1.6/src/finatic_server/types/portfolio.py +0 -61
- finatic_server_python-0.1.6/src/finatic_server/types/webhook.py +0 -21
- finatic_server_python-0.1.6/src/finatic_server/utils/__init__.py +0 -27
- finatic_server_python-0.1.6/src/finatic_server/utils/errors.py +0 -94
- finatic_server_python-0.1.6/src/finatic_server_python.egg-info/PKG-INFO +0 -472
- finatic_server_python-0.1.6/src/finatic_server_python.egg-info/SOURCES.txt +0 -20
- finatic_server_python-0.1.6/src/finatic_server_python.egg-info/dependency_links.txt +0 -1
- finatic_server_python-0.1.6/src/finatic_server_python.egg-info/requires.txt +0 -14
- finatic_server_python-0.1.6/src/finatic_server_python.egg-info/top_level.txt +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
insert_final_newline = true
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
|
|
9
|
+
[*.{ts,tsx,js,jsx,json}]
|
|
10
|
+
indent_style = space
|
|
11
|
+
indent_size = 2
|
|
12
|
+
|
|
13
|
+
[*.md]
|
|
14
|
+
trim_trailing_whitespace = false
|
|
15
|
+
|
|
16
|
+
[*.{yml,yaml}]
|
|
17
|
+
indent_size = 2
|
|
18
|
+
|
|
19
|
+
[Makefile]
|
|
20
|
+
indent_style = tab
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
npm-debug.log*
|
|
4
|
+
yarn-debug.log*
|
|
5
|
+
yarn-error.log*
|
|
6
|
+
|
|
7
|
+
# Build outputs
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
*.tsbuildinfo
|
|
11
|
+
|
|
12
|
+
# Environment variables
|
|
13
|
+
.env
|
|
14
|
+
.env.local
|
|
15
|
+
.env.development.local
|
|
16
|
+
.env.test.local
|
|
17
|
+
.env.production.local
|
|
18
|
+
|
|
19
|
+
# IDE
|
|
20
|
+
.vscode/
|
|
21
|
+
.idea/
|
|
22
|
+
*.swp
|
|
23
|
+
*.swo
|
|
24
|
+
*~
|
|
25
|
+
|
|
26
|
+
# OS
|
|
27
|
+
.DS_Store
|
|
28
|
+
Thumbs.db
|
|
29
|
+
|
|
30
|
+
# Testing
|
|
31
|
+
coverage/
|
|
32
|
+
.nyc_output/
|
|
33
|
+
junit.xml
|
|
34
|
+
|
|
35
|
+
# Logs
|
|
36
|
+
logs/
|
|
37
|
+
*.log
|
|
38
|
+
|
|
39
|
+
# Runtime data
|
|
40
|
+
pids/
|
|
41
|
+
*.pid
|
|
42
|
+
*.seed
|
|
43
|
+
*.pid.lock
|
|
44
|
+
|
|
45
|
+
# Optional npm cache directory
|
|
46
|
+
.npm
|
|
47
|
+
|
|
48
|
+
# Optional eslint cache
|
|
49
|
+
.eslintcache
|
|
50
|
+
|
|
51
|
+
# Microbundle cache
|
|
52
|
+
.rpt2_cache/
|
|
53
|
+
.rts2_cache_cjs/
|
|
54
|
+
.rts2_cache_es/
|
|
55
|
+
.rts2_cache_umd/
|
|
56
|
+
|
|
57
|
+
# Optional REPL history
|
|
58
|
+
.node_repl_history
|
|
59
|
+
|
|
60
|
+
# Output of 'npm pack'
|
|
61
|
+
*.tgz
|
|
62
|
+
|
|
63
|
+
# Yarn Integrity file
|
|
64
|
+
.yarn-integrity
|
|
65
|
+
|
|
66
|
+
# Yarn lock file
|
|
67
|
+
yarn.lock
|
|
68
|
+
|
|
69
|
+
# parcel-bundler cache
|
|
70
|
+
.cache
|
|
71
|
+
.parcel-cache
|
|
72
|
+
|
|
73
|
+
# Serverless directories
|
|
74
|
+
.serverless
|
|
75
|
+
|
|
76
|
+
# FuseBox cache
|
|
77
|
+
.fusebox/
|
|
78
|
+
|
|
79
|
+
# DynamoDB Local files
|
|
80
|
+
.dynamodb/
|
|
81
|
+
|
|
82
|
+
# TernJS port file
|
|
83
|
+
.tern-port
|
|
84
|
+
|
|
85
|
+
# Python specific
|
|
86
|
+
__pycache__/
|
|
87
|
+
*.py[cod]
|
|
88
|
+
*$py.class
|
|
89
|
+
*.so
|
|
90
|
+
.Python
|
|
91
|
+
*.egg-info/
|
|
92
|
+
dist/
|
|
93
|
+
build/
|
|
94
|
+
.venv/
|
|
95
|
+
venv/
|
|
96
|
+
ENV/
|
|
97
|
+
env/
|
|
98
|
+
.pytest_cache/
|
|
99
|
+
.mypy_cache/
|
|
100
|
+
.coverage
|
|
101
|
+
htmlcov/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release
|
|
12
|
+
|
|
13
|
+
## [0.1.0] - YYYY-MM-DD
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Initial SDK release
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: finatic-server-python
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: Python SDK for Finatic Server API
|
|
5
|
+
Project-URL: Homepage, https://github.com/finatic/finatic-server-python
|
|
6
|
+
Project-URL: Documentation, https://docs.finatic.com/python
|
|
7
|
+
Project-URL: Repository, https://github.com/finatic/finatic-server-python
|
|
8
|
+
Project-URL: Issues, https://github.com/finatic/finatic-server-python/issues
|
|
9
|
+
Author-email: Finatic <support@finatic.dev>
|
|
10
|
+
License: MIT
|
|
11
|
+
Keywords: api,finance,finatic,sdk,trading
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: >=3.8.1
|
|
24
|
+
Requires-Dist: aiohttp-retry>=2.8.0
|
|
25
|
+
Requires-Dist: aiohttp>=3.8.0
|
|
26
|
+
Requires-Dist: cachetools>=5.3.0
|
|
27
|
+
Requires-Dist: pydantic>=2.0.0
|
|
28
|
+
Requires-Dist: python-dateutil>=2.8.0
|
|
29
|
+
Requires-Dist: structlog>=23.2.0
|
|
30
|
+
Requires-Dist: tenacity>=8.2.0
|
|
31
|
+
Requires-Dist: typing-extensions>=4.0.0
|
|
32
|
+
Requires-Dist: urllib3>=1.25.0
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: flake8>=6.0.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: isort>=5.12.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: types-cachetools>=5.3.0; extra == 'dev'
|
|
43
|
+
Requires-Dist: types-python-dateutil>=2.8.0; extra == 'dev'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# Python
|
|
47
|
+
|
|
48
|
+
Python SDK for Finatic Server API
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install @finatic/server-node
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { FinaticServer} from '@finatic/server-node';
|
|
60
|
+
|
|
61
|
+
// TODO: Add example usage
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Documentation
|
|
65
|
+
|
|
66
|
+
Full documentation is available at [docs.finatic.com](/server/typescript).
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Install dependencies
|
|
72
|
+
uv sync --dev
|
|
73
|
+
|
|
74
|
+
# Build
|
|
75
|
+
uv build
|
|
76
|
+
|
|
77
|
+
# Run tests
|
|
78
|
+
pytest
|
|
79
|
+
|
|
80
|
+
# Format code
|
|
81
|
+
black src tests
|
|
82
|
+
isort src tests
|
|
83
|
+
|
|
84
|
+
# Lint
|
|
85
|
+
flake8 src tests
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Quality Checks
|
|
89
|
+
|
|
90
|
+
Run all quality checks to ensure code quality:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Run all quality checks (format, lint, type check, import check)
|
|
94
|
+
python quality_check.py
|
|
95
|
+
# or
|
|
96
|
+
uv run python quality_check.py
|
|
97
|
+
|
|
98
|
+
# Fix all auto-fixable issues (format, import sort)
|
|
99
|
+
python quality_check.py --fix
|
|
100
|
+
# or
|
|
101
|
+
uv run python quality_check.py --fix
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Individual quality checks:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Format check (black)
|
|
108
|
+
black --check src tests
|
|
109
|
+
# Format fix (modifies files)
|
|
110
|
+
black src tests
|
|
111
|
+
|
|
112
|
+
# Import sort check
|
|
113
|
+
isort --check-only src tests
|
|
114
|
+
# Import sort fix (modifies files)
|
|
115
|
+
isort src tests
|
|
116
|
+
|
|
117
|
+
# Lint & import check (flake8)
|
|
118
|
+
flake8 src tests
|
|
119
|
+
|
|
120
|
+
# Type check (mypy)
|
|
121
|
+
mypy src
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
|
|
3
|
+
Python SDK for Finatic Server API
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @finatic/server-node
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { FinaticServer} from '@finatic/server-node';
|
|
15
|
+
|
|
16
|
+
// TODO: Add example usage
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
Full documentation is available at [docs.finatic.com](/server/typescript).
|
|
22
|
+
|
|
23
|
+
## Development
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Install dependencies
|
|
27
|
+
uv sync --dev
|
|
28
|
+
|
|
29
|
+
# Build
|
|
30
|
+
uv build
|
|
31
|
+
|
|
32
|
+
# Run tests
|
|
33
|
+
pytest
|
|
34
|
+
|
|
35
|
+
# Format code
|
|
36
|
+
black src tests
|
|
37
|
+
isort src tests
|
|
38
|
+
|
|
39
|
+
# Lint
|
|
40
|
+
flake8 src tests
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quality Checks
|
|
44
|
+
|
|
45
|
+
Run all quality checks to ensure code quality:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Run all quality checks (format, lint, type check, import check)
|
|
49
|
+
python quality_check.py
|
|
50
|
+
# or
|
|
51
|
+
uv run python quality_check.py
|
|
52
|
+
|
|
53
|
+
# Fix all auto-fixable issues (format, import sort)
|
|
54
|
+
python quality_check.py --fix
|
|
55
|
+
# or
|
|
56
|
+
uv run python quality_check.py --fix
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Individual quality checks:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Format check (black)
|
|
63
|
+
black --check src tests
|
|
64
|
+
# Format fix (modifies files)
|
|
65
|
+
black src tests
|
|
66
|
+
|
|
67
|
+
# Import sort check
|
|
68
|
+
isort --check-only src tests
|
|
69
|
+
# Import sort fix (modifies files)
|
|
70
|
+
isort src tests
|
|
71
|
+
|
|
72
|
+
# Lint & import check (flake8)
|
|
73
|
+
flake8 src tests
|
|
74
|
+
|
|
75
|
+
# Type check (mypy)
|
|
76
|
+
mypy src
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Finatic Python Server SDK Demo App
|
|
2
|
+
|
|
3
|
+
This demo application showcases the Finatic Python Server SDK with both CLI and API server capabilities.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **CLI Demo**: Interactive command-line demo (existing)
|
|
8
|
+
- **API Server**: FastAPI server that provides endpoints matching the Client SDK interface
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
1. **Install dependencies with uv** (recommended):
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
uv sync
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or with pip:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install -e .
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2. **Configure environment**:
|
|
25
|
+
```bash
|
|
26
|
+
cp env.example .env
|
|
27
|
+
# Edit .env with your FINATIC_API_KEY
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Running the API Server
|
|
31
|
+
|
|
32
|
+
The API server runs on port **8002** and provides endpoints that match the Client SDK interface.
|
|
33
|
+
|
|
34
|
+
### Development Mode
|
|
35
|
+
|
|
36
|
+
**Option 1: Using the convenience script (recommended)**:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
uv run python run_api.py
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Option 2: Direct uvicorn**:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
uv run uvicorn api_server:app --host 0.0.0.0 --port 8002 --reload
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Option 3: Direct Python**:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
uv run python api_server.py
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Production Mode
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
uv run uvicorn api_server:app --host 0.0.0.0 --port 8002
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The server will be available at `http://localhost:8002` and includes:
|
|
61
|
+
|
|
62
|
+
- CORS support for `http://localhost:3000` (Client SDK demo app)
|
|
63
|
+
- Health check endpoint at `/api/health`
|
|
64
|
+
- All Client SDK method endpoints under `/api/`
|
|
65
|
+
|
|
66
|
+
## API Endpoints
|
|
67
|
+
|
|
68
|
+
### Session Management
|
|
69
|
+
|
|
70
|
+
- `POST /api/session/start` - Start new session
|
|
71
|
+
- `POST /api/session/authenticate` - Authenticate with user ID
|
|
72
|
+
- `GET /api/session/user` - Get session user info
|
|
73
|
+
- `GET /api/session/user-id` - Get current user ID
|
|
74
|
+
- `GET /api/session/is-authed` - Check authentication status
|
|
75
|
+
|
|
76
|
+
### Broker Data
|
|
77
|
+
|
|
78
|
+
- `GET /api/broker/list` - Get available brokers
|
|
79
|
+
- `GET /api/broker/connections` - Get broker connections
|
|
80
|
+
- `GET /api/broker/accounts` - Get accounts (paginated)
|
|
81
|
+
- `GET /api/broker/accounts/all` - Get all accounts
|
|
82
|
+
- `POST /api/broker/disconnect` - Disconnect company
|
|
83
|
+
|
|
84
|
+
### Trading Data
|
|
85
|
+
|
|
86
|
+
- `GET /api/trading/orders` - Get orders (paginated)
|
|
87
|
+
- `GET /api/trading/orders/all` - Get all orders
|
|
88
|
+
- `GET /api/trading/positions` - Get positions (paginated)
|
|
89
|
+
- `GET /api/trading/positions/all` - Get all positions
|
|
90
|
+
- `GET /api/trading/balances` - Get balances (paginated)
|
|
91
|
+
- `GET /api/trading/balances/all` - Get all balances
|
|
92
|
+
|
|
93
|
+
### Trading Context
|
|
94
|
+
|
|
95
|
+
- `POST /api/trading/context/broker` - Set trading broker
|
|
96
|
+
- `POST /api/trading/context/account` - Set trading account
|
|
97
|
+
- `GET /api/trading/context` - Get trading context
|
|
98
|
+
|
|
99
|
+
### Order Management
|
|
100
|
+
|
|
101
|
+
- `POST /api/trading/order` - Place new order
|
|
102
|
+
- `POST /api/trading/order/cancel` - Cancel order
|
|
103
|
+
- `POST /api/trading/order/modify` - Modify order
|
|
104
|
+
|
|
105
|
+
## Integration with Client SDK Demo
|
|
106
|
+
|
|
107
|
+
This API server is designed to work with the Client SDK demo app's SDK switcher. When you select "Python Server SDK" in the demo app settings, it will connect to this server on port 3001.
|
|
108
|
+
|
|
109
|
+
## CLI Demo
|
|
110
|
+
|
|
111
|
+
The original CLI demo is still available:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
uv run python test_trading.py
|
|
115
|
+
```
|