Skip to main content

Simple data manipulation tool with a bang.

Project description

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 and put them on new lines
❯ cat foo.csv | bombchu -c ip -u -n
10.22.22.11
10.44.44.22
10.13.37.42

❯ # i gotta put this data in to splunk now in term format
❯ cat foo.csv | bombchu -c ip -u -t
(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]

❯ # 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 -jl name -o", "
joe, bob, bob, bob, bob, john, john, bob, bob, susan, susan, bob

❯ # i need these sorted unique and ready to go into splunk
❯ cat tests/foo.log | bombchu -jl name -s -u -sp
("bob", "joe", "john", "susan")

❯ # now throw that on my clipboard
❯ cat tests/foo.log | bombchu -jl name -s -u -sp -cp
("bob", "joe", "john", "susan")

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

bombchu-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

bombchu-0.1.1-py3.9.egg (4.5 kB view details)

Uploaded Source

File details

Details for the file bombchu-0.1.1.tar.gz.

File metadata

  • Download URL: bombchu-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for bombchu-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0dd094e08b593b2bb92443e177154dce9e79c506988aae9f7efa0759bb6f622d
MD5 3d3dc0e7d2f7c84e37bcaa3b62524665
BLAKE2b-256 28b61b85c63609e2f2f654934a1357b9e41be8941920df8159b4a34529c8faff

See more details on using hashes here.

File details

Details for the file bombchu-0.1.1-py3.9.egg.

File metadata

  • Download URL: bombchu-0.1.1-py3.9.egg
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for bombchu-0.1.1-py3.9.egg
Algorithm Hash digest
SHA256 1696f4ac0a5dbe561f8f485700f2152f77d787b9a94202985aee42c1a20320a2
MD5 e077c09f0aab8fc1bd41611c48b47c03
BLAKE2b-256 c72039f91a74324ce858cdda996d4c95afc7c7db6941af0b53392bd25df6411a

See more details on using hashes here.

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