Skip to main content

No project description provided

Project description

hodgepodge

A hodgepodge of hopefully helpful helper code

These are a few of my favourite functions

Features

  • Search for files and directories;
  • Hash files;
  • Pack files into ZIP archives;
  • Perform pattern matching using regular expressions or UNIX-style glob patterns;
  • Compress and decompress objects;
  • Parse dates and times;
  • Read STIX 2.0 objects from local files, directories, or TAXII servers 🚖🚦;
  • Make the outputs from your tools more human-readable (e.g., by pretty-printing dates, file sizes, timestamps, and durations, joining lists with an Oxford comma); and
  • Way, way, way more ✨.

Supported hash algorithms:

  • MD5
  • SHA-1
  • SHA-256
  • SHA-512

Supported archive formats:

  • ZIP

Supported compression algorithms:

  • GZIP

Installation

To install using pip:

$ pip install hodgepodge

To install from source using poetry

$ git clone git@github.com:whitfieldsdad/hodgepodge.git
$ make install

To install from source using setup.py:

$ git clone git@github.com:whitfieldsdad/hodgepodge.git
$ python3 setup.py install

Install or update build dependencies

The following Makefile goal can be used to install or update build dependencies as needed:

$ make update

Tests

You can run the unit tests and measure code coverage at the same time as follows:

$ make test
make test
poetry run coverage run -m pytest
================================= test session starts =================================
platform linux -- Python 3.8.10, pytest-5.4.3, py-1.10.0, pluggy-0.13.1
rootdir: /home/fishet/src/hodgepodge
collected 59 items

tests/test_classes.py ...                                                       [  5%]
tests/test_compression.py ..                                                    [  8%]
tests/test_files.py ............                                                [ 28%]
tests/test_hashing.py ..                                                        [ 32%]
tests/test_patterns.py .....                                                    [ 40%]
tests/test_platforms.py .                                                       [ 42%]
tests/test_stix2.py ......                                                      [ 52%]
tests/test_time.py ...                                                          [ 57%]
tests/test_type.py ......                                                       [ 67%]
tests/test_uuid.py .                                                            [ 69%]
tests/test_ux.py ........                                                       [ 83%]
tests/toolkits/host/file/test_search.py ..........                              [100%]

================================= 59 passed in 5.12s ==================================

A code coverage report will automatically be written to: htmlcov/index.html whenever you run tox.

On Linux systems, you can use xdg-open to open the file using the system's default web browser:

$ xdg-open htmlcov/index.html

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

hodgepodge-0.3.3.tar.gz (18.7 kB view hashes)

Uploaded Source

Built Distribution

hodgepodge-0.3.3-py3-none-any.whl (25.5 kB view hashes)

Uploaded Python 3

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