Skip to main content

Some handy Python tools

Project description

pxutil

https://github.com/peterjpxie/pxutil/actions/workflows/build_test_publish.yml/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg

Some handy Python utilities

Install from source

python setup.py install
or
pip install .

Build distributions ( Replaced with Actions / cibuildwheel for multiple python versions and platforms)

# build for current python version
rm -rf dist/* && python setup.py sdist bdist_wheel

Build and Test - cibuildwheel locally for current platform

pip install cibuildwheel
# containerized build
cibuildwheel --platform linux .
# cibuildwheel config in pyproject.toml

Publish to pypi ( Replaced with Actions / cibuildwheel for multiple python versions and platforms)

twine upload dist/*

Github Actions

The github action workflow has been configured to run build, test and publish to pypi with cibuildwheel which builds cython extension for multiple python versions and platforms.

The workflow is configured to run manually, not to waste resources on each commit, or automatically when a release is created.

The publish job is executed only when a release is created.

Usage

import pxutil as px
from pxutil import exit_on_exception

px.bash('ls')

px.bashx('ls')

px.grep('ab','abc\ndef')

px.normal_path('~/project/src/../README.rst')

px.trim_docstring('''
    ab
        cd
    ef
    '''
    )

@exit_on_exception
def to_int(any):
    if isinstance(dict):
        return Exception('dict is not supported to convert to int.')
    return int(any)

Test

pip3 install -U pytest tox pytest-cov

git clone https://github.com/peterjpxie/pxutil.git

cd pxutil

pytest # current python version

or

tox # multiple python versions

or

cibuildwheel --platform linux . # multiple python versions in docker

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

pxutil-0.0.17.tar.gz (34.4 kB view hashes)

Uploaded Source

Built Distributions

pxutil-0.0.17-cp39-cp39-win_amd64.whl (21.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pxutil-0.0.17-cp39-cp39-win32.whl (20.5 kB view hashes)

Uploaded CPython 3.9 Windows x86

pxutil-0.0.17-cp39-cp39-musllinux_1_1_x86_64.whl (65.0 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

pxutil-0.0.17-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (61.8 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pxutil-0.0.17-cp39-cp39-macosx_10_9_x86_64.whl (20.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pxutil-0.0.17-cp38-cp38-win_amd64.whl (21.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pxutil-0.0.17-cp38-cp38-win32.whl (20.6 kB view hashes)

Uploaded CPython 3.8 Windows x86

pxutil-0.0.17-cp38-cp38-musllinux_1_1_x86_64.whl (67.0 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

pxutil-0.0.17-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pxutil-0.0.17-cp38-cp38-macosx_10_9_x86_64.whl (20.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pxutil-0.0.17-cp37-cp37m-win_amd64.whl (21.9 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pxutil-0.0.17-cp37-cp37m-win32.whl (20.5 kB view hashes)

Uploaded CPython 3.7m Windows x86

pxutil-0.0.17-cp37-cp37m-musllinux_1_1_x86_64.whl (63.6 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

pxutil-0.0.17-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.3 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pxutil-0.0.17-cp37-cp37m-macosx_10_9_x86_64.whl (20.0 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

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