bombchu
Simple data manipulation tool with a bang, inspired by qu.
Install
pip3 install bombchu --user
- Ensure that where Python cli tools are installed on your system is in your PATH.
Usage
❯ # break on a delimiter
❯ echo "d,d,b,a,a,b,c,d,d,e" | bombchu -d ','
['d', 'd', 'b', 'a', 'a', 'b', 'c', 'd', 'd', 'e']
❯ # same thing, but sort unique
❯ echo "d,d,b,a,a,b,c,d,d,e" | bombchu -d ',' -s -u
['a', 'b', 'c', 'd', 'e']
❯ # now output it separated by semi-colons
❯ echo "d,d,b,a,a,b,c,d,d,e" | bombchu -d ',' -s -u -o '; '
a; b; c; d; e
❯ # i got some csv data that looks like this...
❯ head -n 2 foo.csv
start_time,ip,port
"2022-04-10 06:00:10",10.13.37.42,51111
❯ # let's extract all the unique ips sorted and put them on new lines defanged
❯ cat foo.csv | bombchu -c ip -u -n --defang --sips
10[.]13[.]37[.]42
10[.]22[.]22[.]11
10[.]44[.]44[.]22
❯ # i gotta put this data in to splunk now in term format
❯ cat foo.csv | bombchu -c ip -u --term
(TERM(10.22.22.11) OR TERM(10.13.37.42) OR TERM(10.44.44.22))
❯ # now i got some json data that looks like this...
❯ cat foo.json
{
"foo": {
"id": 1234
},
"foo2": {
"id": 1337
},
"foo3": {
"id": 1111
}
}
❯ # i need all these ids sorted
❯ cat foo.json | bombchu -j id -s
[1111, 1234, 1337]
❯ # gimme those ids on new lines with back ticks
❯ cat foo.json | bombchu -j id -s -n --add '`'
`1111`
`1234`
`1337`
❯ # now i got some log file that looks like this...
❯ head -n 2 foo.log
{"name": "joe", "id": 4242, "action": "bleh"}
{"name": "bob", "id": 1337, "action": "blah"}
❯ # let's see the users in these logs
❯ cat foo.log | bombchu -l name -o ', '
joe, bob, bob, bob, bob, john, john, bob, bob, susan, susan, bob
❯ # now i need unique users and ids next to each other
❯ cat foo.log | bombchu -l id,name -n -s -u
1337,bob
1337,john
1337,susan
4242,joe
❯ # i need these sorted unique and ready to go into splunk
❯ cat foo.log | bombchu -l name -s -u --splunk
("bob", "joe", "john", "susan")
❯ # now throw that on my clipboard
❯ cat foo.log | bombchu -l name -s -u --splunk --copy
("bob", "joe", "john", "susan")
❯ # read in a python list
❯ echo "['62', '41', '27', '111', '55']" | bombchu -p --addl '=' -n
=62
=41
=27
=111
=55
Metadata
Release files for bombchu 0.1.3
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 | |
|---|---|---|---|---|
| bombchu-0.1.3.tar.gz | 3.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bombchu-0.1.3-py3.9.egg | Legacy Egg format | - | - | Details |
Total release size: 9.3 kB
Release files / bombchu-0.1.3.tar.gz
| Download URL | bombchu-0.1.3.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f3a7f06bb4972ed121262409879793876e7623650dcae83a2f62441c2596119
|
|
BLAKE2b-256 checksum How to use checksums |
f517d9d442837248f448ed6672999948cfead763320f96bdf12f1eff15fe8ba9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
|
Release files / bombchu-0.1.3-py3.9.egg
| Download URL | bombchu-0.1.3-py3.9.egg |
|---|---|
| Size | 5.8 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
4e52a15e589fbb309ccbd63f13b626e30ee107e84987ef3c27aae17cdfd2e50f
|
|
BLAKE2b-256 checksum How to use checksums |
36f57c2f04418a01f81210ac5bf1d182eb948efedd5f5340326e733b2fd6ddf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
|
Security for bombchu 0.1.3
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.