Skip to main content

A package to provide you Chocochip cookies

Project description

Chocochip

This is my first repository that will be published to PyPI

Goal 1: Publishing to PyPI

Creating project structure

  1. Clone the Github repository locally.
  2. Create a subfolder with the same name as the package. We will refer this as primary subfolder.
  3. Create a file named init.py inside the primary subfolder
  4. Inside the primary subfolder create a python file with the same name as the package name.
  5. Create a file named requirements_dev.txt

Adding requirements

  1. First of all identify the latest versions of pip and wheel and add them to the requirements_dev.txt
  2. Now install it using pip install -r requirements_dev.txt

Adding first function

  1. Now add code to your main python file. In my case its chocochip.py
  2. Here is my code snippet
def give_me_a_cookie(name: str):
    """This function gives a cookie to the person who calls it

    Args:
        name (str): Name of the person

    Returns:
        str: Name of the person
    """
    print(f'Hi {name}! Here is your cookie again and again')
    return name

Add setup.py file

Here is my template

from setuptools import setup, find_packages

with open("README.md", "r") as readme_file:
    readme = readme_file.read()

setup(
    name="chocochip",
    version="0.0.1",
    author="Vignesh Baskaran",
    author_email="vignesh.sbaskaran@gmail.com",
    description="A package to provide you Chocochip cookies",
    long_description=readme,
    long_description_content_type="text/markdown",
    url="https://github.com/VigneshBaskar/chocochip",
    packages=find_packages(),
    classifiers=[
        "Programming Language :: Python :: 3.7",
        "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
    ],
)

Install twine

  1. Find the latest version of twine on PyPI
  2. Add it to the requirements_dev.txt and install it using pip install -r requirements_dev.txt

Commiting and Pushing the code to Github

  1. Add and commit the modified files until now. In my case they are:
    1. README.md
    2. requirements_dev.txt
    3. chocochip/init.py
    4. chocochip/chocochip.py
    5. setup.py
  2. Push the files to remote branch

References:

  1. https://towardsdatascience.com/build-your-first-open-source-python-project-53471c9942a7
  2. https://stackoverflow.com/a/33685899/6882624

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

chocochip-0.0.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

chocochip-0.0.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file chocochip-0.0.1.tar.gz.

File metadata

  • Download URL: chocochip-0.0.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.10

File hashes

Hashes for chocochip-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f0c99c63f45784a8722b930ce153fb9a12fd2ee85de03484649ca2f64eacbe36
MD5 6b8fa61b582cebf204038ef102eb0e16
BLAKE2b-256 0a545a6ce7eedbd6e0ba93829d27f22015400ec05f017bf672c2687bb570d256

See more details on using hashes here.

File details

Details for the file chocochip-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: chocochip-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.10

File hashes

Hashes for chocochip-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69ff484ee00d63607a7c761a48901a3e8dd8993a85b2aee0b8ca5ac98cee609d
MD5 c124bdf01bdff4f3d74cb3b456dc188b
BLAKE2b-256 3465132abe8313aad1619dbfe15cfa63552919c1d8c26cb570b417b9ebf928d8

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