Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
regadas committed Feb 7, 2020
1 parent 5eabebd commit 5711967
Showing 1 changed file with 73 additions and 11 deletions.
84 changes: 73 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Usage: tfr [options] <files? | STDIN>
If enabled checks CRC32 on each record
--number | -n <int?>
Number of records to output
--flat | -f <bool>
Output examples as flat JSON objects
```

## Examples
Expand All @@ -50,7 +52,67 @@ tfr -n 1 core/src/test/resources/part-00000-of-00004.tfrecords | jq .
cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq .
```

### Output Example
### Output

#### Flat

```json
{
"tips": [
0
],
"trip_seconds": [
60
],
"payment_type": [
"Cash"
],
"trip_miles": [
0
],
"dropoff_longitude": [
-87.63785
],
"dropoff_latitude": [
41.893215
],
"pickup_longitude": [
-87.63187
],
"pickup_latitude": [
41.89204
],
"trip_start_timestamp": [
1402934400
],
"trip_start_day": [
2
],
"trip_start_hour": [
16
],
"trip_start_month": [
6
],
"fare": [
3.25
],
"dropoff_census_tract": [
"17031081800"
],
"dropoff_community_area": [
"8"
],
"pickup_community_area": [
"8"
],
"trip_id": [
"8106c1f6-e6f3-426f-9aaf-b4e9703b4f10"
]
}
```

#### Default

```json
{
Expand All @@ -66,14 +128,14 @@ cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq .
"trip_seconds": {
"int64List": {
"value": [
"60"
60
]
}
},
"payment_type": {
"bytesList": {
"value": [
"Q2FzaA=="
"Cash"
]
}
},
Expand Down Expand Up @@ -115,28 +177,28 @@ cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq .
"trip_start_timestamp": {
"int64List": {
"value": [
"1402934400"
1402934400
]
}
},
"trip_start_day": {
"int64List": {
"value": [
"2"
2
]
}
},
"trip_start_hour": {
"int64List": {
"value": [
"16"
16
]
}
},
"trip_start_month": {
"int64List": {
"value": [
"6"
6
]
}
},
Expand All @@ -150,28 +212,28 @@ cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq .
"dropoff_census_tract": {
"bytesList": {
"value": [
"MTcwMzEwODE4MDA="
"17031081800"
]
}
},
"dropoff_community_area": {
"bytesList": {
"value": [
"OA=="
"8"
]
}
},
"pickup_community_area": {
"bytesList": {
"value": [
"OA=="
"8"
]
}
},
"trip_id": {
"bytesList": {
"value": [
"ODEwNmMxZjYtZTZmMy00MjZmLTlhYWYtYjRlOTcwM2I0ZjEw"
"8106c1f6-e6f3-426f-9aaf-b4e9703b4f10"
]
}
}
Expand Down

0 comments on commit 5711967

Please sign in to comment.