Commit 0246578
jennifersmith
Implements json streaming for array output
This is to address issue wireservice#355 and to allow json to be 'streamed' - that
is, each object in the array be written out separated by a newline, rather
than output as one single array. Allowing this means we can convert
large csv streams to json without waiting until the end to see the
output. Many json-processing tools can deal with streaming json (for
instance jq).1 parent 30db4b4 commit 0246578
File tree
2 files changed
+40
-17
lines changed- csvkit/utilities
- tests/test_utilities
2 files changed
+40
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
35 | 55 | | |
36 | 56 | | |
37 | 57 | | |
| |||
47 | 67 | | |
48 | 68 | | |
49 | 69 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 70 | | |
56 | 71 | | |
57 | 72 | | |
| |||
129 | 144 | | |
130 | 145 | | |
131 | 146 | | |
| 147 | + | |
132 | 148 | | |
133 | 149 | | |
134 | 150 | | |
| |||
145 | 161 | | |
146 | 162 | | |
147 | 163 | | |
| 164 | + | |
148 | 165 | | |
149 | 166 | | |
150 | 167 | | |
151 | | - | |
152 | 168 | | |
153 | 169 | | |
154 | 170 | | |
| |||
157 | 173 | | |
158 | 174 | | |
159 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
160 | 182 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 183 | | |
173 | 184 | | |
174 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
0 commit comments