从Frictionless Data的表模式文件生成Markdown文档
项目描述
Table Schema to Markdown
从表模式文件创建Markdown文档文件。
原始脚本来自doc-generator,用于Validata项目,现在可以作为npm包使用。
安装
pip install table-schema-to-markdown
用法
命令行工具
该包提供命令行工具。
$ table-schema-to-md -h
usage: table-schema-to-md [-h] [-o OUTPUT] [--log LOG] table_schema
positional arguments:
table_schema path or URL of table schema file
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Output file name
--log LOG level of logging messages
示例
# Print generated Markdown
table-schema-to-md schema.json
# Save to Markdown file
table-schema-to-md schema.json -o documentation.md
在Python中
from table_schema_to_markdown import convert_source
# Generate a Markdown documentation from a JSON file
table_schema = '/tmp/schema.json'
with open('/tmp/doc.md', 'a') as out:
convert_source(table_schema, out)
# Generate Markdown documentation in a string
import io
with io.StringIO() as buff:
convert_source(table_schema, buff)
documentation = buff.getvalue()
生成文档示例
以下为生成的文档文件。
Git目录元数据
- 作者:Antoine Augusti antoine.augusti@example.com
- 创建方案:18/12/31
- 网站:https://github.com/AntoineAugusti/data-codes-sources-fr
- 主键:
repertoire_url
数据模型
名称 | 类型 | 描述 | 示例 | 属性 |
---|---|---|---|---|
nom | 字符串 | 目录名称 | nom-repertoire | 必填 |
organisation_nom | 字符串 | 组织名称 | etalab | 必填 |
plateforme | 字符串 | 代码存储平台 | GitHub | 必填,允许值:GitHub |
repertoire_url | 字符串(格式uri ) |
目录的URL | https://github.com/etalab/nom-repertoire | 必填 |
description | 字符串 | 目录的描述 | Ce répertoire est utile | 可选 |
est_fork | 布尔值 | 指示目录是否为分支 | false | 必填 |
date_creation | 日期和时间 | 目录创建日期 | 2018-12-01T20:00:55Z | 必填 |
derniere_mise_a_jour | 日期和时间 | 目录最后更新日期 | 2018-12-01T20:00:55Z | 必填 |
page_accueil | 字符串 | 项目首页URL | https://etalab.gouv.fr | 可选 |
nombre_stars | 整数 | 目录被添加到收藏夹的次数 | 42 | 必填,最小值:0 |
nombre_forks | 整数 | 目录被分叉的次数 | 13 | 必填,最小值:0 |
licence | 字符串 | 目录的许可证,由平台检测到 | MIT | 可选 |
nombre_issues_ouvertes | 整数 | 当前打开的问题数量 | 0 | 必填,最小值:0 |
langage | 字符串 | 目录的主要语言,由平台检测到 | Python | 可选 |
topics | 字符串 | 目录的标签 | utile,france,opendata | 可选 |
注意
此软件可在MIT许可证下获得。
项目详情
关闭
散列用于table_schema_to_markdown-0.4.12-py3-none-any.whl
算法 | 散列摘要 | |
---|---|---|
SHA256 | 7487eb5b0bb3c7efbc2a15cb3eeaea2f84e70d2d79850b2b10fa817c83ea9c9d |
|
MD5 | 10d245de0c992c2606b5cc9a806842b7 |
|
BLAKE2b-256 | b82bac9dc5d5c4ec7daadd5724d9074c7f03a9e12f8e1b319c3916b12c0d0498 |