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](#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 Mmarkup language (`XML`) file (__base class__)
- `dictdumper.HTML` -- dump JavaScript file under `Vue.js` framework (__DEPRECATED__)

### Installation:
> Note that `dictdumper` only supports Python 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, # 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
```
```python
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
```
  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 Mmarkup language (`XML`) file (__base class__)
- `dictdumper.HTML` -- dump JavaScript file under `Vue.js` framework (__DEPRECATED__)

### Installation:
> Note that `dictdumper` only supports Python 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, # 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
```
```python
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
Release history Release notifications | RSS feed
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.5.0.post1.tar.gz
(62.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dictdumper-0.5.0.post1.tar.gz.
File metadata
- Download URL: dictdumper-0.5.0.post1.tar.gz
- Upload date:
- Size: 62.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05d270de873692a923361ceb133edd33d982d658bbe518edc518ff8620d88436
|
|
| MD5 |
4c58c2237928fb9bf7ec49c32a25df6a
|
|
| BLAKE2b-256 |
aca511f7a881757162771a7528db4d8511c2d8accac355654e35ceb572287f23
|
File details
Details for the file dictdumper-0.5.0.post1-py2.py3-none-any.whl.
File metadata
- Download URL: dictdumper-0.5.0.post1-py2.py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
527bd1b144bd50d0f6a6ac193d5ea65a289a525979bc82b0c657bdc5d1c9929c
|
|
| MD5 |
f8060462164f980e570f5735822d8cbb
|
|
| BLAKE2b-256 |
9acd16fe7e7694eb69b1a7f2167125b78f09e3fe440ef6dcbb4ac5c8edf6d718
|