Given a Frictionless Table Schema, generates an Excel template with input validation
Slowing down. Last release over 3 years ago, little activity since. Fine for existing code; think twice for a new project.
$
pip install tableschema-to-templatetableschema-to-template
Given a Frictionless Table Schema (like this), generate an Excel template with input validation (like this).
Usage
Download a sample schema.yaml, and then:
pip install tableschema-to-template
ts2xl.py schema.yaml template.xlsx
# Open with Excel:
open template.xlsx
Or to use inside Python:
from tableschema_to_template import create_xlsx
schema = {'fields': [{
'name': 'a_number',
'description': 'A number!',
'type': 'number'
}]}
create_xlsx(schema, '/tmp/template.xlsx')
Additional docs:
Features
- Enum constraints transformed into pull-downs.
- Field descriptions transformed into comments in header.
- Float, integer, and boolean type validation, with range checks on numbers.
More details in the changelog.
Related work
If you want to construct Excel files programmatically, XlsxWriter is great!
For validated data entry, from the Frictionless community:
table-schema-resource-template: Generates templates, but doesn't go beyond row headers.data-curator: Desktop application for data entry based on Table Schema.