Skip to content

Instantly share code, notes, and snippets.

johntmyers /
Last active August 30, 2022 12:10
Gretel Contributor License Agreement


In order to clarify the intellectual property license granted with Contributions (as defined below) from any person or entity, Gretel Labs, Inc. (“”) must have a Contributor License Agreement (“CLA”) on file that has been signed by each Contributor (as defined below), indicating agreement to the license terms below. This CLA is for Your protection as a Contributor as well as the protection of and its users; it does not change Your rights to use Your own Contributions for any other purpose.

This CLA allows either an individual or an entity (a "Corporation") to submit Contributions to, to authorize Contributions submitted by its employees or agents to (in the case of a Corporation), and to grant copyright and patent licenses thereto.

Please read this document carefully and provide the Contributor information requested below before signing and keep a copy for Your records. If You have questions about this CLA, please contact at

By sig

johntmyers /
Created October 7, 2020 15:40
Gretel Synthetics Report Generation
# With the latest Premium SDK, you can write your report to a HTML file for archiving and distribution
# ... assuming you have a ``bundle`` object from previous synthetic workloads
johntmyers /
Last active August 11, 2020 20:29
# le super secret
johntmyers / response.json
Created July 1, 2020 16:27
Gretel Sync API Response Example
"data": {
"records": [
"data": {
"Unnamed: 0": 2135731,
"Unnamed: 0.1": 2135731,
"id": null,
"member_id": null,
"loan_amnt": 12000,
johntmyers /
Created June 15, 2020 19:29
# ``batcher`` is our ``DataFrameBatch`` instance
# this creates a DataFrame and a "train.csv" file for each of our batches
# loops over all batches, and generates the models
# loops over all models, and generates synthetic lines for each one
johntmyers /
Created June 15, 2020 19:06
# ``batcher`` is our ``DataFrameBatch`` instance
def my_validator(line: str) -> bool:
# ``str`` is a single line of generated text
# return a bool, True for valid, False for invalid
# throwing an Exception also invalidates the line
# set a validator function for our first batch
batcher.set_batch_validator(0, my_validator)
johntmyers /
Last active June 15, 2020 15:15
# pip install gretel-synthetics
from gretel_synthetics.batch import DataFrameBatch
# my_source_df = ...
# Same configurations parameters as using LocalConfig
config_template = {
"max_lines": 0,
johntmyers /
Last active May 22, 2020 19:50
String to regex converter
import re
def _sub_special_chars_any(in_string: str):
return re.sub("[^a-z\d\s]", ".?", in_string)
def _mark_substrings_optional(in_string: str, n=3):
parts = in_string.split()
if len(parts) == 1:

Keybase proof

I hereby claim:

  • I am johntmyers on github.
  • I am johntmyers ( on keybase.
  • I have a public key ASCqahqpY4OgOzF1bwaJlaMIsZRl9NTqNWVvmiPiHArQXwo

To claim this, I am signing this object: