Skip to content

Commit

Permalink
feat: add CloudFile.get_json
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Aug 23, 2023
1 parent 30dcb5f commit 7d917d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cloudfiles/cloudfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,10 @@ def get(self, ranges=None, raw:bool = False):

return self.cf.get(reqs, raw=raw)

def get_json(self) -> Union[dict,list]:
"""Download a json file and decode to a dict or list."""
return self.cf.get_json(self.filename)

def put(self, content:bytes, *args, **kwargs):
"""Upload a file."""
res = self.cf.put(self.filename, content, *args, **kwargs)
Expand Down

0 comments on commit 7d917d8

Please sign in to comment.