diff --git a/README.md b/README.md index 43b77a9..80cde26 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,9 @@ Some [Faker providers](https://faker.readthedocs.io/en/master/providers/baseprov fake -n 10 "pyint(1;100),credit_card_number(amex),pystr_format(?#-####)" -f json -c id,credit_card_number,license_plate ``` +> [!IMPORTANT] +> When using arguments with output formats like JSON, it's best to provide column headers as well with `-c`. + And unique values are supported as well. ```bash diff --git a/faker_cli/parser.py b/faker_cli/parser.py index e3750d3..bc21573 100644 --- a/faker_cli/parser.py +++ b/faker_cli/parser.py @@ -1,6 +1,4 @@ -from typing import List, Tuple - -def infer_column_names(col_names, col_types: str) -> List[str]: +def infer_column_names(col_names, col_types: str) -> list[str]: """ Infer column names from column types """ @@ -11,7 +9,7 @@ def infer_column_names(col_names, col_types: str) -> List[str]: return col_types.split(",") -def parse_column_types(input_string: str) -> List[Tuple[str, List]]: +def parse_column_types(input_string: str) -> list[tuple[str, list]]: """ Parse a string of the format "pyint(1;10),datetime,profile(ssn,birthdate)" and split it by commas with optional parenthese-inclosed arguments. """