Youre too early
Project description
subhangpack
hello namegen
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
Release history Release notifications | RSS feed
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.0.13.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file subhangpack-1.0.13.tar.gz
.
File metadata
- Download URL: subhangpack-1.0.13.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fecb8c161c69819fa3ebe6d5d0152d0ee5a6e6d5be31b454446aa146876a8e1 |
|
MD5 | 9601f90509a85caa9626c06b70d8ec2b |
|
BLAKE2b-256 | 4092e8019e3cbd7611d5c6150674851db5c60639274141e97e48dac6d9a279b5 |
File details
Details for the file subhangpack-1.0.13-py3-none-any.whl
.
File metadata
- Download URL: subhangpack-1.0.13-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae0e2ac4547a75b3ff2085ae2953819e79ba3c9c7b9107faf32eee3f3fc8fe0d |
|
MD5 | c1a79f65f0269cc417636610f9bf9b04 |
|
BLAKE2b-256 | 3db12f085d53846bd9259d0b5d5eebb3e3c90b63c3371962aec38c9aabf77dd9 |