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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file subhangpack-1.1.0.tar.gz.

File metadata

  • Download URL: subhangpack-1.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for subhangpack-1.1.0.tar.gz
Algorithm Hash digest
SHA256 43c37404ef66f2efd25e77219fcb2fd4b43c4fe78714e3a0f328906198505883
MD5 96cb7af13b854c4fbb2ceccae2ae9356
BLAKE2b-256 63e725269982f2e970979a111b921abf5f4ae8123d0067a975094e25c15d2d6b

See more details on using hashes here.

File details

Details for the file subhangpack-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: subhangpack-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for subhangpack-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07295dbd6d4ac7ef1ce11213f50e25b56c26d037772d52869a7921ece875d313
MD5 be19294fc9ece1df1877f298539095cc
BLAKE2b-256 0425968e90388fc47791764e9e208e0347b3aef9675453e5b8029b2d7e5d44c0

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