Skip to main content

kcliutils

PyPI - package version PyPI - license PyPI - python version PyPI - downloads

GitHub - last commit GitHub - commit activity

GitHub - code size in bytes GitHub - repo size GitHub - lines of code

GitHub - license

Description

Python cli utils for faster development

Install

pip install kcliutils
# or
pip3 install kcliutils

How to use

npp/new_python_package

  • Run in an empty folder with git checked out
  • Creates a new empty package, with default files, such as .gitignore, README.md, setup.py, demo.py, LICENSE, etc.
# cd to desired folder with .git in it

npp package_name
# or
new_python_package package_name

npp test_package_name will generate

npp result

upp/upgrade_python_package

  • Run in an already existing project folder
  • Updates setup.py with dependencies, bumps version number
  • Updates install_dependencies.sh and requirements.txt
  • Updates readme with dependencies, copies the contents of 'demo.py' to the usage section of the reeadme
  • NOTE: to make this work properly, the packege had to be created with npp.
# cd to desired folder with .git in it

upp
# or
upgrade_python_package

ppp/publish_python_package

  • Calls upp, publishes to pypi and installs the new version
# cd to desired folder with .git in it

ppp "Optional commit message"
# or
publish_python_package "Optional commit message"

prpipush/upgrade_push_install

  • Same as ppp, but without publishing on pypi (for private, github-hosted packages)
# cd to desired folder with .git in it

prpipush "Optional commit message"
# or
upgrade_push_install "Optional commit message"

2. Formatting

cl/clean_lines

  • Cleans the ending useless spaces from every line
# cd to desired folder

cl
# or
clean_lines

migrate_comment_line_len

  • Updates the lengh of each separator comment line generated with the file generators from this package.
# cd to desired folder

migrate_comment_line_len Optional_length_which_defaults_to_your_settings

3. Git

psh/push

  • stages/commits everything and pushes to github
# cd to desired folder

psh "Optional commit message"
# or
push "Optional commit message"

ftch/fetch

  • git fetch
# cd to desired folder

ftch
# or
fetch

pll/pull

  • git pull
# cd to desired folder

pll
# or
pull

4. Pip

pipu/pip_uninstall

  • pip uninstall
pipu PACKAGE_NAME
# or
pip_uninstall PACKAGE_NAME

pipi/pipiu/pip_install

  • pip install -U
pipi PACKAGE_NAME
# or
pipiu PACKAGE_NAME
# or
pip_install PACKAGE_NAME

pipir/pip_reinstall

  • pip uninstall && pip install
pipir PACKAGE_NAME
# or
pip_reinstall PACKAGE_NAME

5. New files

pyreqs/python_requirements

  • creates a requirements.txt file with all the used dependencies
pyreqs
# creates 'requirements.txt'
# or
python_requirements

pif/create_python_install_file

  • creates an install_dependencies.sh file with all the used dependencies
pif
# creates 'install_dependencies.sh'
# or
create_python_install_file

npc/new_python_class

  • creates a python file with a class-like formatting
npc file_name
# creates 'file_name.py' class 'FileName' in it
# also accepts relative path 'relative/path/to/file_name'

# or
new_python_class file_name

generated file contents

# ------------------------------------------- Imports ------------------------------------------ #

# System


# Pip


# Local


# ---------------------------------------------------------------------------------------------- #



# -------------------------------------- class: TestClass -------------------------------------- #

class TestClass:

    # ---------------------------------------- Init ---------------------------------------- #

    def __init__(
        self
    ):
        return


    # ---------------------------------- Public properties --------------------------------- #




    # ----------------------------------- Public methods ----------------------------------- #




    # --------------------------------- Private properties --------------------------------- #




    # ----------------------------------- Private methods ---------------------------------- #




# ---------------------------------------------------------------------------------------------- #

npa/new_python_api

  • creates a python file with a api-like formatting (conforming ksimpleapi)
npa file_name
# creates 'file_name.py' class 'FileName' in it
# also accepts relative path 'relative/path/to/file_name'

# or
new_python_api file_name

generated file contents

# ------------------------------------------- Imports ------------------------------------------ #

# System
from typing import Optional, Dict

