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

Uploaded Egg

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

Uploaded Egg

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

Uploaded Python 2Python 3

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

Uploaded Egg

File details

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

File metadata

  • Download URL: dictdumper-0.6.5.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.5.tar.gz
Algorithm Hash digest
SHA256 808d628ae622f50454485a398352710a995044ecaf8dcecfb3446945fa1b50ea
MD5 07deb6a8ae13d6f41ff18b25400179fa
BLAKE2b-256 74717923d153a0e5db83473f7ca60479916be1ec009a312136acfb9709622679

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dictdumper-0.6.5-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-py3.7.egg
Algorithm Hash digest
SHA256 834a76e3f498479507128d56e112afe6a1fde6478a87747504758bfb2f10785d
MD5 d0425b0891dc1323cc1e0c8ffb7f428b
BLAKE2b-256 c42df28b912e5a7cf95000b47719c37f2295aa3c16d2a2432200f1de930b62f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dictdumper-0.6.5-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-py3.5.egg
Algorithm Hash digest
SHA256 3d981d935c612f034a3c9badd8420d223dfcb99fb6e3bc408a8b2e50ee32b9ac
MD5 1fc3ed66cbbe3a1278083b3010ed815c
BLAKE2b-256 ea1214e8a8586854dcd3a7c2ba85325e2212a0c16840ddb4c6cdd4f198652042

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dictdumper-0.6.5-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-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bd1c653540b2db913e9476e551bfd7bf97150fdd8ba3b0ce517da2535337c4e5
MD5 f51225ffd362f206aa3c008c26e4eada
BLAKE2b-256 7a8198e2a47a992c2738b2743bc08210747763579dba00436c99cb68d2747b5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dictdumper-0.6.5-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-py2.7.egg
Algorithm Hash digest
SHA256 9f7fd4615bd1854a162f71805deb424676f6085bc6dc39395aeb0ecd8a20f47c
MD5 1438c41c4007b8db9c07df6b423ff860
BLAKE2b-256 1a8964376741a6220a54fb4dca5ae58dd9acf803e983a39cc6a7e0f961783fe3

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