Skip to main content

nah you just started

Project description

subhangpack

hello namegen

Upload Python Package

to install

pip install subhangpack

to use

from subhangpack import namegen

to generate a random name

namegen.gen()

to generate from terminal

subhangpack-devicename

pip package for generating random names for homelab and network devices

noobs guide for making a pip package

0. Install pip

sudo apt install python3-pip

install libraries

pip install wheel
pip install setuptools

1. Make a new folder and cd into it which will be the name of your package

mkdir yourpackagename
cd yourpackagename

2. Make a init.py file in the folder

touch __init__.py

3. Make a py file which will be the main file of your package to say what your package does

touch namegen.py

4. add your module code in the py file to make it work

#write your code here

5. import your module in the init.py file to say that it is a package

from .namegen import *

6. Make a setup.py file

touch setup.py

7. Add the following code in the setup.py file

from setuptools import setup

setup(name='yourpackagename',
      version='0.1',
      description='write a description here',
      url='
        author='your name',
        author_email='your email',
        license='MIT',
        packages=['yourpackagename'],
        zip_safe=False)

8. now package your module for source distribution

python setup.py sdist

9. now use wheel to package your module for build distribution

python setup.py bdist_wheel

10. now install your module to test it locally before publishing it to pypi

pip install yourpackagename.whl

11. now you can use your module in any python file

import yourpackagename

12. now you can upload your module to pypi

pip install twine

13. now upload your module to pypi

twine upload dist/*

14. now you can install your module from pypi

pip install yourpackagename

tada you have made your first pip package

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

subhangpack-1.1.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

subhangpack-1.1.0-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

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