Skip to main content

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

  1. Navigate to your package directory where the setup.py file is located:

    cd path/to/your/package
    
  2. Build the package by running the following command:

    python setup.py sdist bdist_wheel
    
    • This will create a dist/ directory containing your package files.

Step 4: Create a PyPI Account

If you don’t have an account, create one on PyPI.

Step 5: Generate an API Token

  1. After creating your account, go to your PyPI account settings.

  2. 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

  1. 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

  1. Ensure your package is ready (with setup.py, README, etc.).

  2. Install setuptools, wheel, and twine.

  3. Build your package.

  4. Create a PyPI account and an API token.

  5. 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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

learn_python_package_bhupesh-0.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file learn_python_package_bhupesh-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for learn_python_package_bhupesh-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6efb0d685caa30e4fcfdbb577aea214e6e9046374055fa8796bb46a9efb9a9c6
MD5 5dc6eb8eec7104af77a6dd99700221a7
BLAKE2b-256 d0b27bc3703d8cc3d337422e535777e08211228f0a06ac5c3b029f916e58b9f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page