Conversation
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Existing functions accept sync iterables/generators (+ Float64Array for OHLCV) - Add async variants resampleOhlcvAsync / resampleTicksByTimeAsync / resampleTicksByCountAsync with out-of-order healing (outOfOrderMs) - CLI: stream CSV/JSONL/NDJSON files line-by-line, incremental output, new jsonl format - Changeset (minor), README docs. Closes #9.
- New src/map.ts: OhlcvMap/TickMap (Record form: canonical field -> source key; function form: (record) => IOHLCV/TradeTick) + mapToOhlcv/mapToTick + async-iterable wrappers. Exported from index. - Library: resampleOhlcvAsync / resampleTicksByTimeAsync / resampleTicksByCountAsync gain options.map, applied to Parquet rows and object-shaped AsyncIterable items (tuples/Float64Array unaffected). - Parquet reader now reads exact canonical columns only; any other layout requires map. Removes the OHLCV/TICK alias tables and resolveColumn guessing (per user: aliasing can go now that map exists). - CLI: --map field=sourceKey flag (Record form) threads into CSV header resolution, JSON/JSONL object key remap, JSON array buffer path, and the Parquet branch. With --map a CSV first line is always the header. - Tests: parquet custom-name Record/function map + partial-map error + alias fixture now requires map; library CCXT-style Record/function map on object streams + tuple pass-through; CLI --map on CSV/JSON/parquet/pipe + invalid field. Fixtures ohlcv_custom.parquet, ticks_custom.parquet added. - README + changeset updated: map option (Record + function), CLI --map, aliasing removed.
Install footprint: 461 kB -> ~145 kB. The seven lodash helpers used (isPlainObject, sum, max, min, groupBy, sortBy, chunk) were the entire 315 kB lodash package as a runtime dep; each is now a native inline implementation (stable Array.sort, plain-object grouping, loop min/max/sum, slice-based chunking). Runtime deps are now commander + hyparquet only — we install only what we build.
… config-mutation bug; clean unknown-option errors
* feat: streaming and large-data support - Existing functions accept sync iterables/generators (+ Float64Array for OHLCV) - Add async variants resampleOhlcvAsync / resampleTicksByTimeAsync / resampleTicksByCountAsync with out-of-order healing (outOfOrderMs) - CLI: stream CSV/JSONL/NDJSON files line-by-line, incremental output, new jsonl format - Changeset (minor), README docs. Closes #9. * feat: parquet file input (async only) and ESM-only package * chore: keep require() working via CJS wrapper; downgrade to minor * Add per-record map option; drop parquet alias guessing - New src/map.ts: OhlcvMap/TickMap (Record form: canonical field -> source key; function form: (record) => IOHLCV/TradeTick) + mapToOhlcv/mapToTick + async-iterable wrappers. Exported from index. - Library: resampleOhlcvAsync / resampleTicksByTimeAsync / resampleTicksByCountAsync gain options.map, applied to Parquet rows and object-shaped AsyncIterable items (tuples/Float64Array unaffected). - Parquet reader now reads exact canonical columns only; any other layout requires map. Removes the OHLCV/TICK alias tables and resolveColumn guessing (per user: aliasing can go now that map exists). - CLI: --map field=sourceKey flag (Record form) threads into CSV header resolution, JSON/JSONL object key remap, JSON array buffer path, and the Parquet branch. With --map a CSV first line is always the header. - Tests: parquet custom-name Record/function map + partial-map error + alias fixture now requires map; library CCXT-style Record/function map on object streams + tuple pass-through; CLI --map on CSV/JSON/parquet/pipe + invalid field. Fixtures ohlcv_custom.parquet, ticks_custom.parquet added. - README + changeset updated: map option (Record + function), CLI --map, aliasing removed. * chore: exclude .js.map sourcemaps from published package (16 files, 23.8kB) * perf(deps): drop lodash dependency; implement 7 helpers natively Install footprint: 461 kB -> ~145 kB. The seven lodash helpers used (isPlainObject, sum, max, min, groupBy, sortBy, chunk) were the entire 315 kB lodash package as a runtime dep; each is now a native inline implementation (stable Array.sort, plain-object grouping, loop min/max/sum, slice-based chunking). Runtime deps are now commander + hyparquet only — we install only what we build. * perf(deps): replace commander with mri (tiny 4kB arg parser); fix mri config-mutation bug; clean unknown-option errors
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* docs: rewrite README as end-user documentation Drag the README back to an end-user pitch: remove coder narration (module format internals, dependency/roadmap notes) and present the tool in plain language for financial-data users and AI readers. Removes em dashes. Add a patch changeset. * docs: add npx quick-start option and fold install one-liner into quick start * docs: note arbitrary input schemas via map in supported formats * docs: reframe map as feed-data-as-is; condense README and cut repetition * docs: note Parquet pipe input is file-only
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Thin stdio JSON-RPC adapter over the package's own CLI (runCli in-process); no @modelcontextprotocol/sdk dependency. Single file-path tool resample_ohlcv_file. Fix streaming CSV->CSV output bug (IncrementalWriter now always writes array-shape rows). Update README tagline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a bundled, zero-dependency MCP server to the package, plus a README tagline update.
MCP server (
ohlc-resample-mcpbin)ohlc-resample-mcpbinary ships inside this same package — installohlc-resampleand get the server for free, no second publish.runCliin-process with injected streams. It has no resampling/parsing/formatting logic of its own, so every future CLI feature (formats, streaming, Parquet,--map) is inherited with zero maintenance.@modelcontextprotocol/sdkdependency — MCP is plain JSON-RPC 2.0 over stdio (initialize,tools/list,tools/call,ping), hand-rolled directly. Runtime deps stay justmri+hyparquet.resample_ohlcv_file:input_path(csv/json/jsonl/ndjson/parquet),base_timeframe,new_timeframe,format,shape, optionalmap(e.g. CCXTtimestamp/amount), optionaloutput_path. File-path-based, so the LLM pays tokens for intent, not payload.Bug fix
shaped.join is not a function:IncrementalWriterrendered object-shaped candles as CSV rows without converting to the 6-tuple shape. CSV rows are now always written in array shape regardless of the requested JSON shape.Tests / docs
dispatchdirectly) — 111 total passing.Why
MCP is the interface for AI agents to drive market-data analysis. The server is agent-facing and file-path-based, and bundling it keeps a single package/release with zero extra maintenance.
Notes
This PR is based on
devand includes the CLI/streaming/parquet/map work the MCP server depends on.