pyobjict 2.0.2__tar.gz → 2.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyobjict
3
- Version: 2.0.2
3
+ Version: 2.0.6
4
4
  Summary: A Python dict that supports attribute-style access as well as hierarchical keys, JSON serialization, ZIP compression, and more.
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -1,4 +1,4 @@
1
- __version_info__ = (2, 0, 2)
1
+ __version_info__ = (2, 0, 6)
2
2
  __version__ = ".".join(map(str, __version_info__))
3
3
  ALL = ["objict"]
4
4
  import sys
@@ -469,10 +469,6 @@ class objict(dict):
469
469
 
470
470
  @classmethod
471
471
  def from_file(cls, path, ignore_errors=False):
472
- if not os.path.isfile(path) or os.stat(path).st_size == 0:
473
- f = open(path, "w")
474
- f.write("{}")
475
- f.close()
476
472
  if not ignore_errors:
477
473
  with open(path, "r") as f:
478
474
  return cls.from_json(f.read())
@@ -750,3 +746,10 @@ def parse_date(date_str):
750
746
  pass
751
747
 
752
748
  raise ValueError(f"Date format not recognized: {date_str}")
749
+
750
+
751
+ def from_json(json_string, ignore_errors=False):
752
+ return objict.from_json(json_string, ignore_errors)
753
+
754
+ def from_file(path, ignore_errors=False):
755
+ return objict.from_file(path, ignore_errors)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyobjict"
3
- version = "2.0.2"
3
+ version = "2.0.6"
4
4
  description = "A Python dict that supports attribute-style access as well as hierarchical keys, JSON serialization, ZIP compression, and more."
5
5
  authors = ["Ian Starnes <ians@311labs.com>"]
6
6
  license = "MIT"
File without changes
File without changes