IDGenerator
Compatibility:
text
dataThe
IDGenerator
is used to create an indexed ID column that you may be using as a primary key. When transforming the data, it removes the column. When reversing the the transform, it creates an indexed ID column starting at a specified counter, with any additional prefixes or suffixes you provide.
from rdt.transformers.text import IDGenerator
transformer = IDGenerator(prefix='ID_', starting_value=0, suffix='-synthetic')
prefix
: A string with the prefix to use for the counter. All generated IDs will have the prefix.(default) None | Do not add a prefix |
<string> | Add the prefix to every ID |
starting_value
: The starting value for the counter(default) 0 | Start the counter at 0. |
<integer> | Use the integer as the starting value. This must be >=0. |
suffix
: A string with the suffix to use for the counter. All generated IDs will have the suffix.(default) None | Do not add a suffix |
<string> | Add the suffix to every ID |
Yes. The generated IDs start at the
starting_value
parameter, and always increment by 1 for each new ID. Since there is no maximum value, the transformer will create unique IDs. (This is useful for primary keys.)Last modified 3mo ago