pydatafaker.business.create_business

pydatafaker.business.create_business(n_vendors=100, n_employees=100, n_pos=100, mean_po_amount=1000000, sd_po_amount=250000, mean_inv_line_amount=5000, sd_inv_line_amount=4000, min_date='2000-01-01', max_date='2020-12-31', n_invoice=250, n_line_item=5000)[source]

Create an entire fake business.

A meta function that creates many tables with related entities. A dictionary is returned that contains the following tables:

  • vendor_table

  • po_table

  • invoice_summary_table

  • invoice_line_item_table

  • employee_table

  • rate_sheet_table (under development)

  • contract_table (under development)

  • timesheet_table (under development)

The tables are related to eachother in such a way that all tables can be combined to access different data.

Parameters
  • n_vendors (int, optional) – The number of fake vendors to create, by default 100.

  • n_employees (int, optional) – The number of additional employees to create in excess of 1 employee for each vendor. By default 100.

  • n_pos (The number of additional POs to create in excess of 1 PO for each) – vendor. By default 100.

  • mean_po_amount (int, optional) – Mean value for normal distribution, by default 1_000_000.

  • sd_po_amount (int, optional) – Standard deviation value for normal distribution, by default 250_000.

  • mean_inv_line_amount (int, optional) – The mean value of invoice line items, by default 5_000.

  • sd_inv_line_amount (int, optional) – The standard deviation of invoice line items, by default 4_000.

  • min_date (str, optional) – The minimum possible date, by default ‘2000-01-01’.

  • max_date (str, optional) – The maximum possible date, by default ‘2020-12-31’.

  • n_invoice (int, optional) – The number of invoices to generate in excess of 1 invoice for each PO. By default 250.

  • n_line_item (int, optional) – The number of invoice line items to generate in excess of 1 line item per invoice. By default 5_000.

Returns

A dictionary containing related dataframes.

Return type

dict

Examples

>>> from pydatafaker import business
>>> biz = business.create_business()
>>> biz.keys
<built-in method keys of dict object at 0x000001EC7F532E40>
>>> biz.keys()
dict_keys(['vendor_table', 'po_table', 'invoice_summary_table', 'invoice_line_item_table', 'employee_table', 'contract_table', 'rate_sheet_table', 'timesheet_table'])
>>> biz['vendor_table']
    vendor_id                vendor_name  ...               phone                      email
0   vendor_00001             Byrd-Gutierrez  ...        845.182.3329    gamblekatie@example.com
1   vendor_00002   Shaw, White and Richmond  ...  (378)573-4689x8570    cindylucero@example.org
2   vendor_00003  Boyd, Mosley and Santiago  ...        070-378-7627       egoodwin@example.net
3   vendor_00004            Hernandez-Klein  ...       (778)011-8623        jason05@example.com
4   vendor_00005                  Ayers LLC  ...  (685)853-4020x9781     loriwalker@example.com
..           ...                        ...  ...                 ...                        ...
95  vendor_00096  Benson, Durham and Kelley  ...       (886)807-6220  powersnatalie@example.org
96  vendor_00097                   Hill PLC  ...       (958)223-4924     dianepayne@example.net
97  vendor_00098                Delgado LLC  ...        278-256-0545         john97@example.net
98  vendor_00099               Romero Group  ...       (699)578-3025    erikcarlson@example.com
99  vendor_00100                Stevens Inc  ...          1485591460       daniel91@example.net
[100 rows x 6 columns]
>>> biz['employee_table']
        employee_id      employee_name     vendor_id
0    employee_00001  Richard Robertson  vendor_00001
1    employee_00002          Amanda Wu  vendor_00002
2    employee_00003     Nicholas Brown  vendor_00003
3    employee_00004        Betty Evans  vendor_00004
4    employee_00005     Jennifer Lewis  vendor_00005
..              ...                ...           ...
195  employee_00196     Madison Rivera  vendor_00094
196  employee_00197        Denise Rose  vendor_00092
197  employee_00198         Peter Moss  vendor_00012
198  employee_00199     Sydney Coleman  vendor_00071
199  employee_00200   Julie Strickland  vendor_00095
[200 rows x 3 columns]
>>> biz['invoice_line_item_table']
    invoice_id      invoice_line_id  amount    description
0     inv_00001  line_item_000000001    3621  0-320-40333-5
1     inv_00001  line_item_000004269    4494  0-437-82194-3
2     inv_00001  line_item_000002923    4747  1-66714-426-X
3     inv_00001  line_item_000004644    4013  0-371-59348-4
4     inv_00001  line_item_000001550   12146  0-04-668150-7
...         ...                  ...     ...            ...
5445  inv_00450  line_item_000004997    6167  0-06-558662-X
5446  inv_00450  line_item_000000450    4039  1-118-57228-9
5447  inv_00450  line_item_000003202   13686  1-893058-35-2
5448  inv_00450  line_item_000003791    4145  0-906649-99-4
5449  inv_00450  line_item_000000846    9113  1-04-617333-2
[5450 rows x 4 columns]