Sex While Under Quarantine

My wife was bored. Since we began our stay at home under quarantine three weeks ago, Beatrice has gotten so bored it’s pretty much affecting me too. We have watched too many movies on Netflix, TV…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to publish your own Python Package in pypi

The PyPi package index is one of the properties that makes python so powerfull: With just a simple command, you get access to thousands of cool libraries, ready for you to use.

3. You should have installed wheel and twine library. If not then they can be easily installed by the following commands,

4. You should have a working GitHub account.

To create a package, create a folder that is named exactly how you want your package to be named. Place all the files and classes that you want to ship into this folder.

PyPi needs three files in order to work:

The setup.py file contains information about your package that PyPi needs, like its name, a description, the current version etc. Copy and Paste the following Code and replace the Strings with your matching content:

You have previously uploaded your project to your github repository. Now, we create a new release version of your project on github. This release will then be downloaded by anyone that runs the “pip install YourPackage” command.

Here, you define all the dependencies your package has — all the pip packages that you are importing.

This is a short one. Create a new file called “setup.cfg”. If you have a description file (and you definitely should!), you can specify it here:

Now, the final step has come: uploading your project to PyPi. First, open the command prompt and navigate into your the folder where you have all your files and your package located:

Now, we create a source distribution with the following command

We will need twine for the upload process, so first install twine via pip:

Then, run the following command:

You will be asked to provide your username and password. Provide the credentials you used to register to PyPi earlier.

notes:

Twine → used to uploading project builds to pypi

sdist → is used to make a source code artifact that can be uploaded to pypi. it will place this artifact in ./build/ directory as project-name-version.tar.gz

Okay, now let’s test this out. Open your console and type the following command:

It works! Now open the python SHELL/IDLE and import your package.

If you maintain your package well, you will need to change the source code form time to time.

Finally, update your package via pip

I published a python package called Py-AutoML,

checkout :

Add a comment

Related posts:

The Very Moment

The day has finally come. I have been counting down the days in my 2019 horse calendar since January 1st, and now it is here — May 23rd. There are imaginary horse flies in my stomach, but I swat them…

Membuat Panduan Komprehensif untuk Eclipse Pad

Dalam panduan komprehensif ini, kita akan mempelajari fitur, manfaat, dan fungsi Eclipse Pad, sebuah alat canggih yang merevolusi produktivitas dan organisasi. Baik Anda seorang pelajar, profesional…

What does the data tell us?

I recently listened to a great podcast which discussed the concept of ‘body literacy’, and how important it is to educate our young women especially, about their hormones and cycles, before the…