mixpanel / mixpanel-utils

Other
85 stars 62 forks source link

New Feature Request: Allow special character for delimiter when reading CSV files #50

Open asokratis opened 1 year ago

asokratis commented 1 year ago

https://github.com/mixpanel/mixpanel-utils/blob/61185dea3e7d125ee1f3edc94054950e293fa30c/__init__.py#L1751

change it to

reader = csv.reader(item_file, delimiter=delimiter_character)

The comma by default is not a very strong delimiter especially with how cloud databases export these data in a dirty way.

Ideally, I would want to pass the delimiter character as a parameter when I use the import_events function.

m.import_events('mixpanel_uploads/test_file.csv',timezone_offset=0, delimiter_character='\x1f')

As a short term workaround, I tried to override the class and function of _list_from_items_filename to apply the changes and it did not work (is it because it is a @staticmethod?), so I had to edit the actual source code of the library I installed in the end and that seemed to do the fix.