Some handy Python tools
Project description
pxutil
Some handy Python utilities
A sample to learn Python packaging
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
# build with docker
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 - Functions
import pxutil as px
# run a command and capture stdout, stderr
r = px.bash('ls')
print(r.stdout)
# run a command like bash -x, not capture stdout, stderr
px.bashx('ls')
px.grep('ab','abc\ndef')
# normalize a path, by default no symlink resolution
px.normal_path('~/project/src/../README.rst')
px.trim_docstring('''
ab
cd
ef
'''
)
# change work directory
with px.set_work_path("~") as p:
os.listdir()
# import any module in a path
conf = px.import_any('~/config/config1.py')
print(conf.server_ip)
# exit program if return value is an exception
@px.exit_on_exception
def to_int(any):
if isinstance(dict):
return Exception('dict is not supported to convert to int.')
return int(any)
Usage - CLI
px.loop -h # run a command in loop
px.chat -h # chat cli based on chatGPT
px.runc -h # compile and run single c file with gcc
Test
git clone https://github.com/peterjpxie/pxutil.git
cd pxutil
pip3 install -r tests/requirements.txt
pytest # current python version
or
tox # multiple python versions
or
cibuildwheel --platform linux . # multiple python versions in docker
Places to Update Supported Python Versions
setup.py # pypi description
tox.ini # tox test
pyproject.toml # cibuildwheel
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
pxutil-0.0.24.tar.gz
(61.1 kB
view hashes)
Built Distributions
Close
Hashes for pxutil-0.0.24-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81f026bb2698099015d1fe1a35b267696e3ee551161b9e3e34a01b55b5708b6f |
|
MD5 | 2ecc7dd8347f1d522b1e83b39aa5da08 |
|
BLAKE2b-256 | a6c393e527332b754029608b454caa136418173cb7a3ad7a112d3062580e2b1f |
Close
Hashes for pxutil-0.0.24-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d37d941b1790d7c8644206446013316f69af53e55bd6e095abcfcf06331c2d7 |
|
MD5 | 21929e12a7efc86da7848fad4d22eaab |
|
BLAKE2b-256 | 0d995f48d42215dba1635455711fd17a11b2ed7d72aa31db46b92b104643ff76 |
Close
Hashes for pxutil-0.0.24-cp312-cp312-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d60e493e0e7d8ec4016b74f3befc1a08d72af454ad785a93702590c0d7a1ac8 |
|
MD5 | b06a2d7045bd2d5cb3e2d73859924022 |
|
BLAKE2b-256 | 9fe1eb0aa568a9fdb2bfb9382bf193ec4ef9b714cdbe183707f62586438aa83e |
Close
Hashes for pxutil-0.0.24-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3deca18c565b454d7e0a436eb45a7a1d03317f1e028cdfaecc071c25a2de3b7 |
|
MD5 | 71d879191a81800254cb329a80059d5d |
|
BLAKE2b-256 | 5b3ab06add09394e386681285027870195a7f66a72817d787f560df00e77a7e5 |
Close
Hashes for pxutil-0.0.24-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e065e949717f04066245c7cf213433d8110923fc2f207fb6a8f88270a6791bcb |
|
MD5 | ef29b849508e8af63dc4c235d3bc07ed |
|
BLAKE2b-256 | 4a125cd5655216a45d107a44330f5fc5e3344ba8b57f72c59e738380636c4315 |
Close
Hashes for pxutil-0.0.24-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a32eb7a8b497c0575db016f6c8845b13e02c740a46b50ce3ca3d84c2c17d7b2 |
|
MD5 | 3dc45a500c4c97ec4fcc797cb3e642e5 |
|
BLAKE2b-256 | c30b85a5c12641baa830f1016ae902e2563383fca6d6e9d8419b52485d3c55fe |
Close
Hashes for pxutil-0.0.24-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 170206d32202fe3530e6605b7d940cb0043b85db49870b66ba1f566ec6c24387 |
|
MD5 | 9929bcab11df88185c8a8951bbb8b866 |
|
BLAKE2b-256 | 28cb7e056f9c10c24e3ae09d980f943d0af9dd31953f5c2640d5a649280e56f0 |
Close
Hashes for pxutil-0.0.24-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de4bebd23e750e3bdb423469ae0a253c100c73c1dcca358a6802f73840bf0304 |
|
MD5 | ae3eb77d65c85031e9177a8c18cc6eaa |
|
BLAKE2b-256 | 1d853ad3e6696189087f0fafbb80a99e9d143a1507b51f0f9486e4af8050a636 |
Close
Hashes for pxutil-0.0.24-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a4842b1922a4ebd8f9d3a29412b74f39e85a4072211c4a0928021b2cd208a4e |
|
MD5 | cd739420f37cb9c98a508c3f81680e5f |
|
BLAKE2b-256 | 0d416677d5f3891bf4dcf5c0196c01baaddc95761f8454569f98c6fecc132437 |
Close
Hashes for pxutil-0.0.24-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09aff242ace7bb71eca915caee59fa426860e56a275e0d0e0bf9575ac5ba7ff6 |
|
MD5 | 54154bf855d1e95711d1ed117257bdcd |
|
BLAKE2b-256 | 9397832c08542ba91200338e23a45c51b6a201092d29c54a59915207605d0b66 |
Close
Hashes for pxutil-0.0.24-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8162cf4af98e31e06da8ce12e39c0b86614658941d696f9a632572d690fa9093 |
|
MD5 | 0230c0152fb1824e1d31603ecf94f3ac |
|
BLAKE2b-256 | 007cdb60be5bd633e701a855a99d1656a5c2c727aaa2d6b8c206c887745a24e4 |
Close
Hashes for pxutil-0.0.24-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9291cffd0d6e15353942258c65a874f29dc5b4a0b9c4d88edb02d8cbbca674eb |
|
MD5 | 30d6bd6cac84bcd7901b86f6103e83b4 |
|
BLAKE2b-256 | 8b1a349232b9e7de12cf0aa451ce6c26b7eca694782ae64c300c10ae6c4540d9 |
Close
Hashes for pxutil-0.0.24-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3445d438648af0db7c5fe8460a39ff007793bf6386c3ddab78cbf7a1f1dd25fd |
|
MD5 | 2416bc21c0ad1979fab43909d76628ca |
|
BLAKE2b-256 | 29f2ad34430bb90ffec046db83a414ce2402ea06bcc50b68e90c2b9c95837b4c |
Close
Hashes for pxutil-0.0.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 333e514624eb6f09749ddf169e81ca7d103b00a41cad1dc738dc28978ef2ba2c |
|
MD5 | 16f613d1c37e1958f63998353b39d735 |
|
BLAKE2b-256 | c196cccbcb88a4e2b692ee162e955cbcc256731776e24327ef2c771d894db68b |
Close
Hashes for pxutil-0.0.24-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5686b659d5351ed59b1d3f16835a96b738fda469fbfa7c722db4a2b630ddf1e4 |
|
MD5 | f96b0e3543eb29c49e69e9e3584aa17b |
|
BLAKE2b-256 | afac030c43e10adeb22de864de11bca21bce6a7ca13c3e75c0888091c13a3fe3 |
Close
Hashes for pxutil-0.0.24-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f147d50fcc5dc90a1f3d649dd5c8275ec0bea9c3ab761d75116f46c2ba48a1b1 |
|
MD5 | fe0f92368c6a2dc8f5128b372cd07f02 |
|
BLAKE2b-256 | 9ef3c7ef36aea57f6db7283a5aace429cc22860910f5d6efab13f116515f0bf4 |
Close
Hashes for pxutil-0.0.24-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce1e4bcff2371263609ee2334714c62f83ba76e7394a30d32c9c3542999b58c |
|
MD5 | acac10cb1761e54cf08f3622abd41f55 |
|
BLAKE2b-256 | de35e52a78d5ec5da345618e28d7bf5bece4444fc05aa9ea0ac75146c4f9585a |
Close
Hashes for pxutil-0.0.24-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e3a23d0c3cef0a82c7eea298ed53b6ceb0498004c2c09269c108718301023d6 |
|
MD5 | 7718179981f11ae280ce19c0a3160787 |
|
BLAKE2b-256 | a503a64a18affa4d2cd0962dc0c01fe20cfca7f77ec92c6e250eb53fcbda014d |
Close
Hashes for pxutil-0.0.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a5faba4b292582baba10287f7f774a1b29d55b9a251ae758b61418ec3b838e1 |
|
MD5 | 1ec1ce823c0d1d21636e07bdac100e79 |
|
BLAKE2b-256 | a9b20395d5432dc34fc8dcaab2f2fae61aa9bef67476d55e8d017fffd66d71fe |
Close
Hashes for pxutil-0.0.24-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 318b9a1753982d36ecff302670d88db3ef7aea56d94dbd60f48c877f9545930a |
|
MD5 | de422ff9f3833486ac5d400745055ecb |
|
BLAKE2b-256 | 4f9cf1684b0b2af7c1ab6198c0a141377ed19386fcaa1c2f9da33b28648bdb9c |
Close
Hashes for pxutil-0.0.24-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53d3fc68715360396f5f600a20420939a15ad3da2a5d88c36c18492f00df4043 |
|
MD5 | b453a499b6f010817ce35b090096bf03 |
|
BLAKE2b-256 | 8ce7ee6e00e76bc6db8d932444f730c9b118684d753443f816bff4c4365df791 |
Close
Hashes for pxutil-0.0.24-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65f74ea0663c5227a44ae3a508bfb7133d9ae75a17b74d035de4e290dc7df4b4 |
|
MD5 | 0812d4dff293b17dd6d65281a88b2b79 |
|
BLAKE2b-256 | 5100a564311cf3dd1ecf0222bfbe62fa1204a60c4ae55375291e6f669000d6f1 |
Close
Hashes for pxutil-0.0.24-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c9f974357afb90b13aa1979db7e679e2d49302c904fc03280dc5eacba410f35 |
|
MD5 | 01e2cfc21a0149d23b10d534ae0bd5c0 |
|
BLAKE2b-256 | 4666cfe825e7bc38e713e317e4f92340ae4678006eaf59d50fe4020f6bc1cb78 |
Close
Hashes for pxutil-0.0.24-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1670eeb5ec312078d2b16b59481bb7711b7a7f88040ed281c950e0e20fc4d3d4 |
|
MD5 | 19de4a5a6174a9f30d1ff15d08fd2497 |
|
BLAKE2b-256 | 08c34584ac56747806d4a7a85ddf3389f1d2338a92c353be843d323616d4899c |
Close
Hashes for pxutil-0.0.24-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d21b8fbd5cc09e6933d38826d3bece0481fe47b2c259690d12f01b853af0acd4 |
|
MD5 | 48a7c1baf2e87bb387dfe1efd6bd6cf3 |
|
BLAKE2b-256 | 78e8a712a4988c59d81a9f7dcedc115546c16f0c9869fd164f3b1ec4ea0b382e |