Bringing your own package

Most of the packages that we've taken a look at so far are very generic—for instance, requests works with HTTP on the client side, while pandas is focused on data analysis. Why should you write your own package with a very specific task in mind that's not necessarily useful or applicable to another person's use case? Simply put, because you'll be the first to benefit!

The main goal that packages solve is to create a deliverable; any new user on a new machine will be able to install the package, as well as all the packages it requires to work properly, at once. As a byproduct, packages remain isolated from the code you write every day. This isolation is a good thing—it makes you, as a package designer, build your packages in a structured and more abstract and extendable fashion. Finally, packages are explicitly versioned. Using version control, you will always be able to run any specific version you need at any moment, without worrying about new features or interfaces breaking your code.

In other words, if the code you've made might be used on more than one project, you definitely should consider converting it into a package. The good news is, it is actually a pretty easy task to do.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.198.36