# Pip
from ksimpleapi import Api

# Local


# ---------------------------------------------------------------------------------------------- #



# --------------------------------------- class: FileName -------------------------------------- #

class FileName(Api):

# -------------------------------------- Overrides ------------------------------------- #

    @classmethod
    def extra_headers(cls) -> Optional[Dict[str, any]]:
        return {

        }


    # ---------------------------------- Public properties --------------------------------- #




    # ----------------------------------- Public methods ----------------------------------- #




    # --------------------------------- Private properties --------------------------------- #




    # ----------------------------------- Private methods ---------------------------------- #




# ---------------------------------------------------------------------------------------------- #

npe/new_python_enum

  • creates a python file with a enum-like formatting
npe file_name
# creates 'file_name.py' enum 'FileName' in it
# also accepts relative path 'relative/path/to/file_name'

# or
new_python_enum file_name

generated file contents

# ------------------------------------------- Imports ------------------------------------------ #

# System
from enum import Enum

# ---------------------------------------------------------------------------------------------- #



# --------------------------------------- enum: FileName --------------------------------------- #

class FileName(Enum):
    Template = 0


# ---------------------------------------------------------------------------------------------- #

npf/new_python_file

  • creates a python file with a default file formatting
npf file_name
# creates 'file_name.py'
# also accepts relative path 'relative/path/to/file_name'

# or
new_python_file file_name

generated file contents

# ------------------------------------------- Imports ------------------------------------------ #

# System


# Pip


# Local


# ---------------------------------------------------------------------------------------------- #



# ----------------------------------------- Public vars ---------------------------------------- #




# ---------------------------------------- Private vars ---------------------------------------- #




# ---------------------------------------- Private vars ---------------------------------------- #




# ---------------------------------------- Private vars ---------------------------------------- #




# ---------------------------------------------------------------------------------------------- #

npfl/new_python_flow

  • creates a python file with a flow-like formatting (check example)
npfl file_name
# creates 'file_name.py'
# also accepts relative path 'relative/path/to/file_name'

# or
new_python_flow file_name

generated file contents

# ------------------------------------------- Imports ------------------------------------------ #

# System


# Pip


# Local


# ---------------------------------------------------------------------------------------------- #



# ------------------------------------------- Methods ------------------------------------------ #



# -------------------------------------------- Paths ------------------------------------------- #




# -------------------------------------------- Vars -------------------------------------------- #




# -------------------------------------------- Flow -------------------------------------------- #



# ---------------------------------------------------------------------------------------------- #

nps/new_python_subpackage

  • creates a new subpackage at the desired relative path
nps SUB_PACKAGE_NAME_OR_RELATIVE_PATH
# or
new_python_subpackage SUB_PACKAGE_NAME_OR_RELATIVE_PATH

nps test_subpackage will generate

nps result

Dependencies

bullet, jsoncodable, kcu, kdependencies

Metadata

Release files for kcliutils 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kcliutils 0.1.12
File Size Uploaded
kcliutils-0.1.12.tar.gz 21.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kcliutils 0.1.12
File Interpreter ABI Platform
kcliutils-0.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 54.2 kB

Release files / kcliutils-0.1.12.tar.gz

Download URL kcliutils-0.1.12.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
647cf4b9c3f35745917a646e68469b47623c6c75845d2f9556d6e5f8759e5417
BLAKE2b-256 checksum
How to use checksums
f5bf927ecfff0497974a37e1059894da76b33fd4f3f361baeea6b6b1c7775497
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.9

Release files / kcliutils-0.1.12-py3-none-any.whl

Download URL kcliutils-0.1.12-py3-none-any.whl
Size 32.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2694191d42f23084f3d846aa8faac93cdf8f35da3dff7cd5c51c1b1ddb86f4c9
BLAKE2b-256 checksum
How to use checksums
63c5c02ed8720442b011140ee3b9b109b971eb34a27226d7f3e6aaf9e3db5ab9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.9

Release history Release notifications | RSS feed

This release

0.1.12 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.56

2 release files

0.0.52

2 release files

0.0.48

2 release files

0.0.47

2 release files

0.0.46

2 release files

0.0.43

2 release files

0.0.41

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page