Skip to content

Commit

Permalink
min fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Wambere committed Jul 17, 2024
1 parent f524fc2 commit bca2cf6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion importer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ backoff==2.2.1
pytest==7.4.2
jsonschema==4.21.1
mock==5.1.0
python-magic==0.4.27
python-magic==0.4.27
Faker==0.7.4
9 changes: 5 additions & 4 deletions importer/stub_data_gen/orgs-stup-gen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import csv
import uuid
from faker import Faker

# Initialize Faker
Expand All @@ -10,23 +9,25 @@
"orgName", "orgActive", "method", "orgId", "identifier"
]


# Function to generate random row data
def generate_random_row():
org_name = fake.name()
active = fake.random_element(["true", "false", ""])
method = "create"
id = fake.uuid4()
_id = fake.uuid4()
identifier = fake.uuid4()

return [org_name, active, method, id, identifier]
return [org_name, active, method, _id, identifier]


# Generate 100 rows of data
rows = []
for _ in range(100):
rows.append(generate_random_row())

# Write to CSV file
filename = f"localCsvs/orgs.csv"
filename = f"./orgs.csv"
with open(filename, mode='w', newline='') as file:
writer = csv.writer(file)
writer.writerow(header)
Expand Down
5 changes: 3 additions & 2 deletions importer/stub_data_gen/users-stub-gen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import csv
import uuid
from faker import Faker

# Initialize Faker
Expand All @@ -12,13 +11,14 @@
"appId", "password"
]


# Function to generate random row data
def generate_random_row():
f_name = fake.first_name()
l_name = fake.last_name()
u_name = fake.user_name()
email = fake.email()
user_id = ""
user_id = fake.uuid4()
user_type = fake.random_element(["Practitioner", "Supervisor", ""])
enable_user = fake.random_element(["true", "false", ""])
group_ids = ""
Expand All @@ -27,6 +27,7 @@ def generate_random_row():
password = fake.password()
return [f_name, l_name, u_name, email, user_id, user_type, enable_user, group_ids, group_names, app_id, password]


# Generate 100 rows of data
rows = []
for _ in range(100):
Expand Down

0 comments on commit bca2cf6

Please sign in to comment.