Skip to content
Beta · version 0.7.4 · commands and the JSON format may still change.

Generate CRM contacts

The CRM example creates one CSV of sales contacts, each tied to a company, with a lifecycle stage and, for some of them, an open or closed opportunity.

Terminal window
tabalyst generate --example crm -o crm-contacts.csv
Created: crm-contacts.csv
20,000 rows in 3.1s (6,412 rows/s)

The file has 26 columns and 20,000 rows by default; --rows changes the count and --seed the data. The same seed gives the same file. The times above come from one machine and are not a promise.

The 26 columns fall into three groups. Contacts that belong to the same company share every company column, because they point to the same one of 400 generated companies.

GroupColumns
Contact (14)contact_id (C000001, C000002, …), first_name, family_name, person_language (en or fr), email, phone, job_title, lead_source, lifecycle_stage, lead_status, owner, marketing_opt_in, created_at, last_activity_at
Company (8)company_id, company_name, industry, company_size, country, city, province_code, postal_code
Opportunity (4)opportunity_stage, opportunity_amount, opportunity_probability, opportunity_close_date

Some rules tie the values together:

  • Names are English or French in about equal parts, and the cities, province codes and postal codes belong to Canada.
  • lifecycle_stage is Lead, Qualified, Opportunity or Customer, and lead_status follows it: New, Working, Negotiating or Converted.
  • About two thirds of the contacts have no opportunity: their opportunity_stage reads None and opportunity_amount is empty. The others have a stage (Discovery, Proposal, Negotiation, Closed Won or Closed Lost), an amount, a probability from 0 to 100 and a close date.
  • Email addresses use the reserved .example domain and phone numbers use the fictitious 555 range, so none of them reaches a real person.

These are synthetic records. Nothing in them comes from a customer file.

The dirty_realistic anomaly profile keeps the clean file and writes an altered copy with a log of every changed cell. CRM needs -d for that, since the result is several files:

Terminal window
tabalyst generate --example crm --rows 5000 -d crm-dirty/ --anomaly-profile dirty_realistic
Created: crm-dirty/crm-contacts.csv
Created: crm-dirty/crm-contacts.dirty_realistic.csv
Created: crm-dirty/crm-contacts.dirty_realistic.changes.csv
Created: crm-dirty/crm-contacts.dirty_realistic.summary.json
5,000 rows in 1.6s (3,039 rows/s), 2,109 cells changed

The profile touches these columns, each on the share of rows shown:

ColumnDefectRows
emailEmptied6%
emailCopied from another row, which creates duplicates2%
emailReplaced by invalid-address1%
phoneEmptied5%
phoneSpaces inside the number12%
company_nameWritten in capitals3%
countryReplaced by CA instead of Canada6%
industryWritten in lower case4%
lead_sourceWritten in lower case4%
opportunity_amountEmptied4%
opportunity_probabilitySet to 120, beyond the range1%

A defect that cannot apply to a row, such as emptying a cell that is already empty, is not counted: the summary reports the rows requested, applied and skipped for every operation. Because the log names each changed cell, a profile of the altered file can be checked against what was injected, for example with Tabalyst Report.