If I import a third-party module, but the syntax that they use does not match mine, is there a good way to pep8 it?
Example. I need to use a third-party module that I cannot edit, and their naming convention is not so great.
Example:
thisIsABase_function(self,a,b)
I have code that converts the name to pep8, but I was wondering how can I make the functions available for this new pep8 name?
def _pep8ify(name): """PEP8ify name""" import re if '.' in name: name = name[name.rfind('.') + 1:] if name[0].isdigit(): name = "level_" + name name = name.replace(".", "_") if '_' in name: return name.lower() s1 = re.sub('(.)([AZ][az]+)', r'\1_\2', name) return re.sub('([a-z0-9])([AZ])', r'\1_\2', s1).lower()
Can I use PEP8 to import these names?
code base 5000
source share