Skip to main content

This creates all the necessary files for creating a python package.

Project description

PIP CREATOR

PIP CREATOR is a command-line interface tool designed to streamline the process of creating, testing, converting, and uploading Python modules to PyPI (Python Package Index). With this tool, developers can easily generate all necessary files and folders for their Python modules, edit or update existing code, create test suites, convert their code to distribution formats, and seamlessly upload their packages to PyPI.

Features

  • File Generation: Automatically create all necessary files and folders for a Python module, including .gitignore, LICENSE, README.md, setup.py, setup.cfg, pyproject.toml, requirements.txt, project/__init__.py, and project/main.py.
  • Customizable Code: Pre-written basic code is provided in the generated files, allowing users to easily edit or update the code according to their requirements.
  • Test Suite Creation: Generate a test folder with the necessary structure for testing the Python module.
  • Conversion to Distribution Formats: Convert Python modules to distribution formats (bdist, sdist, wheel) with automatic validation of necessary files.
  • PyPI Upload: Seamlessly upload Python packages to PyPI using Twine.
  • CLI Guide: Access a short guide within the CLI on how to create, convert, and upload Python libraries.

Installation

pip install pipCreator

Usage

Creating Python Module Files and Folders

pipcreator create <location>

This command will generate all necessary files and folders for a Python module in the specified <location>. The generated files include .gitignore, LICENSE, README.md, setup.py, setup.cfg, pyproject.toml, requirements.txt, project/__init__.py, and project/main.py.

Creating Test Suite

pipcreator create-test

This command will create a test folder with the necessary structure for testing the Python module.

Converting to Distribution Formats

pipcreator convert

Convert the Python module to distribution formats (bdist, sdist, wheel). This command automatically checks whether all necessary files exist before conversion.

Uploading to PyPI

pipcreator upload

Upload the Python package to PyPI using Twine.

CLI Guide

pipcreator guide

Access a short guide within the CLI on how to create, convert, and upload Python libraries.

Examples

Creating files on current opened folder

PS D:\PyModule> pipcreator create ./

        PIP CREATOR v0.1.0

Creating project in current directory: D:\PyModule
The folder will be created in D:\PyModule


    PyModule/__init__.py
    PyModule/main.py
    .gitignore
    LICENSE
    README.md
    setup.py
    setup.cfg
    pyproject.toml
    requirements.txt

Are you sure you want to create the following files in D:\PyModule? (y/n) y
Enter a description for your project: My first python library
Enter keywords for your project: first python library
Enter author name: Rakesh Kanna
Enter author email: rakeshkanna0108@gmail.com
Enter license for your project: MIT
Directory is empty. Creating files and folders...

README.md created successfully. ✔
setup.py created successfully. ✔
setup.cfg created successfully. ✔
pyproject.toml created successfully. ✔
.gitignore created successfully. ✔
License created successfully. ✔
requirements.txt created successfully. ✔
PyModule/__init__.py created successfully. ✔
PyModule/main.py created successfully. ✔

Files Written successfully. ✔

Do you want to check files? (y/n): y

--------------------------------
README.md

# PyModule
My first python library

--------------------------------

--------------------------------
setup.py

from setuptools import setup, find_packages

with open("README.md", "r", encoding="utf-8") as fh:
    long_description = fh.read()

setup(
    name="PyModule",
    version="0.1.0",
    description="My first python library",
    author="Rakesh Kanna",
    author_email='rakeshkanna0108@gmail.com',
    licence="MIT",
    long_description=long_description,
    long_description_content_type="text/markdown",
    packages=find_packages(),
    keywords=['first', 'python', 'library'],
)

--------------------------------

--------------------------------
setup.cfg

[metadata]
name = PyModule
version = 0.1.0
description = My first python library
author = Rakesh Kanna
author_email = rakeshkanna0108@gmail.com
license = MIT
keywords = first, python, library

[options]
packages = find:
python_requires = >=3.6

--------------------------------

--------------------------------
pyproject.toml

[tool.poetry]
name = "PyModule"
version = "0.1.0"
description = "My first python library"
author = "Rakesh Kanna"
author_email = "rakeshkanna0108@gmail.com"
license = "MIT"
keywords = ['first', 'python', 'library']
[tool.poetry.dependencies]
python = ">=3.6"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

--------------------------------

--------------------------------
requirements.txt
# your requirements here


--------------------------------
.gitignore

# Byte-compiled / optimized Python files
__pycache__/
*.pyc
*.pyo
*.pyd

