Boilerplate for Publishing Python Packages.
Project description
e@rthw0rm
A python package by Shubham Thakur
Hello All !
This is the Second release of my python package. Basically this is like a boilerplate for creating your own python package.
Can it tell me my future ?
--> Can you ?
Will it help me invest in the right cryptocurrency ?
--> No
Okay Then, What it does ?
--> Basically, Nothing :P , You can clone this repo and simply edit it and publish it to either test PyPi or Live PyPi.
Wait, It does Nothing at all ?
--> It can do a few things allright. See the examples below.
Note : Make sure you Install and Import this package first.
Install Command - pip install earthworm-shubhamt619
Import like this import earthworm
Example 1 : Saying Hello
To say hello to a person, all you have to do is call sayHello()
like,
earthworm.sayHello("Shubham")
Output is
Hello there Shubham !
Example 2 : Saying Hi
To say Hi to a person, all you have to do is call sayHi()
like,
earthworm.sayHi("Shubham")
Output is
Hi there Shubham !
Example 3 : Saying PipPip
To say PipPip to a person, all you have to do is call sayPipPip()
like,
earthworm.sayPipPip("Shubham")
Output is
PipPip Shubham !
Upload my package
Okay, I have made changes to this repo, How to upload it to PyPi ?
-> 1] Make account on [https://test.pypi.org] and [https://pypi.org]
-> 2] Create a file in your $HOME with name .pypirc
with the following.
[distutils] index-servers= pypi testpypi
[pypi] username: <YOUR_USERNAME> password: <YOUR_PASSWORD>
[testpypi] repository: https://test.pypi.org/legacy/ username: <YOUR_USERNAME> password: <YOUR_PASSWORD>
3] Then install required packages - setuptools and wheel
sudo python3 -m pip install --user --upgrade setuptools wheel
For Python 2.*
sudo python -m pip install --user --upgrade setuptools wheel
4] Go to the root directory of your package (Where setup.py
exists) and run the following command.
sudo python3 setup.py sdist bdist_wheel
This will generate a dist/
folder for uploading to test pypi
or pypi
.
5] Install twine
sudo python3 -m pip install --user --upgrade twine
Twine helps you upload your packages to test pypi
and pypi
very easily.
Final Step
6] Upload your package ! ! !
For test pypi
sudo python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
For PyPi
sudo python3 -m twine upload dist/*
Hey, How can i update my package ?
-> The same way you uploaded the package. First Make version change in setup.py
and increment the version.
e.g. 0.0.1 -> 0.0.2
After that, repeat step 4 and 6 to generate dist/
and reupload newer version of your package.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for earthworm-shubhamt619-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f112c6f0b390b457f7d2fec6651aca6b062afb54c923a46c8156a84e18c96bb |
|
MD5 | b77dd6b4b2980c974c8aa0837b25a382 |
|
BLAKE2b-256 | 31f8d022f4dd958e1c916ec0e02bf660b3c698b8f0949b6660f98abdf3d33b3e |
Hashes for earthworm_shubhamt619-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dd2d0ccab60038f890f9c11bd365b3829d579c1977e94e1b30778953b187c5c |
|
MD5 | 529f1492d02082bd3ba2a1ee0adaab55 |
|
BLAKE2b-256 | 559ab89a589215c2115e19531074c6acb37b70e0b23d59e2fc91e115ec5e7190 |