Skip to content

Commit

Permalink
Add documentation to commands
Browse files Browse the repository at this point in the history
  • Loading branch information
medvedev1088 committed Mar 3, 2019
1 parent 6f19ff0 commit aac00bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ethereumetl/cli/extract_csv_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@click.option('-o', '--output', default='-', type=str, help='The output file. If not specified stdout is used.')
@click.option('-c', '--column', required=True, type=str, help='The csv column name to extract.')
def extract_csv_column(input, output, column):
"""Extracts column from given CSV file."""
"""Extracts column from given CSV file. Deprecated - use extract_field."""
set_max_field_size_limit()

with smart_open(input, 'r') as input_file, smart_open(output, 'w') as output_file:
Expand Down
1 change: 1 addition & 0 deletions ethereumetl/cli/extract_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
@click.option('-o', '--output', default='-', type=str, help='The output file. If not specified stdout is used.')
@click.option('-f', '--field', required=True, type=str, help='The field name to extract.')
def extract_field(input, output, field):
"""Extracts field from given CSV or JSON newline-delimited file."""
misc_utils.extract_field(input, output, field)
1 change: 1 addition & 0 deletions ethereumetl/cli/filter_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@click.option('-p', '--predicate', required=True, type=str,
help='Predicate in Python code e.g. "item[\'is_erc20\']".')
def filter_items(input, output, predicate):
"""Filters rows in given CSV or JSON newline-delimited file."""
def evaluated_predicate(item):
return eval(predicate, globals(), {'item': item})
misc_utils.filter_items(input, output, evaluated_predicate)

0 comments on commit aac00bf

Please sign in to comment.