# Virtual environment
venv/
env/
*.env

# Compiled files
*.o
*.class
*.dll
*.exe

# Temporary files
*~
*.swp
*.log

# Miscellaneous
.DS_Store
.idea/
.vscode/

--------------------------------

--------------------------------
PyModule/__init__.py

from .main import main

__all__ = ["main"]

--------------------------------

--------------------------------
PyModule/main.py

def main():
    print("Hello, World!")

--------------------------------


All files created successfully. ✔
Your project folder is ready to use.

         cd D:\PyModule

Rakesh Kanna
Happy Coding!

You can also create in different loaction using

pipcreator create ./NewModule
pipcreator create NewModule
pipcreator create ../New/NewModule

Creating Test Folder

PS D:\PyModule> pipcreator create-test

        PIP CREATOR v0.1.0

Test folder will be created in current directory: D:\PyModule
Project name: PyModule

Folder contains all required files. ✔
PyModule/test.py created successfully. ✔
Test Folder has been created successfully! ✔

Do you want to check the test folder? (y/n): y

--------------------------------
test/test.py
--------------------------------
import unittest
from PyModule import hello

# Define a test class
class TestHelloFunction(unittest.TestCase):

    def test_hello(self):
        # Call the hello() function
        result = hello()

        # Assert the result
        self.assertEqual(result, "Hello, World!")

if __name__ == '__main__':
    unittest.main()
--------------------------------


Rakesh Kanna
Happy Coding!

Converting to sdist bdist wheel file

PS D:\PyModule> pipcreator convert    

        PIP CREATOR v0.1.0

Uploading files will happen in current directory: D:\PyModule
Project name: PyModule

Folder contains all required files. ✔
Are you sure you want to convert to sdist and bdist? [y/n]: y

<Convertion process>

Command executed successfully. ✔

Files Converted successfully. ✔

Rakesh Kanna
Happy Coding!

Uploading your module to PyPI

PS D:\PyModule> pipcreator upload 

        PIP CREATOR v0.1.0

Uploading files will happen in current directory: D:\PyModule
Project name: PyModule


Make sure you have an account and genrate a API key at https://pypi.org
Are you sure you want to convert to sdist and bdist? [y/n]: y
Folder contains all required files. ✔
This will use twine to upload the package. 

<uploading process>

Package has uploaded/not uploaded as per the twine

Rakesh Kanna
Happy Coding!

Guide

PS D:\PyModule> pipcreator guide 

        PIP CREATOR v0.1.0

Author:Rakesh Kanna

Let's get started!

1.  On first let create the project folder.
    USE: pipcreator create <location>
    this command will create the project folder in the location specified.

2.  Edit the inner folder files that as same name as the project folder.

3.  Edit the folder as you want and have a __init__.py file, to initiate the project.

4.  Also Edit the README.md, setup.py, setup.cfg, pyproject.toml and requirements.txt file.
    for more metadata information and setup details.

5.  Convert the project folder to python package.
    USE: pipcreator convert
    this will create the wheel and sdist for the project.

6.  Upload the project folder to pypi.
    USE: pipcreator upload
    this will upload the project folder to pypi.
    this command uses twine. to upload the project folder to pypi.
    make sure you have an account on https://pypi.org .

you can also refer some YouTube videos for more guidence.
https://www.youtube.com/results?search_query=how+to+create+a+python+library

Rakesh Kanna
Happy Coding!

Video

Video thumbnail

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

Author Details

Author : Rakesh Kanna
Mail : rakeshkanna0108@gmail.com
GitHub : PipCreator
PyPI : PipCreator

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

pipCreator-0.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

pipCreator-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file pipCreator-0.1.0.tar.gz.

File metadata

  • Download URL: pipCreator-0.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pipCreator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 78c3dbed3bd77501896fb7ec6f23b9f9666f0033064dc8a4687f94a3bcdae8e7
MD5 b3e7992bacb7414f8f827b582fe7831e
BLAKE2b-256 1a839dfee994d150ceea6c66b36186455a41733138a589b6b584a43a3cffdd77

See more details on using hashes here.

File details

Details for the file pipCreator-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pipCreator-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pipCreator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aec0bd4bd5bab1235d7a3a0f3170b4585162e94a554f4b2cc10aad0f2087708a
MD5 6c56501504a070f6a3af7019a966b464
BLAKE2b-256 18619ad968ce4bb7d699bc8a59b4c7dbffd4ff0651c079848d48eaa4e696df98

See more details on using hashes here.

Supported by

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