I have a rather large personal python library that I use for projects. I want to release it to the public, but first I wanted to change the name to something a little less silly then the personal anecdote that I named it after.
Lets say I have a library name “FooBarLib” and it is contained within the folder “FooBarLib” and internally it makes references to “import FooBarLib.moduleName” and what have you.
I want to change it to “NewLibName” and have every instance in every file of “FooBarLib” replaced with “NewLibName”.
What is the best way to go about this?
Consider using rope or some other refactoring system to help. IDE’s are better at this sort of thing because they’re configured to know something about how code is being imported.
That said, it would be perfectly reasonable searching for FooBarLib and replacing with NewLibName (as long as FooBarLib was a pretty unique name). Some automated tests would really help to make sure you’ve got everything renamed properly (and don’t forget to check setup.py, documentation files, etc.)