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.5.post2.tar.gz (63.2 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.5.post2-py3.7.egg (28.3 kB view details)

Uploaded Egg

dictdumper-0.6.5.post2-py3.5.egg (29.0 kB view details)

Uploaded Egg

dictdumper-0.6.5.post2-py2.py3-none-any.whl (25.9 kB view details)

Uploaded Python 2Python 3

dictdumper-0.6.5.post2-py2.7.egg (26.3 kB view details)

Uploaded Egg

File details

Details for the file dictdumper-0.6.5.post2.tar.gz.

File metadata

  • Download URL: dictdumper-0.6.5.post2.tar.gz
  • Upload date:
  • Size: 63.2 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.5.post2.tar.gz
Algorithm Hash digest
SHA256 96d4d0910662d8e21e2c1900bb5438dbb2562e680bda34be2d9cf1434e8b0416
MD5 778d064621a651f6f3c06315b989bb66
BLAKE2b-256 e7f7fa8b1c68cb02270e58852c178d4d4eea099e2806e0da9ca7fcc7920b4463

See more details on using hashes here.

File details

Details for the file dictdumper-0.6.5.post2-py3.7.egg.

File metadata

  • Download URL: dictdumper-0.6.5.post2-py3.7.egg
  • Upload date:
  • Size: 28.3 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.5.post2-py3.7.egg
Algorithm Hash digest
SHA256 e2a4df94e391ab9b949c6d334e5b196296eb83314743c23d08ef2edbaf46c44a
MD5 dfd31d5cbc6e353a1a34792eda1674fc
BLAKE2b-256 52f58f3caf4460d1b12522fef4d6fdb9a4cd93543f4a9fde0da6b5dcd2d6800e

See more details on using hashes here.

File details

Details for the file dictdumper-0.6.5.post2-py3.5.egg.

File metadata

  • Download URL: dictdumper-0.6.5.post2-py3.5.egg
  • Upload date:
  • Size: 29.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.5.post2-py3.5.egg
Algorithm Hash digest
SHA256 2c1784be6a74a70fc0e6aa93128475b3f598c3c44f9a6d001d6b179b3f4c8157
MD5 92e088f6a623cb8aa9c2ef95d78c11c0
BLAKE2b-256 2307963d018e861097f4fac2bc73fe80c98baa77972816b19abb462616dbfba4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dictdumper-0.6.5.post2-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.9 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.5.post2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 923afb12aba46cc0cba6fadcfce92337e42dc864fac4dea21b5822533d131ad3
MD5 84b41772f927513da5dce89fbe6d1d78
BLAKE2b-256 aac71d54361e2a432510b6bc2083e3d05f83cc3cb86f8f8e6ab0992b777f17d3

See more details on using hashes here.

File details

Details for the file dictdumper-0.6.5.post2-py2.7.egg.

File metadata

  • Download URL: dictdumper-0.6.5.post2-py2.7.egg
  • Upload date:
  • Size: 26.3 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.5.post2-py2.7.egg
Algorithm Hash digest
SHA256 bf9c1cc2726648ae17b1902489e4a7b6027b82965ea01e1685482ac9354b9f1c
MD5 710fa2963a911f4d668010da0581976f
BLAKE2b-256 d8115fc2a071e093412ad07084df6f7dc6a8003b736298baa96762d92eeb47ae

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