Skip to main content

Python dict formatted dumper.

Project description

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 Mmarkup 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,                   # int
    bar = 'Hello, world!',      # string
    boo = dict(                 # dict
        foo_again = True,       # bool
        bar_again = b'bytes',   # bytes (b'\x62\x79\x74\x65\x73')
        boo_again = None,       # NoneType
    ),
)
dumper(test_1, name='test_1')
$ cat out.txt
PCAP File Tree-View Format

test
  |-- foo -> -1
  |-- bar -> hello
  |-- boo
        |-- foo_again -> True
        |-- bar_again -> 62 79 74 65 73
        |-- boo_again -> N/A
import datetime
test_2 = dict(
    foo = [1, 2.0, 3],          # list
    bar = (1.0, 2, 3.0),        # tuple
    boo = dict(                 # dict
        foo_again = 'a long long bytes',
                                # bytes
        bar_again = datetime.datetime.today(),
                                # datetime
        boo_again = -1.0,       # float
    ),
)
dumper(test_2, name='test_2')
$ cat out.txt
PCAP File Tree-View Format

test_1
  |-- foo -> -1
  |-- bar -> Hello, world!
  |-- boo
        |-- foo_again -> True
        |-- bar_again -> 62 79 74 65 73
        |-- boo_again -> N/A

test_2
  |-- foo
  |     |--> 1
  |     |--> 2.0
  |     |--> 3
  |-- bar
  |     |--> 1.0
  |     |--> 2
  |     |--> 3.0
  |-- boo
        |-- foo_again -> a long long bytes
        |-- bar_again -> 2018-03-08 17:47:35
        |-- boo_again -> -1.0

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

dictdumper-0.6.4.tar.gz (63.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dictdumper-0.6.4-py3.7.egg (28.1 kB view details)

Uploaded Egg

dictdumper-0.6.4-py3.5.egg (28.8 kB view details)

Uploaded Egg

dictdumper-0.6.4-py2.py3-none-any.whl (25.8 kB view details)

Uploaded Python 2Python 3

dictdumper-0.6.4-py2.7.egg (26.0 kB view details)

Uploaded Egg

File details

Details for the file dictdumper-0.6.4.tar.gz.

File metadata

  • Download URL: dictdumper-0.6.4.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1

File hashes

Hashes for dictdumper-0.6.4.tar.gz
Algorithm Hash digest
SHA256 029d34b005d669926db2a5039f46b8915ec892adc77d713b83b9b84e11456a4a
MD5 224e76fa4c224ea9cd42c3708fa22b28
BLAKE2b-256 227f219c814af70612d2a8a1422c2fa611f5f827fdaeab2f9bc0c6a2964a66d6

See more details on using hashes here.

File details

Details for the file dictdumper-0.6.4-py3.7.egg.

File metadata

  • Download URL: dictdumper-0.6.4-py3.7.egg
  • Upload date:
  • Size: 28.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1

File hashes

Hashes for dictdumper-0.6.4-py3.7.egg
Algorithm Hash digest
SHA256 04d3f118c8c87f0fb8fdcf980c8137648c008457dade17af27c9145194eaf574
MD5 9d09c727d844c3a6b4b2bd0fec3bdcf7
BLAKE2b-256 970a43737781d07ff2b11d4003aca376bb1344a7821981accd4483b129cb6dd2

See more details on using hashes here.

File details

Details for the file dictdumper-0.6.4-py3.5.egg.

File metadata

  • Download URL: dictdumper-0.6.4-py3.5.egg
  • Upload date:
  • Size: 28.8 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1

File hashes

Hashes for dictdumper-0.6.4-py3.5.egg
Algorithm Hash digest
SHA256 faa5521663ee635015408d79cfc7141a0545070f3a04a454cfd003e24b25d401
MD5 54016a31119194b24fdf28a79e77bf3d
BLAKE2b-256 c438b02b91d894bdc5ea03621c77bd075503272050a5e08229ae593ec24660cf

See more details on using hashes here.

File details

Details for the file dictdumper-0.6.4-py2.py3-none-any.whl.

File metadata

  • Download URL: dictdumper-0.6.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1

File hashes

Hashes for dictdumper-0.6.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6cee1a94af4c859637b78c0e92c91b3205c45000960eefd2d2f4cc1c77fc18a4
MD5 d291feace5526c2a2358bea0e60f97d1
BLAKE2b-256 ea8dd08a4ac31669c6aeda73a651b8c844210b6e7abbe150327f0717fd3efd67

See more details on using hashes here.

File details

Details for the file dictdumper-0.6.4-py2.7.egg.

File metadata

  • Download URL: dictdumper-0.6.4-py2.7.egg
  • Upload date:
  • Size: 26.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1

File hashes

Hashes for dictdumper-0.6.4-py2.7.egg
Algorithm Hash digest
SHA256 a56c66920e4d927f25580ed2ce4d4670d6d2cc0273eddcb8cb8e438a87a9d574
MD5 4ec5f7c0a6a05a4531fe73c83ade3239
BLAKE2b-256 e7517283f4e72c6b54c933b9daf5760fb0c13d2331681fc1ef30ae18bcc432cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page