Skip to content

deal with unsanitized stripe emails easily: force them to lowercase, or save a mapping

License

Notifications You must be signed in to change notification settings

anjayc/normalize-stripe-emails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

normalize stripe emails

deal with unsanitized stripe emails easily: force them to lowercase, or save a mapping

why?

  • your current customer emails were not case-sanitized on collection
  • stripe customer email search is case-sensitive (reference)
  • this is an alternative to adding an extra step in which all components refer to a record of lowercase emails, along with their capitalized counterparts

how?

clone the repo

git clone https://github.com/maxtheaxe/normalize-stripe-emails.git

install dependencies

pip3 install -r requirements.txt

set up stripe API key

create a text file in the same directory named .env, type in STRIPE_API_KEY=<your API key>

run the script (optional arguments are bracketed)

python3 normalize.py [--oversight] [--verbose] [--testmode] [--testdata] [--revert]

notes

  • use at your own risk
  • automatically creates mapping of original emails to new ones, exported to a csv
  • if your customer uses different account and billing emails, this will only change their account email
  • supports manual approval of changes (with --oversight flag)
  • supports test data generation (with --testdata flag)
  • supports "test mode", in which changes are not pushed to stripe (with --testmode flag)
  • test mode can also be used to create a mapping, if you'd rather not replace customer data, and would instead like to access it using an external record of lowercase emails
  • supports reversion of normalization, using generated mapping (with --revert flag)
  • PRs are welcome

About

deal with unsanitized stripe emails easily: force them to lowercase, or save a mapping

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages