dictdumper


Namedictdumper JSON
Version 0.8.4.post6 PyPI version JSON
download
home_pageNone
SummaryDictDumper: comprehensive network packet analysis library
upload_time2024-11-03 20:49:58
maintainerJarry Shaw
docs_urlNone
authorNone
requires_python>=2.7
licenseBSD 3-Clause License
keywords formatting dumper stream
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DictDumper

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

- [About](#about)
    * `dictdumper.Dumper`
    * `dictdumper.JSON`
    * `dictdumper.PLIST`
    * `dictdumper.Tree`
    * `dictdumper.XML`
    * `dictdumper.HTML`
- [Installation](#installation)
- [Usage](#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__)

![](https://github.com/JarryShaw/dictdumper/blob/master/doc/dictdumper.png)

 

### 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

```python
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
```
```python
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
```
```python
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
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dictdumper",
    "maintainer": "Jarry Shaw",
    "docs_url": null,
    "requires_python": ">=2.7",
    "maintainer_email": null,
    "keywords": "formatting, dumper, stream",
    "author": null,
    "author_email": "Jarry Shaw <jarryshaw@icloud.com>",
    "download_url": "https://files.pythonhosted.org/packages/9d/79/516e17cb2445d79daa4f7f4dd6330cc014e997a4bf0e0d8b2817f2c150a5/dictdumper-0.8.4.post6.tar.gz",
    "platform": null,
    "description": "# DictDumper\n\n&emsp; The `dictdumper` project is an open source Python program works as a stream formatted output dumper for `dict`.\n\n- [About](#about)\n    * `dictdumper.Dumper`\n    * `dictdumper.JSON`\n    * `dictdumper.PLIST`\n    * `dictdumper.Tree`\n    * `dictdumper.XML`\n    * `dictdumper.HTML`\n- [Installation](#installation)\n- [Usage](#usage)\n\n---\n\n### About\n\n&emsp; Currently, it supports following formats --\n\n - `dictdumper.Dumper` -- abstract base class of all dumpers\n - `dictdumper.JSON` -- dump JavaScript object notation (`JSON`) format file\n - `dictdumper.PLIST` -- dump Apple property list (`PLIST`) format file\n - `dictdumper.Tree` -- dump tree-view text (`TXT`) format file\n - `dictdumper.XML` -- dump extensible markup language (`XML`) file (__base class__)\n - `dictdumper.HTML` -- dump JavaScript file under `Vue.js` framework (__DEPRECATED__)\n\n![](https://github.com/JarryShaw/dictdumper/blob/master/doc/dictdumper.png)\n\n&nbsp;\n\n### Installation:\n\n> Note that `dictdumper` supports Python versions __2.7__ and all versions __since 3.0__\n\n```\npip install dictdumper\n```\n\n&nbsp;\n\n### Usage\n\n&emsp; `dictdumper` is quite easy to use. After installation, importation, and initialisation, you can simple call the instance to dump contents.\n\n> Take `dictdumper.Tree` for example\n\n```python\nimport dictdumper\ndumper = dictdumper.Tree('out.txt')\ntest_1 = dict(\n    foo=-1,\n    bar='Hello, world!',\n    boo=dict(\n        foo_again=True,\n        bar_again=memoryview(b'bytes'),\n        boo_again=None,\n    ),\n)\ndumper(test_1, name='test_1')\n```\n```\n$ cat out.txt\ntest_1\n  |-- foo -> -1\n  |-- bar -> Hello, world!\n  |-- boo\n        |-- foo_again -> True\n        |-- bar_again\n        |     |-- type -> memoryview\n        |     |-- value -> 62 79 74 65 73\n        |     |-- text -> bytes\n        |-- boo_again -> NIL\n```\n```python\nimport datetime\ntest_2 = dict(\n    foo=[1, 2.0, 3],\n    bar=(1.0, bytearray(b'a long long bytes'), 3.0),\n    boo=dict(\n        foo_again=b'bytestring',\n        bar_again=datetime.datetime(2020, 1, 31, 20, 15, 10, 163010),\n        boo_again=float('-inf'),\n    ),\n)\ndumper(test_2, name='test_2')\n```\n```\n$ cat out.txt\ntest_1\n  |-- foo -> -1\n  |-- bar -> Hello, world!\n  |-- boo\n        |-- foo_again -> True\n        |-- bar_again\n        |     |-- type -> memoryview\n        |     |-- value -> 62 79 74 65 73\n        |     |-- text -> bytes\n        |-- boo_again -> NIL\n\ntest_2\n  |-- foo\n  |     |--> 1\n  |     |--> 2.0\n  |     |--> 3\n  |-- bar\n  |     |-- type -> tuple\n  |     |-- value\n  |           |--> 1.0\n  |           |--> --\n  |           |     |-- type -> bytearray\n  |           |     |-- value\n  |           |     |     |--> 61 20 6c 6f 6e 67 20 6c 6f 6e 67 20 62 79 74 65\n  |           |     |          73\n  |           |     |-- text -> a long long bytes\n  |           |--> 3.0\n  |-- boo\n        |-- foo_again -> 62 79 74 65 73 74 72 69 6e 67\n        |-- bar_again -> 2020-01-31T20:15:10.163010\n        |-- boo_again -> -Infinity\n```\n```python\ntest_3 = dict(\n    foo=\"stringstringstringstringstringstringstringstringstringstring\",\n    bar=[\n        \"s1\", False, \"s3\",\n    ],\n    boo=[\n        \"s4\", dict(s=\"5\", j=\"5\"), \"s6\"\n    ],\n    far=dict(\n        far_foo=[\"s1\", \"s2\", \"s3\"],\n        far_var=\"s4\",\n    ),\n    biu=float('nan'),\n)\ndumper(test_3, name='test_3')\n```\n```\n$ cat out.txt\ntest_1\n  |-- foo -> -1\n  |-- bar -> Hello, world!\n  |-- boo\n        |-- foo_again -> True\n        |-- bar_again\n        |     |-- type -> memoryview\n        |     |-- value -> 62 79 74 65 73\n        |     |-- text -> bytes\n        |-- boo_again -> NIL\n\ntest_2\n  |-- foo\n  |     |--> 1\n  |     |--> 2.0\n  |     |--> 3\n  |-- bar\n  |     |-- type -> tuple\n  |     |-- value\n  |           |--> 1.0\n  |           |--> --\n  |           |     |-- type -> bytearray\n  |           |     |-- value\n  |           |     |     |--> 61 20 6c 6f 6e 67 20 6c 6f 6e 67 20 62 79 74 65\n  |           |     |          73\n  |           |     |-- text -> a long long bytes\n  |           |--> 3.0\n  |-- boo\n        |-- foo_again -> 62 79 74 65 73 74 72 69 6e 67\n        |-- bar_again -> 2020-01-31T20:15:10.163010\n        |-- boo_again -> -Infinity\n\ntest_3\n  |-- foo\n  |     |--> stringstringstringstringstringstringstri\n  |          ngstringstringstring\n  |-- bar\n  |     |--> s1\n  |     |--> False\n  |     |--> s3\n  |-- boo\n  |     |--> s4\n  |     |--> --\n  |     |     |-- s -> 5\n  |     |     |-- j -> 5\n  |     |--> s6\n  |-- far\n  |     |-- far_foo\n  |     |     |--> s1\n  |     |     |--> s2\n  |     |     |--> s3\n  |     |-- far_var -> s4\n  |-- biu -> NaN\n```\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "DictDumper: comprehensive network packet analysis library",
    "version": "0.8.4.post6",
    "project_urls": {
        "changelog": "https://github.com/JarryShaw/DictDumper/releases",
        "documentation": "https://jarryshaw.github.io/DictDumper/",
        "homepage": "https://jarryshaw.github.io/DictDumper/",
        "repository": "https://github.com/JarryShaw/DictDumper"
    },
    "split_keywords": [
        "formatting",
        " dumper",
        " stream"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d90e794d308340a9fdfcdd5efcff5020a230e6948daee8c3066e3c64a5e91c9e",
                "md5": "3e724260d63c822ba360c226baac6179",
                "sha256": "6640248eacfcd2490cf7d7197c6edcd322c5c4e81b357d07279f80daa958639a"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6-cp310-none-any.whl",
            "has_sig": false,
            "md5_digest": "3e724260d63c822ba360c226baac6179",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=2.7",
            "size": 18519,
            "upload_time": "2024-11-03T20:49:59",
            "upload_time_iso_8601": "2024-11-03T20:49:59.793476Z",
            "url": "https://files.pythonhosted.org/packages/d9/0e/794d308340a9fdfcdd5efcff5020a230e6948daee8c3066e3c64a5e91c9e/dictdumper-0.8.4.post6-cp310-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "10e4c9656063cb97ee6c213f63070a0c18bb1f4cdae77dc84f4d2e062f137756",
                "md5": "f600f7e642b418daf8ba8f334e2aeaf1",
                "sha256": "5dba83de43c3ec12e4694c339f5da2092edce974963ea90be664936c58f9d4a9"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6-cp311-none-any.whl",
            "has_sig": false,
            "md5_digest": "f600f7e642b418daf8ba8f334e2aeaf1",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=2.7",
            "size": 18519,
            "upload_time": "2024-11-03T21:04:05",
            "upload_time_iso_8601": "2024-11-03T21:04:05.749207Z",
            "url": "https://files.pythonhosted.org/packages/10/e4/c9656063cb97ee6c213f63070a0c18bb1f4cdae77dc84f4d2e062f137756/dictdumper-0.8.4.post6-cp311-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fedb74224dc7f5092a43c376da3f76f1d82744b7ab5b16998ccb46aaaea221d4",
                "md5": "a39236a99e8ba253ba5146edc00bf703",
                "sha256": "1b04a2e7c989f059ce99b9a9cf614403b311e48efe26b5100dec326a472da088"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6-cp312-none-any.whl",
            "has_sig": false,
            "md5_digest": "a39236a99e8ba253ba5146edc00bf703",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=2.7",
            "size": 18519,
            "upload_time": "2024-11-03T20:49:56",
            "upload_time_iso_8601": "2024-11-03T20:49:56.887902Z",
            "url": "https://files.pythonhosted.org/packages/fe/db/74224dc7f5092a43c376da3f76f1d82744b7ab5b16998ccb46aaaea221d4/dictdumper-0.8.4.post6-cp312-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d80a117306c161eeedd669a56de1d84fe32981ea9a64272443dedd8c9377bb8",
                "md5": "cbbd58c0260f50bd826376f8141530d3",
                "sha256": "fcdca7909cdd142ec21d18bcbe5162aceaf00e4bfe502747b12676cf3b77d391"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6-cp313-none-any.whl",
            "has_sig": false,
            "md5_digest": "cbbd58c0260f50bd826376f8141530d3",
            "packagetype": "bdist_wheel",
            "python_version": "cp313",
            "requires_python": ">=2.7",
            "size": 18519,
            "upload_time": "2024-11-03T20:50:05",
            "upload_time_iso_8601": "2024-11-03T20:50:05.042346Z",
            "url": "https://files.pythonhosted.org/packages/9d/80/a117306c161eeedd669a56de1d84fe32981ea9a64272443dedd8c9377bb8/dictdumper-0.8.4.post6-cp313-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e39e300b7024bdb98b4667dbe397974b58e6246666c1b90491784efbf3cd0ed",
                "md5": "379ce8e043c44798d4997f5b578291cb",
                "sha256": "4cf28f67e186076c4d8ee806979e5e412b4bf1d319826be50d0c9c19f5829f83"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6-cp39-none-any.whl",
            "has_sig": false,
            "md5_digest": "379ce8e043c44798d4997f5b578291cb",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=2.7",
            "size": 18519,
            "upload_time": "2024-11-03T21:01:37",
            "upload_time_iso_8601": "2024-11-03T21:01:37.200361Z",
            "url": "https://files.pythonhosted.org/packages/8e/39/e300b7024bdb98b4667dbe397974b58e6246666c1b90491784efbf3cd0ed/dictdumper-0.8.4.post6-cp39-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "81b75635e41482007f1f93913d40431c4f4e3c2f5ab8118fc5005862cfcd284d",
                "md5": "db1739acd4ed96f96ea88e6198fa2c47",
                "sha256": "5e095e023e91cbd161e7f939f842364e68a91629d01c7f957997c3b81c83c3b5"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6-pp310-none-any.whl",
            "has_sig": false,
            "md5_digest": "db1739acd4ed96f96ea88e6198fa2c47",
            "packagetype": "bdist_wheel",
            "python_version": "pp310",
            "requires_python": ">=2.7",
            "size": 18519,
            "upload_time": "2024-11-03T21:04:12",
            "upload_time_iso_8601": "2024-11-03T21:04:12.005721Z",
            "url": "https://files.pythonhosted.org/packages/81/b7/5635e41482007f1f93913d40431c4f4e3c2f5ab8118fc5005862cfcd284d/dictdumper-0.8.4.post6-pp310-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c5b37a72530551357f785690a879e2eaa34cb18de7853b6f6acd9e146e15e3c",
                "md5": "6f66424d3ca2784a66d2c8b6ba8df8c7",
                "sha256": "1e194e7eb9a3cbbdf8c0ddeb6573366ae3961a2f3199e04dbe515b698b0d316c"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6-pp38-none-any.whl",
            "has_sig": false,
            "md5_digest": "6f66424d3ca2784a66d2c8b6ba8df8c7",
            "packagetype": "bdist_wheel",
            "python_version": "pp38",
            "requires_python": ">=2.7",
            "size": 18519,
            "upload_time": "2024-11-03T21:04:15",
            "upload_time_iso_8601": "2024-11-03T21:04:15.623621Z",
            "url": "https://files.pythonhosted.org/packages/3c/5b/37a72530551357f785690a879e2eaa34cb18de7853b6f6acd9e146e15e3c/dictdumper-0.8.4.post6-pp38-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7efc65a0055346ab39048b964334f6f02f033a9bf537da1e3466532a8fed6dc9",
                "md5": "bf8d2d6debad686f3c8eebd990c8c770",
                "sha256": "c111c1d1d2c17e593086996598912c26915eb70e569d06b70cad83c2b2d5a250"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6-pp39-none-any.whl",
            "has_sig": false,
            "md5_digest": "bf8d2d6debad686f3c8eebd990c8c770",
            "packagetype": "bdist_wheel",
            "python_version": "pp39",
            "requires_python": ">=2.7",
            "size": 18519,
            "upload_time": "2024-11-03T20:50:01",
            "upload_time_iso_8601": "2024-11-03T20:50:01.723017Z",
            "url": "https://files.pythonhosted.org/packages/7e/fc/65a0055346ab39048b964334f6f02f033a9bf537da1e3466532a8fed6dc9/dictdumper-0.8.4.post6-pp39-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d79516e17cb2445d79daa4f7f4dd6330cc014e997a4bf0e0d8b2817f2c150a5",
                "md5": "02f735d4f91329b89f6952517ad0d7d0",
                "sha256": "7826615acb3db3e9bbd493a950d7a06edc033a091ce9da8b65c69fa940f495b0"
            },
            "downloads": -1,
            "filename": "dictdumper-0.8.4.post6.tar.gz",
            "has_sig": false,
            "md5_digest": "02f735d4f91329b89f6952517ad0d7d0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7",
            "size": 76180,
            "upload_time": "2024-11-03T20:49:58",
            "upload_time_iso_8601": "2024-11-03T20:49:58.693717Z",
            "url": "https://files.pythonhosted.org/packages/9d/79/516e17cb2445d79daa4f7f4dd6330cc014e997a4bf0e0d8b2817f2c150a5/dictdumper-0.8.4.post6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-03 20:49:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JarryShaw",
    "github_project": "DictDumper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "dictdumper"
}
        
Elapsed time: 0.34620s