Skip to content

Add rename, flatten, and head/tail commands (0.4.0) - #6

Merged
rmkr-dev merged 1 commit into
mainfrom
feat/rename-flatten-head-tail
Sep 28, 2026
Merged

rmkr-dev merged 1 commit into
mainfrom
feat/rename-flatten-head-tail

Conversation

@rmkr-dev

Copy link
Copy Markdown
Owner

Summary

Release 0.4.0 adds three shaping commands and their library helpers.

  • rename OLD NEW [OLD NEW ...] [file] renames top-level keys on an object or on each object in a list. Missing keys are left alone, non-objects pass through, and all renames apply in one pass.
  • flatten [file] turns nested objects into top-level keys joined by --sep (default .). Nested lists stay as values, an empty object stays empty, and a non-object root is returned unchanged.
  • head N [file] and tail N [file] return the first or last N items of a list. N must be a non-negative integer; a count past the end returns what exists, and 0 returns an empty list.

rename_keys, flatten_object, head_rows, and tail_rows are exported from the package. README command table, examples, and library section are updated.

Test plan

  • pytest (71 tests)

Expose reusable shape helpers and matching CLI commands for renaming top-level keys, flattening nested objects, and slicing list roots. Bump version to 0.4.0.
@rmkr-dev
rmkr-dev merged commit 294cdba into main Sep 28, 2026
2 checks passed
@rmkr-dev
rmkr-dev deleted the feat/rename-flatten-head-tail branch September 28, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant