Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
serializer_utils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rolf van Kleef
serializer_utils
Commits
c881da5b
Verified
Commit
c881da5b
authored
Nov 01, 2018
by
Rolf van Kleef
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pypi release
parent
01b1844c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
4 deletions
+66
-4
.gitignore
.gitignore
+3
-0
Pipfile
Pipfile
+1
-0
Pipfile.lock
Pipfile.lock
+1
-1
README.md
README.md
+22
-0
dict_deserializer/__init__.py
dict_deserializer/__init__.py
+12
-0
dict_deserializer/annotations.py
dict_deserializer/annotations.py
+0
-0
dict_deserializer/deserializer.py
dict_deserializer/deserializer.py
+0
-0
setup.py
setup.py
+24
-0
test.py
test.py
+3
-3
No files found.
.gitignore
View file @
c881da5b
/venv/
/.idea/
**/__pycache__/
/build/
*.egg-info/
/dist/
Pipfile
View file @
c881da5b
...
...
@@ -5,6 +5,7 @@ name = "pypi"
[packages]
typeguard
=
"*"
setuptools
=
"*"
[dev-packages]
...
...
Pipfile.lock
View file @
c881da5b
{
"_meta"
:
{
"hash"
:
{
"sha256"
:
"
712f72994a8ca388f3472a8e311f7ed87dc7a7c6ef243c92a51b11c572d5cdbc
"
"sha256"
:
"
8140294700f02b0a15d82c0fe7af9c857657387011cb0a5c3f77d2b3bb981eef
"
},
"pipfile-spec"
:
6
,
"requires"
:
{
...
...
README.md
0 → 100644
View file @
c881da5b
# Dictionary Deserializer
Dictionary deserializer is a project built to convert dictionaries into
composite classes in an intuitive way. Special attention was also paid
to being friendly to static type-checkers and IDE autocompletes.
## Limitations
This library uses the
`typing`
module extensively. It does, however, only
support some of its types. This is a list of verified composite types:
*
`Union`
(Including
`Optional`
)
*
`List`
*
`Any`
It supports these types as terminal types:
*
`int`
*
`float`
*
`str`
*
`NoneType`
*
`bool`
dict_deserializer/__init__.py
0 → 100644
View file @
c881da5b
from
collections
import
namedtuple
name
=
'Dictionary deserializer'
version
=
'0.0.1'
description
=
"Dictionary deserializer is a package that aides in the "
\
"deserializing of JSON (or other structures) that are "
\
"converted to dicts, into composite classes."
author
=
namedtuple
(
'Author'
,
[
'name'
,
'email'
])(
name
=
'Rolf van Kleef'
,
email
=
'pypi@rolfvankleef.nl'
)
serializer_utils
/annotations.py
→
dict_deserializer
/annotations.py
View file @
c881da5b
File moved
serializer_utils
/deserializer.py
→
dict_deserializer
/deserializer.py
View file @
c881da5b
File moved
setup.py
0 → 100644
View file @
c881da5b
import
setuptools
import
dict_deserializer
with
open
(
"README.md"
,
"r"
)
as
fh
:
long_description
=
fh
.
read
()
setuptools
.
setup
(
name
=
dict_deserializer
.
name
,
version
=
dict_deserializer
.
version
,
author
=
dict_deserializer
.
author
.
name
,
author_email
=
dict_deserializer
.
author
.
email
,
description
=
dict_deserializer
.
description
,
long_description
=
long_description
,
long_description_content_type
=
"text/markdown"
,
url
=
"https://git.iapc.utwente.nl/rkleef/serializer_utils"
,
packages
=
setuptools
.
find_packages
(),
classifiers
=
[
"Programming Language :: Python :: 3"
,
"License :: OSI Approved :: BSD License"
,
"Operating System :: OS Independent"
,
"Topic :: Utilities"
,
"Development Status :: 4 - Beta"
,
],
)
test.py
View file @
c881da5b
from
time
import
sleep
from
typing
import
Optional
,
List
from
serializer_utils
.deserializer
import
Deserializable
,
Rule
from
serializer_utils
.annotations
import
abstract
,
discriminate
from
dict_deserializer
.deserializer
import
Deserializable
,
Rule
from
dict_deserializer
.annotations
import
abstract
,
discriminate
@
abstract
...
...
@@ -45,7 +45,7 @@ if __name__ == '__main__':
import
sys
import
traceback
from
serializer_utils
.deserializer
import
deserialize
from
dict_deserializer
.deserializer
import
deserialize
def
print_result
(
function
,
*
args
,
**
kwargs
):
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment