One line argument parsing function and decorator
Simple configuration loader
Stream utility with some logging
CSV reader/writer unicode support for Python 2.x (in official document)
Apache accesslog parser
Requirements
Python 2.7 or 3.x
Python 2.4, 2.5, 2.6 are not supported.
Install
Use pip via PyPI.
pip install clitool
Bootstrap
At first, create your script file using module script, clitool.cli.
$ python -m clitool.cli -o your-script.py
This file can parse basic command line options and arguments.
$ ./your-script.py --help
usage: your-script.py [-h] [-c FILE] [-o FILE] [--basedir BASEDIR]
[--input-encoding INPUT_ENCODING]
[--output-encoding OUTPUT_ENCODING]
[--processes PROCESSES] [--chunksize CHUNKSIZE]
[-v | -q]
[FILE [FILE ...]]
positional arguments:
FILE
optional arguments:
-h, --help show this help message and exit
-c FILE, --config FILE
configuration file
-o FILE, --output FILE
output file
--basedir BASEDIR base directory
--input-encoding INPUT_ENCODING
encoding of input source
--output-encoding OUTPUT_ENCODING
encoding of output distination
--processes PROCESSES
count of processes
--chunksize CHUNKSIZE
a number of chunks submitted to the process pool
-v, --verbose set logging to verbose mode
-q, --quiet set logging to quiet mode
Edit this script on your own :D
Examples
Example scripts exist in git repository.
csv2db.py: read csv data and import database via ‘SQLAlchemy’.
csv2gexf.py: read csv data and dump them by GEXF format via ‘NetworkX’.
csv2json.py: read csv data and dump them by JSON format.
csv2kml.py: read csv data and dump them by KML format via ‘simplekml’.
logfile.py: parse Apache access log and create report.
logparams.py: parse Apache access log and analyze query parameters.
Metadata
Release files for clitool 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clitool-0.4.1.tar.gz | 14.6 kB | Without provenance | Details for clitool-0.4.1.tar.gz |
Release files / clitool-0.4.1.tar.gz
| Download URL | clitool-0.4.1.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e64bd17964932b0e5b9a884e66a70e5f422e8984948c5c2296e912e4fb480f4
|
|
BLAKE2b-256 checksum How to use checksums |
03d1f2d0e6fe4af6bee756952860a62a224d356f9c0f0f5874cd4585e5579d76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for clitool 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.