Skip to content

Commit

Permalink
#99
Browse files Browse the repository at this point in the history
  • Loading branch information
turbomam committed Mar 29, 2023
1 parent be19d60 commit a6b2a46
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions schemasheets/schemamaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ def ensure_csvreader(self, file_name: str, delimiter=None) -> str:
type=click.File(mode="w"),
default=sys.stdout,
help="output file")
@click.option('-s', '--sort-keys',
default=False,
help="Sort keys in schema output? For example permissible values in an enumeration? Defaults to False.")
@click.option("-n", "--name",
help="name of the schema")
@click.option("-C", "--table-config-path",
Expand All @@ -619,7 +622,7 @@ def ensure_csvreader(self, file_name: str, delimiter=None) -> str:
help="Google sheets ID. If this is specified then the arguments MUST be sheet names")
@click.option("-v", "--verbose", count=True)
@click.argument('tsv_files', nargs=-1)
def convert(tsv_files, gsheet_id, output: TextIO, name, repair, table_config_path: str, use_attributes: bool, unique_slots: bool, verbose: int):
def convert(tsv_files, gsheet_id, output: TextIO, name, repair, table_config_path: str, use_attributes: bool, unique_slots: bool, verbose: int, sort_keys: bool):
"""
Convert schemasheets to a LinkML schema
Expand Down Expand Up @@ -649,7 +652,7 @@ def convert(tsv_files, gsheet_id, output: TextIO, name, repair, table_config_pat
if repair:
schema = sm.repair_schema(schema)
schema_dict = schema_as_dict(schema)
output.write(yaml.dump(schema_dict))
output.write(yaml.dump(schema_dict, sort_keys=sort_keys))
#output.write(yaml_dumper.dumps(schema))


Expand Down

0 comments on commit a6b2a46

Please sign in to comment.