package created for learning purposes
Project description
My Package
This is a simple Python package that provides 3 defs.
Ihave created on 30-10-24 for learning purposes .
Installation
You can install this package using pip:
=================================================================================
Example to use the Package:
import package_a
package_a.greet('Nikhil')
package_a.age_calculator(222)
package_a.tax_calculator(233)
output:
Hello, Nikhil !
your age is : 22 decades and 2 years
tax calculator is here :
your total amount including tax is : 256.3
=============================================================================================
To publish your Python package to PyPI (Python Package Index) so that it can be installed via pip, you’ll need to follow these steps. Since your package is already on GitHub, I assume you have a setup.py file configured. Here’s a concise guide to help you publish your package:
Step 1: Prepare Your Package
Make sure your package has the necessary files:
-
setup.py: Contains metadata about your package.
-
README.md: Provides a description of your package.
-
LICENSE: (optional but recommended) Specifies the license for your package.
-
Any other necessary files.
Step 2: Install Required Tools
You'll need twine to upload your package to PyPI and setuptools to build it. If you haven't installed them, run:
pip install setuptools wheel twine
Step 3: Build Your Package
-
Navigate to your package directory where the
setup.pyfile is located:cd path/to/your/package
-
Build the package by running the following command:
python setup.py sdist bdist_wheel
- This will create a
dist/directory containing your package files.
- This will create a
Step 4: Create a PyPI Account
If you don’t have an account, create one on PyPI.
Step 5: Generate an API Token
-
After creating your account, go to your PyPI account settings.
-
Create an API token for uploading your package.
Step 6: Store Your Token in GitHub Secrets (Optional)
If you want to automate the publishing process using GitHub Actions, store your token in your GitHub repository secrets as explained in the previous responses.
Step 7: Upload Your Package to PyPI
-
Upload using twine:
- Run the following command to upload your package:
twine upload dist/*
- When prompted, enter your PyPI username and the API token you created.
Step 8: Verify Your Package
After uploading, you can verify that your package is available on PyPI by visiting:
https://pypi.org/project/your-package-name/
Step 9: Install Your Package
Now, you can install your package using pip:
pip install your-package-name
Summary
-
Ensure your package is ready (with
setup.py, README, etc.). -
Install
setuptools,wheel, andtwine. -
Build your package.
-
Create a PyPI account and an API token.
-
Upload your package using
twine.
================================================================
To update your Python package with new changes, follow these steps:
1. Make Your Changes Locally
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file learn_python_package_bhupesh-0.5-py3-none-any.whl.
File metadata
- Download URL: learn_python_package_bhupesh-0.5-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
826e2a9b52a2ce9e01e6997000b6a800efdbb2ade0ca859a24d7d8cd7bb7d969
|
|
| MD5 |
5c159fa5e9fe26a4206764a3c035d11c
|
|
| BLAKE2b-256 |
162d7bcc9938e883de505310a9cf6bc4d97d5e6d6e8bad2298fc6c2bd9e79c35
|