Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dictdumper

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dictdumper

DictDumper: comprehensive network packet analysis library

  • 0.8.4.post6
  • PyPI
  • Socket score

Maintainers
1

DictDumper

  The dictdumper project is an open source Python program works as a stream formatted output dumper for dict.

  • About
    • dictdumper.Dumper
    • dictdumper.JSON
    • dictdumper.PLIST
    • dictdumper.Tree
    • dictdumper.XML
    • dictdumper.HTML
  • Installation
  • Usage

About

  Currently, it supports following formats --

  • dictdumper.Dumper -- abstract base class of all dumpers
  • dictdumper.JSON -- dump JavaScript object notation (JSON) format file
  • dictdumper.PLIST -- dump Apple property list (PLIST) format file
  • dictdumper.Tree -- dump tree-view text (TXT) format file
  • dictdumper.XML -- dump extensible markup language (XML) file (base class)
  • dictdumper.HTML -- dump JavaScript file under Vue.js framework (DEPRECATED)

 

Installation:

Note that dictdumper supports Python versions 2.7 and all versions since 3.0

pip install dictdumper

 

Usage

dictdumper is quite easy to use. After installation, importation, and initialisation, you can simple call the instance to dump contents.

Take dictdumper.Tree for example

import dictdumper
dumper = dictdumper.Tree('out.txt')
test_1 = dict(
    foo=-1,
    bar='Hello, world!',
    boo=dict(
        foo_again=True,
        bar_again=memoryview(b'bytes'),
        boo_again=None,
    ),
)
dumper(test_1, name='test_1')
$ cat out.txt
test_1
  |-- foo -> -1
  |-- bar -> Hello, world!
  |-- boo
        |-- foo_again -> True
        |-- bar_again
        |     |-- type -> memoryview
        |     |-- value -> 62 79 74 65 73
        |     |-- text -> bytes
        |-- boo_again -> NIL
import datetime
test_2 = dict(
    foo=[1, 2.0, 3],
    bar=(1.0, bytearray(b'a long long bytes'), 3.0),
    boo=dict(
        foo_again=b'bytestring',
        bar_again=datetime.datetime(2020, 1, 31, 20, 15, 10, 163010),
        boo_again=float('-inf'),
    ),
)
dumper(test_2, name='test_2')
$ cat out.txt
test_1
  |-- foo -> -1
  |-- bar -> Hello, world!
  |-- boo
        |-- foo_again -> True
        |-- bar_again
        |     |-- type -> memoryview
        |     |-- value -> 62 79 74 65 73
        |     |-- text -> bytes
        |-- boo_again -> NIL

test_2
  |-- foo
  |     |--> 1
  |     |--> 2.0
  |     |--> 3
  |-- bar
  |     |-- type -> tuple
  |     |-- value
  |           |--> 1.0
  |           |--> --
  |           |     |-- type -> bytearray
  |           |     |-- value
  |           |     |     |--> 61 20 6c 6f 6e 67 20 6c 6f 6e 67 20 62 79 74 65
  |           |     |          73
  |           |     |-- text -> a long long bytes
  |           |--> 3.0
  |-- boo
        |-- foo_again -> 62 79 74 65 73 74 72 69 6e 67
        |-- bar_again -> 2020-01-31T20:15:10.163010
        |-- boo_again -> -Infinity
test_3 = dict(
    foo="stringstringstringstringstringstringstringstringstringstring",
    bar=[
        "s1", False, "s3",
    ],
    boo=[
        "s4", dict(s="5", j="5"), "s6"
    ],
    far=dict(
        far_foo=["s1", "s2", "s3"],
        far_var="s4",
    ),
    biu=float('nan'),
)
dumper(test_3, name='test_3')
$ cat out.txt
test_1
  |-- foo -> -1
  |-- bar -> Hello, world!
  |-- boo
        |-- foo_again -> True
        |-- bar_again
        |     |-- type -> memoryview
        |     |-- value -> 62 79 74 65 73
        |     |-- text -> bytes
        |-- boo_again -> NIL

test_2
  |-- foo
  |     |--> 1
  |     |--> 2.0
  |     |--> 3
  |-- bar
  |     |-- type -> tuple
  |     |-- value
  |           |--> 1.0
  |           |--> --
  |           |     |-- type -> bytearray
  |           |     |-- value
  |           |     |     |--> 61 20 6c 6f 6e 67 20 6c 6f 6e 67 20 62 79 74 65
  |           |     |          73
  |           |     |-- text -> a long long bytes
  |           |--> 3.0
  |-- boo
        |-- foo_again -> 62 79 74 65 73 74 72 69 6e 67
        |-- bar_again -> 2020-01-31T20:15:10.163010
        |-- boo_again -> -Infinity

test_3
  |-- foo
  |     |--> stringstringstringstringstringstringstri
  |          ngstringstringstring
  |-- bar
  |     |--> s1
  |     |--> False
  |     |--> s3
  |-- boo
  |     |--> s4
  |     |--> --
  |     |     |-- s -> 5
  |     |     |-- j -> 5
  |     |--> s6
  |-- far
  |     |-- far_foo
  |     |     |--> s1
  |     |     |--> s2
  |     |     |--> s3
  |     |-- far_var -> s4
  |-- biu -> NaN

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc