跳转到主要内容

从Frictionless Data的表模式文件生成Markdown文档

项目描述

Software License CircleCI PyPI PyPI Python version

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()

生成文档示例

此表架构文件此文件中渲染为Markdown。

以下为生成的文档文件。

Git目录元数据

数据模型

名称 类型 描述 示例 属性
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 (8.7 kB 查看哈希值)

上传时间: Python 3

支持