mt5api 0.2.0__tar.gz → 1.0.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.
Files changed (115) hide show
  1. mt5api-1.0.0/.agents/skills/pr-feedback-triage/SKILL.md +201 -0
  2. {mt5api-0.2.0 → mt5api-1.0.0}/.github/workflows/ci.yml +15 -0
  3. {mt5api-0.2.0 → mt5api-1.0.0}/.github/workflows/claude.yml +3 -3
  4. mt5api-1.0.0/AGENTS.md +70 -0
  5. {mt5api-0.2.0 → mt5api-1.0.0}/PKG-INFO +15 -17
  6. {mt5api-0.2.0 → mt5api-1.0.0}/README.md +12 -11
  7. {mt5api-0.2.0 → mt5api-1.0.0}/docs/api/rest-api.md +6 -5
  8. {mt5api-0.2.0 → mt5api-1.0.0}/docs/index.md +9 -8
  9. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/models.py +41 -169
  10. {mt5api-0.2.0 → mt5api-1.0.0}/pyproject.toml +3 -6
  11. {mt5api-0.2.0 → mt5api-1.0.0}/tests/mt5_constants.py +1 -1
  12. mt5api-1.0.0/tests/openapi_mt5_constants.py +34 -0
  13. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_calc.py +16 -0
  14. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_market.py +8 -6
  15. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_models.py +97 -45
  16. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_trading.py +12 -0
  17. {mt5api-0.2.0 → mt5api-1.0.0}/uv.lock +156 -383
  18. mt5api-0.2.0/.agents/skills/speckit-analyze/SKILL.md +0 -86
  19. mt5api-0.2.0/.agents/skills/speckit-checklist/SKILL.md +0 -106
  20. mt5api-0.2.0/.agents/skills/speckit-clarify/SKILL.md +0 -99
  21. mt5api-0.2.0/.agents/skills/speckit-constitution/SKILL.md +0 -89
  22. mt5api-0.2.0/.agents/skills/speckit-implement/SKILL.md +0 -78
  23. mt5api-0.2.0/.agents/skills/speckit-plan/SKILL.md +0 -71
  24. mt5api-0.2.0/.agents/skills/speckit-specify/SKILL.md +0 -75
  25. mt5api-0.2.0/.agents/skills/speckit-tasks/SKILL.md +0 -79
  26. mt5api-0.2.0/.agents/skills/speckit-taskstoissues/SKILL.md +0 -131
  27. mt5api-0.2.0/.claude/agents/codex.md +0 -986
  28. mt5api-0.2.0/.claude/agents/copilot.md +0 -1194
  29. mt5api-0.2.0/.claude/commands/speckit.analyze.md +0 -184
  30. mt5api-0.2.0/.claude/commands/speckit.checklist.md +0 -294
  31. mt5api-0.2.0/.claude/commands/speckit.clarify.md +0 -181
  32. mt5api-0.2.0/.claude/commands/speckit.constitution.md +0 -82
  33. mt5api-0.2.0/.claude/commands/speckit.implement.md +0 -135
  34. mt5api-0.2.0/.claude/commands/speckit.plan.md +0 -89
  35. mt5api-0.2.0/.claude/commands/speckit.specify.md +0 -256
  36. mt5api-0.2.0/.claude/commands/speckit.tasks.md +0 -137
  37. mt5api-0.2.0/.claude/commands/speckit.taskstoissues.md +0 -30
  38. mt5api-0.2.0/.claude/settings.json +0 -15
  39. mt5api-0.2.0/.specify/memory/constitution.md +0 -73
  40. mt5api-0.2.0/.specify/scripts/bash/check-prerequisites.sh +0 -166
  41. mt5api-0.2.0/.specify/scripts/bash/common.sh +0 -156
  42. mt5api-0.2.0/.specify/scripts/bash/create-new-feature.sh +0 -297
  43. mt5api-0.2.0/.specify/scripts/bash/setup-plan.sh +0 -61
  44. mt5api-0.2.0/.specify/scripts/bash/update-agent-context.sh +0 -799
  45. mt5api-0.2.0/.specify/templates/agent-file-template.md +0 -28
  46. mt5api-0.2.0/.specify/templates/checklist-template.md +0 -40
  47. mt5api-0.2.0/.specify/templates/plan-template.md +0 -105
  48. mt5api-0.2.0/.specify/templates/spec-template.md +0 -115
  49. mt5api-0.2.0/.specify/templates/tasks-template.md +0 -250
  50. mt5api-0.2.0/AGENTS.md +0 -92
  51. mt5api-0.2.0/specs/041-mt5-rest-api/contracts/openapi.yaml +0 -622
  52. mt5api-0.2.0/specs/041-mt5-rest-api/data-model.md +0 -583
  53. mt5api-0.2.0/specs/041-mt5-rest-api/plan.md +0 -373
  54. mt5api-0.2.0/specs/041-mt5-rest-api/quickstart.md +0 -651
  55. mt5api-0.2.0/specs/041-mt5-rest-api/research.md +0 -689
  56. mt5api-0.2.0/specs/041-mt5-rest-api/spec.md +0 -181
  57. mt5api-0.2.0/specs/041-mt5-rest-api/tasks.md +0 -318
  58. mt5api-0.2.0/specs/042-mt5-core-client/spec.md +0 -97
  59. mt5api-0.2.0/specs/043-mt5-dataframe-client/spec.md +0 -96
  60. mt5api-0.2.0/specs/044-mt5-trading-client/spec.md +0 -94
  61. mt5api-0.2.0/specs/045-mt5-utils/spec.md +0 -90
  62. mt5api-0.2.0/specs/046-mt5-api-service/spec.md +0 -104
  63. mt5api-0.2.0/specs/047-api-auth-rate-limit/spec.md +0 -93
  64. mt5api-0.2.0/specs/048-api-response-format/spec.md +0 -93
  65. mt5api-0.2.0/specs/049-api-routing-models/spec.md +0 -91
  66. mt5api-0.2.0/specs/050-api-runtime-deploy/spec.md +0 -90
  67. mt5api-0.2.0/specs/051-api-error-logging/spec.md +0 -91
  68. mt5api-0.2.0/specs/052-api-dependencies/spec.md +0 -93
  69. {mt5api-0.2.0 → mt5api-1.0.0}/.agents/skills/local-qa/SKILL.md +0 -0
  70. {mt5api-0.2.0 → mt5api-1.0.0}/.agents/skills/local-qa/scripts/qa.sh +0 -0
  71. {mt5api-0.2.0 → mt5api-1.0.0}/.agents/skills/mt5api/SKILL.md +0 -0
  72. {mt5api-0.2.0 → mt5api-1.0.0}/.github/FUNDING.yml +0 -0
  73. {mt5api-0.2.0 → mt5api-1.0.0}/.github/dependabot.yml +0 -0
  74. {mt5api-0.2.0 → mt5api-1.0.0}/.github/renovate.json +0 -0
  75. {mt5api-0.2.0 → mt5api-1.0.0}/.github/workflows/release.yml +0 -0
  76. {mt5api-0.2.0 → mt5api-1.0.0}/.gitignore +0 -0
  77. {mt5api-0.2.0 → mt5api-1.0.0}/CLAUDE.md +0 -0
  78. {mt5api-0.2.0 → mt5api-1.0.0}/LICENSE +0 -0
  79. {mt5api-0.2.0 → mt5api-1.0.0}/docs/api/deployment.md +0 -0
  80. {mt5api-0.2.0 → mt5api-1.0.0}/docs/api/index.md +0 -0
  81. {mt5api-0.2.0 → mt5api-1.0.0}/mkdocs.yml +0 -0
  82. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/__init__.py +0 -0
  83. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/__main__.py +0 -0
  84. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/auth.py +0 -0
  85. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/config.py +0 -0
  86. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/constants.py +0 -0
  87. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/dependencies.py +0 -0
  88. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/formatters.py +0 -0
  89. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/main.py +0 -0
  90. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/middleware.py +0 -0
  91. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/__init__.py +0 -0
  92. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/account.py +0 -0
  93. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/calc.py +0 -0
  94. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/connection.py +0 -0
  95. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/health.py +0 -0
  96. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/history.py +0 -0
  97. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/market.py +0 -0
  98. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/symbols.py +0 -0
  99. {mt5api-0.2.0 → mt5api-1.0.0}/mt5api/routers/trading.py +0 -0
  100. {mt5api-0.2.0 → mt5api-1.0.0}/tests/__init__.py +0 -0
  101. {mt5api-0.2.0 → mt5api-1.0.0}/tests/conftest.py +0 -0
  102. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_account.py +0 -0
  103. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_auth.py +0 -0
  104. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_cli.py +0 -0
  105. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_config.py +0 -0
  106. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_connection.py +0 -0
  107. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_dependencies.py +0 -0
  108. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_formatters.py +0 -0
  109. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_health.py +0 -0
  110. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_history.py +0 -0
  111. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_integration.py +0 -0
  112. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_lifespan.py +0 -0
  113. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_main.py +0 -0
  114. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_middleware.py +0 -0
  115. {mt5api-0.2.0 → mt5api-1.0.0}/tests/test_symbols.py +0 -0
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: pr-feedback-triage
3
+ description: Triage pull request review comments into fixes, replies, clarification requests, or open follow-ups while respecting safe execution modes.
4
+ ---
5
+
6
+ # PR Feedback Triage
7
+
8
+ Triage pull request review feedback, decide what action each thread needs, make focused fixes when allowed, and report or resolve only what is actually handled.
9
+
10
+ ## When to Use
11
+
12
+ - A PR has review comments, requested changes, unresolved review threads, or bot review findings.
13
+ - The user asks to address, respond to, or resolve PR feedback.
14
+ - The user provides a PR URL/number, a branch with an associated PR, or copied comments.
15
+
16
+ Do not use this skill for a first-pass code review with no existing feedback; use a code review skill instead.
17
+
18
+ ## Inputs
19
+
20
+ - Pull request URL or number, or a current branch that has an associated pull request.
21
+ - Repository checkout or platform access sufficient to inspect the PR diff and review feedback.
22
+ - Optional reviewer priorities from the user, such as "only address blocking comments" or "do not reply on the PR platform".
23
+ - Optional operating mode flags: `dry_run`, `no_push`, and `no_reply`.
24
+
25
+ If no PR or review comments are identifiable, ask for the target PR or the copied comments before proceeding.
26
+
27
+ ## Modes
28
+
29
+ - `dry_run`: inspect review feedback and report the triage only. Do not edit files, run write-mode formatters, commit, push, post replies, or resolve review threads.
30
+ - `no_push`: local edits and verification are allowed, but do not push commits or otherwise update the remote branch. Report the local diff or local commits that still need to be pushed. Do not resolve threads whose resolution depends on unpushed local edits.
31
+ - `no_reply`: do not post replies, submit reviews, or resolve review threads. Provide suggested replies and resolution actions in the final report instead.
32
+
33
+ When a mode disables an action, skip that destructive or externally visible action even if normal workflow text would otherwise allow it.
34
+
35
+ ## Preflight
36
+
37
+ 1. Identify the current branch and target PR.
38
+ 2. Check tracked local changes with `git diff --name-only` and `git diff --cached --name-only`. Ignore untracked files unless the review feedback explicitly concerns them.
39
+ 3. Check unpushed commits before relying on remote review feedback.
40
+ 4. If tracked local changes or unpushed commits exist, warn that existing PR comments may not cover the latest local state. In `normal` mode, push only when the user request or repository workflow allows it; otherwise continue with a clearly reported limitation.
41
+
42
+ ## Feedback Collection
43
+
44
+ Gather the complete feedback set before editing:
45
+
46
+ - Fetch unresolved review threads, requested-change reviews, PR-level summary comments, and copied comments.
47
+ - Use platform-native APIs/CLI when available. Paginate results; do not inspect only the first page of threads or comments.
48
+ - For bot reviewers that post both summary comments and inline comments, collect both. Summary comments often contain severity, rationale, and fix instructions; inline comments contain the exact file and line context.
49
+ - Preserve every thread/comment identifier needed to reply or resolve later.
50
+ - Compare each comment with the current diff and file contents because review lines can become outdated.
51
+
52
+ ## Deduplication and Ordering
53
+
54
+ Build one triage record per distinct finding:
55
+
56
+ - Prefer exact review-thread identity when available.
57
+ - For duplicate bot findings appearing in both summary and inline comments, merge by exact issue title first, then by file path plus line range as a fallback.
58
+ - Prefer inline comments for location and current code context.
59
+ - Prefer summary comments for severity, category, rationale, and detailed agent prompts.
60
+ - Preserve the reviewer’s exact issue title and original wording where practical. Do not rename findings in a way that would make replies hard to map back to comments.
61
+ - Preserve the reviewer’s original ordering unless the user asks for priority reordering. Many review bots already order findings by severity.
62
+
63
+ Each triage record should track: original title, reviewer, source IDs, location, current applicability, severity/priority if available, disposition, planned action, verification, reply text if any, resolution decision, platform action attempted, and final platform state.
64
+
65
+ ## Resolution Policy
66
+
67
+ In normal mode, `Resolve conversation` is the default action for any review thread that has been fully handled. A thread is handled when the requested change is implemented and verified, the current code already satisfies the comment, the comment is outdated and no longer applies, or a deliberate deferral/won't-fix response has been posted with a clear reason.
68
+
69
+ Keep a thread open only when it still needs reviewer, maintainer, or product input, the fix is local-only and not pushed, verification is missing for a material change, or the user explicitly requested `dry_run`, `no_push`, or `no_reply` behavior that prevents resolution.
70
+
71
+ When resolving a thread, add a concise reply first only if it provides useful context, such as what changed, why no code change was needed, why a finding was intentionally deferred, or why the original comment is now outdated. Do not add noisy replies for self-evident fixes unless project norms require them.
72
+
73
+ ## Platform Action Contract
74
+
75
+ Do not treat triage as complete until every collected source ID reaches an explicit terminal state:
76
+
77
+ - `resolved`: a platform resolve action succeeded, or a re-check shows the thread is already resolved.
78
+ - `replied_left_open`: a reply or question was posted and the thread is intentionally left unresolved.
79
+ - `not_resolvable`: the source is a PR-level summary comment or copied comment that has no platform-level resolve action; reply or post a PR summary when useful.
80
+ - `skipped_by_mode`: `dry_run`, `no_push`, or `no_reply` prevented the external action.
81
+ - `failed_action`: a reply or resolve action was attempted and failed; include the attempted action and failure in the final summary.
82
+
83
+ In normal mode, build and execute a platform action queue after fixes are verified and pushed when needed:
84
+
85
+ - `reply_then_resolve`: use for handled threads where the reviewer needs context before resolution.
86
+ - `resolve_only`: use for self-evident fixes and already-addressed or outdated threads where an extra reply would add noise.
87
+ - `reply_leave_open`: use only for clarification requests, blocked work, or intentionally open follow-ups.
88
+ - `reply_only`: use for PR-level comments or summaries that cannot be resolved as review threads.
89
+
90
+ For duplicate findings, execute the terminal action for every source thread ID, not only the primary triage record. If one finding is represented by three unresolved inline threads, all three must be resolved or explicitly left open.
91
+
92
+ ## GitHub Action Guidance
93
+
94
+ Prefer platform-native APIs or `gh` commands that expose review-thread resolution state. For GitHub inline review threads, use the thread node ID and the GraphQL `resolveReviewThread` mutation rather than assuming that a reply resolves the conversation.
95
+
96
+ A reliable pattern is:
97
+
98
+ 1. Re-fetch review threads and comments immediately before acting.
99
+ 2. Reply to the thread when the action queue says a reply is needed.
100
+ 3. Resolve the review thread by node ID when the terminal state should be `resolved`.
101
+ 4. Re-fetch unresolved review threads after the action queue completes.
102
+ 5. Retry any expected-to-be-resolved thread that is still unresolved once; if it still remains unresolved, mark it `failed_action` instead of claiming completion.
103
+
104
+ Example GraphQL mutation shape:
105
+
106
+ ```graphql
107
+ mutation ($threadId: ID!) {
108
+ resolveReviewThread(input: { threadId: $threadId }) {
109
+ thread {
110
+ id
111
+ isResolved
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ A posted reply alone is sufficient only for `reply_leave_open`, `reply_only`, or `not_resolvable` sources. For handled inline review threads, reply and resolve are separate actions.
118
+
119
+ ## Flow
120
+
121
+ ```mermaid
122
+ flowchart TD
123
+ A[Identify PR and branch state] --> B[Collect all review feedback]
124
+ B --> C[Deduplicate and preserve source IDs]
125
+ C --> D[Inspect current diff and code]
126
+ D --> E{Classify each triage record}
127
+ E -->|Fix| F[Implement minimal change]
128
+ E -->|Answer| G[Prepare concise reply]
129
+ E -->|Clarify| H[Prepare question and leave open]
130
+ E -->|Already addressed or Outdated| I[Prepare evidence]
131
+ E -->|Defer or Won't fix| J[Document reason]
132
+ F --> K[Verify]
133
+ G --> L{Mode}
134
+ H --> L
135
+ I --> L
136
+ J --> L
137
+ K --> L
138
+ L -->|dry_run| M[Report triage only]
139
+ L -->|no_push| N[Report local diff or commits]
140
+ L -->|no_reply| O[Report suggested replies/actions]
141
+ L -->|normal| P[Commit/push if changed]
142
+ P --> R[Execute reply/resolve action queue]
143
+ R --> S[Re-fetch threads and retry unresolved handled threads once]
144
+ M --> Q[Final summary]
145
+ N --> Q
146
+ O --> Q
147
+ S --> Q
148
+ ```
149
+
150
+ ## Compact Workflow
151
+
152
+ 1. **Collect all relevant feedback**
153
+ - Identify the PR and gather unresolved review threads, requested-change reviews, PR-level summaries, inline comments, and copied comments.
154
+ - Paginate all platform calls and keep comment/thread IDs for later replies and resolution.
155
+ - For bot reviews, collect both summary and inline comments, then merge duplicates rather than fixing the same finding twice.
156
+
157
+ 2. **Classify each triage record**
158
+ - **Fix**: Valid requested change; make the smallest focused edit when not in `dry_run`.
159
+ - **Answer**: No code change needed; prepare a concise explanation.
160
+ - **Clarify**: Ambiguous, conflicting, or missing context; reply with the question and leave unresolved.
161
+ - **Already addressed**: Current code already satisfies it; prepare evidence.
162
+ - **Outdated**: Commented code or issue no longer exists; prepare evidence.
163
+ - **Defer / Won't fix**: Valid concern intentionally not changed now; document a specific reason.
164
+
165
+ 3. **Act according to the classification and mode**
166
+ - Keep edits scoped to the review feedback.
167
+ - Follow reviewer-provided fix instructions literally when they are still applicable; deviate only when the current code proves the instruction is stale or unsafe.
168
+ - In `dry_run`, stop at triage, proposed fixes, suggested replies, and verification plan.
169
+ - In `no_push`, local edits are allowed, but do not push or resolve threads whose fix is only local. Reply or resolve non-code, already-addressed, or outdated threads only when the action does not depend on unpushed work and `no_reply` is not set.
170
+ - In `no_reply`, do not post replies or resolve threads; report suggested replies/actions instead.
171
+ - In normal mode, commit and push changed code when appropriate, then execute the platform action queue for every collected source ID.
172
+
173
+ 4. **Verify before claiming completion**
174
+ - For fixes, run appropriate checks or explain why they could not run.
175
+ - Re-inspect the updated diff and comment context to confirm the concern is resolved.
176
+ - Re-fetch review threads after reply/resolve actions and confirm all expected-to-be-resolved thread IDs are resolved.
177
+ - Do not mark a thread resolved if it still needs reviewer, maintainer, or product input.
178
+ - If a resolve or reply operation fails, retry once when safe; then report `failed_action` with the affected source ID and reason.
179
+
180
+ 5. **Finish**
181
+ - Normal mode: commit/push changes when appropriate, post useful replies or a summary, resolve all handled threads by default, and reconcile the final unresolved set.
182
+ - Safe modes: report the local state and the exact replies/resolution actions a human could take.
183
+
184
+ ## Reply Guidance
185
+
186
+ - Keep inline replies short and tied to the original title or concern.
187
+ - For fixed findings, mention the concrete change or commit if useful.
188
+ - For already-addressed or outdated findings, cite the current code path or behavior that makes the finding no longer applicable.
189
+ - For deferred or won't-fix findings, provide the reason and any follow-up issue or owner if known.
190
+ - If a reply or resolve operation fails, continue with the remaining threads and report the failure in the final summary.
191
+
192
+ ## Final Summary Checklist
193
+
194
+ - Mode used: `normal`, `dry_run`, `no_push`, or `no_reply`
195
+ - Counts by disposition: fixed, answered, clarified/left open, already addressed, outdated, deferred/won't-fix
196
+ - Counts by platform terminal state: resolved, replied-left-open, not-resolvable, skipped-by-mode, failed-action
197
+ - Threads resolved, intentionally left open, already resolved, or resolution actions skipped by mode
198
+ - Any expected-to-be-resolved thread that remained unresolved after retry
199
+ - Verification run or planned
200
+ - Commits pushed, local diff/commits, or "none"
201
+ - Remaining open items and who needs to respond
@@ -62,6 +62,19 @@ jobs:
62
62
  runs-on: ubuntu-slim
63
63
  secrets:
64
64
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65
+ github-codeql-analysis:
66
+ if: >
67
+ github.event_name == 'push'
68
+ || github.event_name == 'pull_request'
69
+ || (github.event_name == 'workflow_dispatch' && inputs.workflow == 'lint-and-test')
70
+ permissions:
71
+ contents: read
72
+ security-events: write
73
+ actions: read
74
+ uses: dceoy/gh-actions-for-devops/.github/workflows/github-codeql-analysis.yml@main # zizmor: ignore[unpinned-uses]
75
+ with:
76
+ language: >
77
+ ["python"]
65
78
  dependabot-auto-merge:
66
79
  if: >
67
80
  github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
@@ -73,5 +86,7 @@ jobs:
73
86
  contents: write
74
87
  pull-requests: write
75
88
  actions: read
89
+ checks: read
90
+ statuses: read
76
91
  with:
77
92
  unconditional: true
@@ -26,7 +26,7 @@ jobs:
26
26
  claude-code-review:
27
27
  if: >
28
28
  github.event_name == 'pull_request'
29
- && github.event.pull_request.draft == false
29
+ && (! github.event.pull_request.draft)
30
30
  && (! startsWith(github.head_ref, 'dependabot/'))
31
31
  && (! startsWith(github.head_ref, 'renovate/'))
32
32
  permissions:
@@ -37,7 +37,7 @@ jobs:
37
37
  actions: read
38
38
  uses: dceoy/gh-actions-for-devops/.github/workflows/claude-code-review.yml@main # zizmor: ignore[unpinned-uses]
39
39
  secrets:
40
- CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} # zizmor: ignore[secrets-outside-env]
40
+ CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} # zizmor: ignore[secrets-outside-env]
41
41
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42
42
  claude-code-bot:
43
43
  if: >
@@ -53,5 +53,5 @@ jobs:
53
53
  actions: read
54
54
  uses: dceoy/gh-actions-for-devops/.github/workflows/claude-code-bot.yml@main # zizmor: ignore[unpinned-uses]
55
55
  secrets:
56
- CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} # zizmor: ignore[secrets-outside-env]
56
+ CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} # zizmor: ignore[secrets-outside-env]
57
57
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
mt5api-1.0.0/AGENTS.md ADDED
@@ -0,0 +1,70 @@
1
+ # Repository Guidelines
2
+
3
+ ## Project Structure & Module Organization
4
+
5
+ `mt5api/` contains the FastAPI application. Core app setup lives in `main.py`,
6
+ configuration and security in `config.py` and `auth.py`, shared request
7
+ dependencies in `dependencies.py`, middleware in `middleware.py`, response
8
+ serialization in `formatters.py`, and Pydantic/data models in `models.py`.
9
+ Endpoint modules are grouped under `mt5api/routers/` by domain, such as
10
+ `market.py`, `symbols.py`, `account.py`, and `trading.py`. Tests live in
11
+ `tests/` and mirror the package domains with `test_*.py` files. Documentation is
12
+ in `docs/`, with MkDocs configured by `mkdocs.yml`; local agent skills are under
13
+ `skills/`.
14
+
15
+ ## Build, Test, and Development Commands
16
+
17
+ - `uv sync --group dev`: install runtime and development dependencies.
18
+ - `uv run python -m mt5api`: start the API using environment configuration.
19
+ - `uv run uvicorn mt5api.main:app --host 0.0.0.0 --port 8000`: run the app
20
+ directly for local API testing.
21
+ - `uv run pytest`: run the full test suite with coverage settings from
22
+ `pyproject.toml`.
23
+ - `uv run ruff check .` and `uv run ruff format --check .`: lint and verify
24
+ formatting.
25
+ - `uv run pyright`: run strict static type checking.
26
+ - `uv run mkdocs serve`: preview documentation locally.
27
+ - `.agents/skills/local-qa/scripts/qa.sh`: run the repository QA workflow after
28
+ any file update. This wraps formatting, linting, type checks, tests, Markdown
29
+ formatting, and workflow/security checks.
30
+
31
+ The API server runtime requires Windows with MetaTrader 5 installed and logged
32
+ in. Non-Windows systems are suitable for editing docs and most mocked tests.
33
+
34
+ ## Coding Style & Naming Conventions
35
+
36
+ Target Python 3.11+. Use Ruff formatting with an 88-character line length and
37
+ Google-style docstrings. Keep type annotations complete; Pyright runs in strict
38
+ mode. Use `snake_case` for functions, variables, and modules; `PascalCase` for
39
+ classes and Pydantic models; and uppercase names for constants.
40
+
41
+ ## Testing Guidelines
42
+
43
+ Pytest discovers `tests/test_*.py`, `*_test.py`, `Test*` classes, and `test_*`
44
+ functions. Coverage is branch-aware and configured to fail below 100%, so add or
45
+ adjust focused tests with each behavior change. Prefer mocked MT5/pdmt5
46
+ interactions unless a test explicitly requires a Windows MT5 terminal.
47
+
48
+ ## Design Principles
49
+
50
+ Apply KISS, DRY, and YAGNI when changing code. Prefer the simplest direct
51
+ implementation that satisfies the current requirement. Remove duplication when
52
+ it improves clarity or prevents drift, but avoid abstractions that do not serve
53
+ an immediate need. Keep changes small, focused, and easy to review.
54
+
55
+ ## Commit & Pull Request Guidelines
56
+
57
+ History uses short imperative subjects and occasional Conventional Commit
58
+ prefixes, for example `refactor: delegate MT5 constant parsing...` or
59
+ `Add checks and statuses read permissions...`. Keep commits scoped to one
60
+ logical change. Before committing or opening a PR, run
61
+ `.agents/skills/local-qa/scripts/qa.sh`. Pull requests should describe the
62
+ behavior change, list verification commands, link related issues when
63
+ applicable, and call out any runtime impact for Windows/MT5 users.
64
+
65
+ ## Security & Configuration Tips
66
+
67
+ Do not commit credentials, terminal account details, or real API keys. Configure
68
+ runtime values through environment variables such as `MT5API_SECRET_KEY`,
69
+ `MT5API_ROUTER_PREFIX`, `MT5API_HOST`, `MT5API_PORT`, and
70
+ `MT5API_LOG_LEVEL`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mt5api
3
- Version: 0.2.0
3
+ Version: 1.0.0
4
4
  Summary: MetaTrader 5 REST API
5
5
  Project-URL: Repository, https://github.com/dceoy/mt5api.git
6
6
  Author-email: dceoy <dceoy@users.noreply.github.com>
@@ -18,12 +18,9 @@ Classifier: Topic :: Office/Business :: Financial :: Investment
18
18
  Requires-Python: <3.14,>=3.11
19
19
  Requires-Dist: fastapi>=0.115.0
20
20
  Requires-Dist: httpx>=0.27.0
21
- Requires-Dist: metatrader5>=5.0.4424; sys_platform == 'win32'
22
- Requires-Dist: passlib[bcrypt]>=1.7.4
23
- Requires-Dist: pdmt5>=0.2.1
21
+ Requires-Dist: pdmt5>=1.0.1
24
22
  Requires-Dist: pyarrow>=18.0.0
25
- Requires-Dist: python-jose[cryptography]>=3.3.0
26
- Requires-Dist: python-multipart>=0.0.9
23
+ Requires-Dist: python-multipart>=0.0.31
27
24
  Requires-Dist: uvicorn[standard]>=0.32.0
28
25
  Description-Content-Type: text/markdown
29
26
 
@@ -34,14 +31,15 @@ MetaTrader 5 REST API
34
31
  [![CI/CD](https://github.com/dceoy/mt5api/actions/workflows/ci.yml/badge.svg)](https://github.com/dceoy/mt5api/actions/workflows/ci.yml)
35
32
 
36
33
  mt5api exposes MT5 market data, account info, trading history, and trading
37
- operations over HTTP. It uses the [`pdmt5`](https://github.com/dceoy/pdmt5)
38
- client internally and adds optional API-key auth and JSON/Parquet response
39
- formatting.
34
+ operations over HTTP. It is a FastAPI/HTTP adapter over
35
+ [`pdmt5`](https://github.com/dceoy/pdmt5), which provides the core MT5 client,
36
+ dataframe/trading primitives, and canonical MT5 constant parsing. mt5api adds
37
+ optional API-key auth and JSON/Parquet response formatting.
40
38
 
41
- The API server must run on Windows. The `MetaTrader5` Python package used by
42
- `pdmt5` is supported only on Windows, so you must host `mt5api` on a Windows
43
- machine with a logged-in MetaTrader 5 terminal. HTTP clients can connect from
44
- any operating system.
39
+ The API server must run on Windows. pdmt5 connects through the MetaTrader 5
40
+ Python API, which is supported only on Windows, so you must host `mt5api` on a
41
+ Windows machine with a logged-in MetaTrader 5 terminal. HTTP clients can connect
42
+ from any operating system.
45
43
 
46
44
  ## Architecture
47
45
 
@@ -61,7 +59,7 @@ graph TB
61
59
  Formatters --> Middleware
62
60
  end
63
61
 
64
- Deps --> pdmt5["pdmt5<br/>MT5 Client Library"]
62
+ Deps --> pdmt5["pdmt5<br/>MT5 Client · Constants · Dataframes"]
65
63
  pdmt5 --> MT5["MetaTrader 5<br/>Terminal"]
66
64
  end
67
65
 
@@ -162,9 +160,9 @@ curl -H "X-API-Key: your-secret-api-key" "http://windows-host:8000/symbols?group
162
160
  curl -H "X-API-Key: your-secret-api-key" -H "Accept: application/parquet" "http://windows-host:8000/rates/from?symbol=EURUSD&timeframe=TIMEFRAME_M1&date_from=2024-01-01T00:00:00Z&count=100"
163
161
  ```
