Skip to content

A tool to convert frictionless datapackage (YAML or JSON) to markdown

License

Notifications You must be signed in to change notification settings

dennisangemi/frictionless2md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔧 frictionless2md

A tool to convert frictionless datapackage (YAML or JSON) to markdown file (that can be used as README).

You can obtain a markdown file like this.

Set-up

Download frictionless2md

wget "https://raw.githubusercontent.com/dennisangemi/frictionless2md/main/frictionless2md"

Move it to /usr/local/bin

sudo mv ./frictionless2md /usr/local/bin

Make it executable

sudo chmod +x /usr/local/bin/frictionless2md

Usage

You can simply launch

frictionless2md

in a directory where a datapackage is located. The default output file will be METADATA.md.

Options

Here's a summary

Short option Long option Requires argument Description
-h --help false Show help. See more
-v --version false Show version number. See more
-w --warnings false Show warnings. See more
-o --output true Set custom output filename. See more
-t --tree false Add repository structure (tree). See more
-u --userepo true Add GitHub URLs to files. See more
-m --mention false Mention this tool at the end of the generated file. See more

Help

-h or --help

If you want to open the help, you can run

frictionless2md -h

Version

-v or --version

If you want to understand which version of the tool you have, use -v or --version flag as follow

frictionless2md -v

Warnings

-w or --warnings

If you want to see the warnings, you can use -w or --warnings flag:

frictionless2md -w

and you will get for example

⚠️ Warning: data/contenuti.csv not found. Your METADATA.md will not contain the example column.

Custom output filename

-o or --output

If you want to use a custom output filename you can use -o or --outputflag:

frictionless2md -o customfilename.md

Repository structure

-t or --tree

If you want to add the tree of the folder where your datapackage is located you can add the -t or --tree flag:

frictionless2md -t

This option requires the tree-emoji-cli utility.

Your output will be something like this

🌳 /Documents/GitHub/myrepo
├── 📄 CHANGELOG.md
├── 📄 METADATA.md
├── 📄 README.md
├── 📄 build
├── 📁 data
└── 📄 datapackage.yaml

GitHub URLs to files

-u or --userepo

You can add "- URL" to the bulleted list of the output (Data dictionary section) specifying the flag -u (or --userepo) followed by your GitHub username and the repository name (username/repo):

frictionless2md -u chiaraadornetto/dati-tv-elezioni-ue-2019

and you will get for example

image


Mention

-m or --mention

Use -m or --mention flag to nention this tool at the end of the generated file.

frictionless2md -m

Will add this line to the output

Generated from datapackage.yaml with frictionless2md


Development

frictionless2md is a bash script based on these requirements.

Requirements

tool docs mandatory
frictionless frictionless-py true
mlr miller true
jq jq true
yq yq false
tree tree-emoji-cli false

About

A tool to convert frictionless datapackage (YAML or JSON) to markdown

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages