Skip to content

Commit

Permalink
Rename cli.py to faker-clie
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki committed Oct 17, 2024
1 parent 4d28fe6 commit 3ce8c46
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions importer/stub_data_gen/Readme.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
# usage

Ofcourse you need to prepare your python environment and install the package dependencies

```commandline
python3 -m venv myenv
source myenv/bin/activate
pip instal -r ../requirements.txt
```

**To generate data for all resources**

```commandline
python cli.py generate
python faker-cli generate
```

**Generate data for a single resource**

```commandline
python cli.py generate users --count=100
python faker-cli generate users --count=100
```

**Generate single resource that requires pre-generated data like assignments**

e.g. When assigning users to organizations, provide individual csvs containing the users and organizations data

```commandline
python cli.py generate users-orgs --orgs-csv=<orgs-csv-path> --users-csv=<users-csv-path>
python faker-cli generate users-orgs --orgs-csv=<orgs-csv-path> --users-csv=<users-csv-path>
```

**Learn more**

```commandline
python cli.py generate --help
python faker-cli generate --help
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


@click.group()
def cli():
def faker():
pass


Expand Down Expand Up @@ -157,7 +157,7 @@ def organizations(ctx):
click.echo(f"Organization data generated and saved in {out_dir}")


cli.add_command(generate)
faker.add_command(generate)

generate.add_command(users)
generate.add_command(careteams)
Expand All @@ -169,4 +169,4 @@ def organizations(ctx):
generate.add_command(organizations)

if __name__ == '__main__':
cli()
faker()

0 comments on commit 3ce8c46

Please sign in to comment.