Has your password been leaked in a major breach? You can find out thanks to Have I Been Pwned?… Or you can use their API and stop worrying about your password being sent through your Web browser!
Even for simple tasks, it is often worth basing one’s work on existing solutions when it is an appropriate option… And such can be the case when writing Python scripts!
If you ever wanted to automatically clean your Bash history file, here is a working solution written in Python that uses regular expressions to set any kind of pattern you might be looking for.