-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transform air-oed without config file #124
Conversation
ods_tools/main.py
Outdated
""" | ||
transform_command = command_parser.add_parser('transform', description=transform_description, | ||
formatter_class=argparse.RawTextHelpFormatter) | ||
transform_command.add_argument('--config-file', help='Path to the config file', required=True) | ||
transform_command.add_argument('--config-file', help='Path to the config file') | ||
transform_command.add_argument('--oed-air', help='directly transforms OED to AIR format', action='store_true') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think those should be direct argument of the command because you will end up having to add n^2 arguments each time you have a new built-in transformation
I would add a single argument named -f --formats
that tell you which transformation to do
either -f or --config-file needs to be present to do the transformation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks! I changed it to -f/--format.
(in the same spirit, I changed a bit the generate_config() function too, to avoid excessive hardcoding)
* enable transformation without config file * fix reverse mappings * comments * pep * format as argument with --format * adjust logger when failing * remove oed-air arg
Transform air to oed without config file
A simple transformation from air to oed and vice versa can be run without creating a config file, but simply by command line
It is now possible to run a transformation without using a configuration file. Solves #125.
For example, the command:
ods_tools transform --format air-oed --input-file air_input.csv --output-file oed_output.csv
will produce the oed file
output.csv
from the air fileinput.csv
We currently support
air-oed
andoed-air
.