0% found this document useful (0 votes)
39 views7 pages

59 Pip - Pypi

The document provides an overview of pip, the Package Installer for Python, and PyPI, the Python Package Index, which serves as a hub for public Python libraries. It includes a step-by-step guide on how to create, build, and upload a Python package to PyPI, along with instructions on installing packages using pip. Additionally, it features information about the author, Gowtham SB, a Data Engineering expert and educator.

Uploaded by

freefirecsk1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views7 pages

59 Pip - Pypi

The document provides an overview of pip, the Package Installer for Python, and PyPI, the Python Package Index, which serves as a hub for public Python libraries. It includes a step-by-step guide on how to create, build, and upload a Python package to PyPI, along with instructions on installing packages using pip. Additionally, it features information about the author, Gowtham SB, a Data Engineering expert and educator.

Uploaded by

freefirecsk1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Gowtham SB

www.linkedin.com/in/sbgowtham/ Instagram - @dataengineeringtamil

Part 1: What is pip?

✅ pip = Package Installer for Python

It’s the tool you use to install external Python libraries.

📌 Example:

pip install pandas

Downloads and installs the pandas library from PyPI.

Part 2: What is PyPI?

✅ PyPI = Python Package Index

It’s a central hub of all public Python libraries, like an app store for
Python packages.

● Website: https://pypi.org

● Developers can upload their packages

● Users can download packages using pip

Part 3: How to Create & Upload a Package to PyPI

🔧 Step-by-step:

🔹 Step 1: Create a simple project folder


Gowtham SB
www.linkedin.com/in/sbgowtham/ Instagram - @dataengineeringtamil
mycalculator/

├── mycalculator/

│ └── __init__.py # Package code

│ └── operations.py # Your logic

├── setup.py # Metadata

├── README.md # Project description

🔹 Step 2: Add some sample code in operations.py

# mycalculator/operations.py

def add(a, b):


return a + b

def subtract(a, b):


return a - b

🔹 Step 3: Create __init__.py


# mycalculator/__init__.py

from .operations import add, subtract

🔹 Step 4: Create setup.py


# setup.py

from setuptools import setup, find_packages


Gowtham SB
www.linkedin.com/in/sbgowtham/ Instagram - @dataengineeringtamil
setup(
name='mycalculator',
version='0.1',
packages=find_packages(),
author='Gowtham SB',
description='A simple calculator package',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
classifiers=[
'Programming Language :: Python :: 3',
],
python_requires='>=3.6',
)

🔹 Step 5: Create README.md


# mycalculator

A simple calculator package with add and subtract.

🔹 Step 6: Build the package

Install build tool:

pip install build

Build the package:

python -m build

You'll get:

dist/
├── mycalculator-0.1.tar.gz
Gowtham SB
www.linkedin.com/in/sbgowtham/ Instagram - @dataengineeringtamil
├── mycalculator-0.1-py3-none-any.whl

🔹 Step 7: Upload to PyPI

Install Twine:

pip install twine

Upload using Twine:

python -m twine upload dist/*

You’ll need a PyPI account and token or password.

Once Approved: Install Your Own Package


Anywhere in the world, people can now install your package:

pip install mycalculator

And use it:

python

from mycalculator import add

print(add(5, 3)) # Output: 8


Gowtham SB
www.linkedin.com/in/sbgowtham/ Instagram - @dataengineeringtamil

Bonus: How to Install a Package in PyCharm

✅ Method 1: Using Terminal (Recommended)

bash

pip install pandas

✅ Method 2: Using PyCharm GUI

1. Go to File > Settings > Project > Python Interpreter

2. Click the + icon

3. Search for the package (e.g., pandas)

4. Click Install Package

Summary:

Task Tool/Command

Install a package pip install packagename

Check installed pip list


packages
Gowtham SB
www.linkedin.com/in/sbgowtham/ Instagram - @dataengineeringtamil

Upload your own twine upload dist/*


package

Package hub https://pypi.org

Create builds python -m build


Gowtham SB
www.linkedin.com/in/sbgowtham/ Instagram - @dataengineeringtamil
About the Author

Gowtham SB is a Data Engineering expert, educator, and content creator with a


passion for big data technologies, as well as cloud and Gen AI . With years of
experience in the field, he has worked extensively with cloud platforms, distributed
systems, and data pipelines, helping professionals and aspiring engineers master the
art of data engineering.

Beyond his technical expertise, Gowtham is a renowned mentor and speaker, sharing
his insights through engaging content on YouTube and LinkedIn. He has built one of
the largest Tamil Data Engineering communities, guiding thousands of learners to
excel in their careers.

Through his deep industry knowledge and hands-on approach, Gowtham continues to
bridge the gap between learning and real-world implementation, empowering
individuals to build scalable, high-performance data solutions.

𝐒𝐨𝐜𝐢𝐚𝐥𝐬

🎥𝐘𝐨𝐮𝐓𝐮𝐛𝐞 - https: //www.youtube.com/@dataengineeringvideos

📸𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - https: //instagram.com/dataengineeringtamil

📸𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - https: //instagram.com/thedatatech.in

🤝𝐂𝐨𝐧𝐧𝐞𝐜𝐭 𝐟𝐨𝐫 𝟏: 𝟏 - https: //topmate.io/dataengineering/

💼𝐋𝐢𝐧𝐤𝐞𝐝𝐈𝐧 - https: //www.linkedin.com/in/sbgowtham/

🌐𝐖𝐞𝐛𝐬𝐢𝐭𝐞 - https: //codewithgowtham.blogspot.com

💻𝐆𝐢𝐭𝐇𝐮𝐛 - http: //github.com/Gowthamdataengineer

💬𝐖𝐡𝐚𝐭𝐬 𝐀𝐩𝐩 - https: //lnkd.in/g5JrHw8q

📧𝐄𝐦𝐚𝐢𝐥 - [email protected]

📱𝐀𝐥𝐥 𝐌𝐲 𝐒𝐨𝐜𝐢𝐚𝐥𝐬 - https: //lnkd.in/gf8k3aCH

You might also like