Edit page in Livemark
(2023-03-20 17:23)

Describe

With Frtictionless describe command you can get a metadata of file or a dataset.

Normal Mode

By default, it outputs metadata visually formatted:

frictionless describe tables/*.csv
─────────────────────────────────── Dataset ────────────────────────────────────
               dataset
┏━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
┃ name   ┃ type  ┃ path              ┃
┡━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩
│ chunk1 │ table │ tables/chunk1.csv │
│ chunk2 │ table │ tables/chunk2.csv │
└────────┴───────┴───────────────────┘
──────────────────────────────────── Tables ────────────────────────────────────
       chunk1
┏━━━━━━━━━┳━━━━━━━━┓
┃ id      ┃ name   ┃
┡━━━━━━━━━╇━━━━━━━━┩
│ integer │ string │
└─────────┴────────┘
       chunk2
┏━━━━━━━━━┳━━━━━━━━┓
┃ id      ┃ name   ┃
┡━━━━━━━━━╇━━━━━━━━┩
│ integer │ string │
└─────────┴────────┘

Yaml/Json Mode

It's possible to output as YAML or JSON, for example:

frictionless describe tables/*.csv --yaml
$frictionless: package/v2
resources:
  - name: chunk1
    type: table
    path: tables/chunk1.csv
    scheme: file
    format: csv
    mediatype: text/csv
    encoding: utf-8
    schema:
      fields:
        - name: id
          type: integer
        - name: name
          type: string
  - name: chunk2
    type: table
    path: tables/chunk2.csv
    scheme: file
    format: csv
    mediatype: text/csv
    encoding: utf-8
    schema:
      fields:
        - name: id
          type: integer
        - name: name
          type: string