headson 0.6.2__cp310-abi3-win_amd64.whl → 0.6.4__cp310-abi3-win_amd64.whl
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.
Potentially problematic release.
This version of headson might be problematic. Click here for more details.
headson/headson.pyd
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: headson
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Classifier: Programming Language :: Python
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: Programming Language :: Rust
|
|
@@ -20,12 +20,15 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
|
20
20
|
<br/>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
`heal`/`tail` for JSON, YAML - but structure‑aware. Get a compact preview that shows both the shape and representative values of your data, all within a strict character budget. (Just like `head`/`tail`, `headson` can also work with unstructured text files.)
|
|
24
24
|
|
|
25
25
|
Available as:
|
|
26
26
|
- CLI (see [Usage](#usage))
|
|
27
27
|
- Python library (see [Python Bindings](#python-bindings))
|
|
28
28
|
|
|
29
|
+
  
|
|
30
|
+
|
|
31
|
+
|
|
29
32
|
## Install
|
|
30
33
|
|
|
31
34
|
Using Cargo:
|
|
@@ -41,10 +44,11 @@ From source:
|
|
|
41
44
|
## Features
|
|
42
45
|
|
|
43
46
|
- Budgeted output: specify exactly how much you want to see
|
|
44
|
-
- Output formats: `auto | json | yaml`
|
|
47
|
+
- Output formats: `auto | json | yaml | text`
|
|
45
48
|
- Styles: `strict | default | detailed`
|
|
46
49
|
- JSON family: `strict` → strict JSON, `default` → human‑friendly Pseudo, `detailed` → JS with inline comments
|
|
47
50
|
- YAML: always YAML; `strict` has no comments, `default` uses “# …”, `detailed` uses “# N more …”
|
|
51
|
+
- Text: prints raw lines. In `default` style, omissions are shown as a single line `…`; in `detailed`, as `… N more lines …`. `strict` omits array‑level summaries.
|
|
48
52
|
- Multiple inputs: preview many files at once with a shared or per‑file budget
|
|
49
53
|
- Fast: processes gigabyte‑scale files in seconds (mostly disk‑bound)
|
|
50
54
|
- Available as a CLI app and as a Python library
|
|
@@ -66,14 +70,14 @@ If you’re comfortable with tools like `head` and `tail`, use `headson` when yo
|
|
|
66
70
|
|
|
67
71
|
Common flags:
|
|
68
72
|
|
|
69
|
-
- `-
|
|
70
|
-
- `-
|
|
71
|
-
- `-f, --format <auto|json|yaml>`: output format (default: `auto`).
|
|
72
|
-
- Auto: stdin → JSON family; filesets → per‑file based on extension (`.json` → JSON family, `.yaml`/`.yml` → YAML).
|
|
73
|
+
- `-c, --bytes <BYTES>`: per‑file output budget. For multiple inputs, default total budget is `<BYTES> * number_of_inputs`.
|
|
74
|
+
- `-C, --global-bytes <BYTES>`: total output budget across all inputs. With `--bytes`, the effective total is the smaller of the two.
|
|
75
|
+
- `-f, --format <auto|json|yaml|text>`: output format (default: `auto`).
|
|
76
|
+
- Auto: stdin → JSON family; filesets → per‑file based on extension (`.json` → JSON family, `.yaml`/`.yml` → YAML, unknown → Text).
|
|
73
77
|
- `-t, --template <strict|default|detailed>`: output style (default: `default`).
|
|
74
78
|
- JSON family: `strict` → strict JSON; `default` → Pseudo; `detailed` → JS with inline comments.
|
|
75
79
|
- YAML: always YAML; style only affects comments (`strict` none, `default` “# …”, `detailed` “# N more …”).
|
|
76
|
-
- `-i, --input-format <json|yaml>`: ingestion format (default: `json`). For filesets in `auto` format, ingestion is chosen by extensions.
|
|
80
|
+
- `-i, --input-format <json|yaml|text>`: ingestion format (default: `json`). For filesets in `auto` format, ingestion is chosen by extensions.
|
|
77
81
|
- `-m, --compact`: no indentation, no spaces, no newlines
|
|
78
82
|
- `--no-newline`: single line output
|
|
79
83
|
- `--no-space`: no space after `:` in objects
|
|
@@ -86,8 +90,9 @@ Notes:
|
|
|
86
90
|
|
|
87
91
|
- Multiple inputs:
|
|
88
92
|
- With newlines enabled, file sections are rendered with human‑readable headers. In compact/single‑line modes, headers are omitted.
|
|
89
|
-
|
|
90
|
-
-
|
|
93
|
+
- In `--format auto`, each file uses its own best format: JSON family for `.json`, YAML for `.yaml`/`.yml`.
|
|
94
|
+
- Unknown extensions are treated as Text (raw lines) — safe for logs and `.txt` files.
|
|
95
|
+
- `--global-bytes` may truncate or omit entire files to respect the total budget.
|
|
91
96
|
- The tool finds the largest preview that fits the budget; even if extremely tight, you still get a minimal, valid preview.
|
|
92
97
|
- Directories and binary files are ignored; a notice is printed to stderr for each. Stdin reads the stream as‑is.
|
|
93
98
|
- Head vs Tail sampling: these options bias which part of arrays are kept before rendering. Display styles may still insert internal gap markers to honor very small budgets; strict JSON stays unannotated.
|
|
@@ -96,24 +101,45 @@ Quick one‑liners:
|
|
|
96
101
|
|
|
97
102
|
- Peek a big JSON stream (keeps structure):
|
|
98
103
|
|
|
99
|
-
zstdcat huge.json.zst | headson -
|
|
104
|
+
zstdcat huge.json.zst | headson -c 800 -f json -t default
|
|
100
105
|
|
|
101
106
|
- Many files with a fixed overall size:
|
|
102
107
|
|
|
103
|
-
headson -
|
|
108
|
+
headson -C 1200 -f json -t strict logs/*.json
|
|
104
109
|
|
|
105
110
|
- Glance at a file, JavaScript‑style comments for omissions:
|
|
106
111
|
|
|
107
|
-
headson -
|
|
112
|
+
headson -c 400 -f json -t detailed data.json
|
|
108
113
|
|
|
109
114
|
- YAML with detailed comments:
|
|
110
115
|
|
|
111
|
-
headson -
|
|
116
|
+
headson -c 400 -f yaml -t detailed config.yaml
|
|
117
|
+
|
|
118
|
+
### Text mode
|
|
119
|
+
|
|
120
|
+
- Single file (auto):
|
|
121
|
+
|
|
122
|
+
headson -c 200 notes.txt
|
|
123
|
+
|
|
124
|
+
- Force Text ingest/output (useful when mixing with other extensions):
|
|
125
|
+
|
|
126
|
+
headson -c 200 -i text -f text notes.txt
|
|
127
|
+
|
|
128
|
+
- Many text files (fileset):
|
|
129
|
+
|
|
130
|
+
headson -c 800 -i text -f text logs/*.txt
|
|
131
|
+
|
|
132
|
+
- Styles on Text:
|
|
133
|
+
- default: omission as a standalone `…` line.
|
|
134
|
+
- detailed: omission as `… N more lines …`.
|
|
135
|
+
- strict: no array‑level omission line (individual long lines may still truncate with `…`).
|
|
112
136
|
|
|
113
137
|
Show help:
|
|
114
138
|
|
|
115
139
|
headson --help
|
|
116
140
|
|
|
141
|
+
Note: flags align with head/tail conventions (`-c/--bytes`, `-C/--global-bytes`).
|
|
142
|
+
|
|
117
143
|
## Examples: head vs headson
|
|
118
144
|
|
|
119
145
|
Input:
|
|
@@ -132,7 +158,7 @@ jq -c . users.json | head -c 80
|
|
|
132
158
|
Structured preview with headson (JSON family, default style → Pseudo):
|
|
133
159
|
|
|
134
160
|
```bash
|
|
135
|
-
headson -
|
|
161
|
+
headson -c 120 -f json -t default users.json
|
|
136
162
|
# {
|
|
137
163
|
# users: [
|
|
138
164
|
# { id: 1, name: "Ana", roles: [ "admin", … ] },
|
|
@@ -145,7 +171,7 @@ headson -n 120 -f json -t default users.json
|
|
|
145
171
|
Machine‑readable preview (JSON family, strict style → strict JSON):
|
|
146
172
|
|
|
147
173
|
```bash
|
|
148
|
-
headson -
|
|
174
|
+
headson -c 120 -f json -t strict users.json
|
|
149
175
|
# {"users":[{"id":1,"name":"Ana","roles":["admin"]}],"meta":{"count":2}}
|
|
150
176
|
```
|
|
151
177
|
|
|
@@ -157,6 +183,7 @@ Regenerate locally:
|
|
|
157
183
|
- Run: cargo make tapes
|
|
158
184
|
- Outputs are written to docs/assets/tapes
|
|
159
185
|
|
|
186
|
+
|
|
160
187
|
## Python Bindings
|
|
161
188
|
|
|
162
189
|
A thin Python extension module is available on PyPI as `headson`.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
headson-0.6.4.dist-info/METADATA,sha256=WidNGP3zBXfDNvrIPAB8NZqPfTgXIDcSgzBNqwh3084,11047
|
|
2
|
+
headson-0.6.4.dist-info/WHEEL,sha256=4EDp_7DiFfWl1yYv5M4wSosAn5L_xgD1dyrQxQxfCx8,95
|
|
3
|
+
headson/__init__.py,sha256=Z-vwzLN9ptomZrtRqVUuUKSAaidOSVcjFI6Ojbuj-dU,219
|
|
4
|
+
headson/headson.pyd,sha256=pJox3PeWAH6Vqj9L7uh4GDUpTPKkwcRwrNz193sH1bE,762880
|
|
5
|
+
headson-0.6.4.dist-info/RECORD,,
|
headson-0.6.2.dist-info/RECORD
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
headson-0.6.2.dist-info/METADATA,sha256=JhObjCQ0LKxqCUg2YdJlE272hAKGob8KhXCcyh0Pa2s,9831
|
|
2
|
-
headson-0.6.2.dist-info/WHEEL,sha256=4EDp_7DiFfWl1yYv5M4wSosAn5L_xgD1dyrQxQxfCx8,95
|
|
3
|
-
headson/__init__.py,sha256=Z-vwzLN9ptomZrtRqVUuUKSAaidOSVcjFI6Ojbuj-dU,219
|
|
4
|
-
headson/headson.pyd,sha256=1u6Iy8XUOfv_zPDCcGp5Sht0CRrgYBQ5Sav2GNw1Cwg,762368
|
|
5
|
-
headson-0.6.2.dist-info/RECORD,,
|
|
File without changes
|