164
162
 
165
- Market-data and calculation endpoints accept MetaTrader 5 constants either by
166
- official name (`TIMEFRAME_M1`, `COPY_TICKS_ALL`, `ORDER_TYPE_BUY`) or by their
167
- integer value.
163
+ Market-data and calculation endpoints accept MetaTrader 5 constants by official
164
+ name (`TIMEFRAME_M1`, `COPY_TICKS_ALL`, `ORDER_TYPE_BUY`), short alias (`M1`,
165
+ `ALL`, `BUY`), or integer value.
168
166
 
169
167
  ## Endpoints
170
168
 
@@ -5,14 +5,15 @@ MetaTrader 5 REST API
5
5
  [![CI/CD](https://github.com/dceoy/mt5api/actions/workflows/ci.yml/badge.svg)](https://github.com/dceoy/mt5api/actions/workflows/ci.yml)
6
6
 
7
7
  mt5api exposes MT5 market data, account info, trading history, and trading
8
- operations over HTTP. It uses the [`pdmt5`](https://github.com/dceoy/pdmt5)
9
- client internally and adds optional API-key auth and JSON/Parquet response
10
- formatting.
8
+ operations over HTTP. It is a FastAPI/HTTP adapter over
9
+ [`pdmt5`](https://github.com/dceoy/pdmt5), which provides the core MT5 client,
10
+ dataframe/trading primitives, and canonical MT5 constant parsing. mt5api adds
11
+ optional API-key auth and JSON/Parquet response formatting.
11
12
 
12
- The API server must run on Windows. The `MetaTrader5` Python package used by
13
- `pdmt5` is supported only on Windows, so you must host `mt5api` on a Windows
14
- machine with a logged-in MetaTrader 5 terminal. HTTP clients can connect from
15
- any operating system.
13
+ The API server must run on Windows. pdmt5 connects through the MetaTrader 5
14
+ Python API, which is supported only on Windows, so you must host `mt5api` on a
15
+ Windows machine with a logged-in MetaTrader 5 terminal. HTTP clients can connect
16
+ from any operating system.
16
17
 
17
18
  ## Architecture
18
19
 
@@ -32,7 +33,7 @@ graph TB
32
33
  Formatters --> Middleware
33
34
  end
34
35
 
35
- Deps --> pdmt5["pdmt5<br/>MT5 Client Library"]
36
+ Deps --> pdmt5["pdmt5<br/>MT5 Client · Constants · Dataframes"]
36
37
  pdmt5 --> MT5["MetaTrader 5<br/>Terminal"]
37
38
  end
38
39
 
@@ -133,9 +134,9 @@ curl -H "X-API-Key: your-secret-api-key" "http://windows-host:8000/symbols?group
133
134
  curl -H "X-API-Key: your-secret-api-key" -H "Accept: application/parquet" "http://windows-host:8000/rates/from?symbol=EURUSD&timeframe=TIMEFRAME_M1&date_from=2024-01-01T00:00:00Z&count=100"
134
135
  ```
135
136
 
136
- Market-data and calculation endpoints accept MetaTrader 5 constants either by
137
- official name (`TIMEFRAME_M1`, `COPY_TICKS_ALL`, `ORDER_TYPE_BUY`) or by their
138
- integer value.
137
+ Market-data and calculation endpoints accept MetaTrader 5 constants by official
138
+ name (`TIMEFRAME_M1`, `COPY_TICKS_ALL`, `ORDER_TYPE_BUY`), short alias (`M1`,
139
+ `ALL`, `BUY`), or integer value.
139
140
 
140
141
  ## Endpoints
141
142
 
@@ -108,9 +108,9 @@ If `MT5API_ROUTER_PREFIX` is configured, prepend it to each API route below.
108
108
 
109
109
  ### Market Data
110
110
 
111
- - `timeframe` and `flags` accept either the official MetaTrader 5 constant
112
- name (for example `TIMEFRAME_M1`, `COPY_TICKS_ALL`) or the equivalent integer
113
- value.
111
+ - `timeframe` and `flags` accept the official MetaTrader 5 constant name (for
112
+ example `TIMEFRAME_M1`, `COPY_TICKS_ALL`), a short alias (for example `M1`,
113
+ `ALL`), or the equivalent integer value.
114
114
  - `GET /rates/from` (`symbol`, `timeframe`, `date_from`, `count`, `format`)
115
115
  - `GET /rates/from-pos` (`symbol`, `timeframe`, `start_pos`, `count`, `format`)
116
116
  - `GET /rates/range` (`symbol`, `timeframe`, `date_from`, `date_to`, `format`)
@@ -122,8 +122,9 @@ If `MT5API_ROUTER_PREFIX` is configured, prepend it to each API route below.
122
122
 
123
123
  ### Calculations
124
124
 
125
- - `action` accepts either the official MetaTrader 5 constant name (for example
126
- `ORDER_TYPE_BUY`) or the equivalent integer value.
125
+ - `action` accepts the official MetaTrader 5 constant name (for example
126
+ `ORDER_TYPE_BUY`), a short alias (for example `BUY`), or the equivalent
127
+ integer value.
127
128
  - `GET /calc/margin` (`action`, `symbol`, `volume`, `price`, `format`) —
128
129
  Calculate required margin in account currency
129
130
  - `GET /calc/profit` (`action`, `symbol`, `volume`, `price_open`,
@@ -5,14 +5,15 @@ trading operations.
5
5
 
6
6
  ## Overview
7
7
 
8
- mt5api exposes MT5 data and trading operations over HTTP using FastAPI. It
9
- relies on the underlying MT5 client library for connectivity and adds optional
10
- authentication and response formatting suitable for analytics
11
- workflows.
12
-
13
- The API server must run on Windows because the `MetaTrader5` Python package is
14
- Windows-only. Run `mt5api` on a Windows host with MetaTrader 5 installed and
15
- logged in. API clients can connect from any operating system.
8
+ mt5api is a FastAPI/HTTP adapter over
9
+ [`pdmt5`](https://github.com/dceoy/pdmt5). pdmt5 provides the core MT5 client,
10
+ dataframe/trading primitives, and canonical MT5 constant parsing. mt5api adds
11
+ optional authentication, response formatting, and OpenAPI documentation.
12
+
13
+ The API server must run on Windows because pdmt5 connects through the MetaTrader
14
+ 5 Python API, which is Windows-only. Run `mt5api` on a Windows host with
15
+ MetaTrader 5 installed and logged in. API clients can connect from any operating
16
+ system.
16
17
 
17
18
  ## Features
18
19