summaryrefslogtreecommitdiff
path: root/python-dictdumper.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-dictdumper.spec')
-rw-r--r--python-dictdumper.spec558
1 files changed, 558 insertions, 0 deletions
diff --git a/python-dictdumper.spec b/python-dictdumper.spec
new file mode 100644
index 0000000..0d2382b
--- /dev/null
+++ b/python-dictdumper.spec
@@ -0,0 +1,558 @@
+%global _empty_manifest_terminate_build 0
+Name: python-dictdumper
+Version: 0.8.4.post2
+Release: 1
+Summary: Python dict formatted dumper.
+License: BSD 3-Clause License
+URL: https://github.com/JarryShaw/dictdumper#dictdumper
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ff/89/4e34c60426206e28a49964e86eda05ae1d089f9e9c6dcd3dfca643de5cb4/dictdumper-0.8.4.post2.tar.gz
+BuildArch: noarch
+
+
+%description
+### 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
+```
+
+%package -n python3-dictdumper
+Summary: Python dict formatted dumper.
+Provides: python-dictdumper
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-dictdumper
+### 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
+```
+
+%package help
+Summary: Development documents and examples for dictdumper
+Provides: python3-dictdumper-doc
+%description help
+### 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
+```
+
+%prep
+%autosetup -n dictdumper-0.8.4.post2
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-dictdumper -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu Mar 09 2023 Python_Bot <Python_Bot@openeuler.org> - 0.8.4.post2-1
+- Package Spec generated