Skip to content

Commit

Permalink
Minor readme/typing update
Browse files Browse the repository at this point in the history
  • Loading branch information
dacort committed Feb 2, 2024
1 parent ebdd86f commit ba35f27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions faker_cli/parser.py
Original file line number Diff line number Diff line change
@@ -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
"""
Expand All @@ -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.
"""
Expand Down

0 comments on commit ba35f27

Please sign in to comment.