8000 GitHub - atomlayer/dict_list_autosave: The dict_list_autosave library allows you to automatically save changes to dict or list python objects to a file.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The dict_list_autosave library allows you to automatically save changes to dict or list python objects to a file.

License

Notifications You must be signed in to change notification settings

atomlayer/dict_list_autosave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dict_list_autosave

The dict_list_autosave library allows you to automatically save changes to dict or list python objects to a file. You don't need to write a bunch of regular python boilerplate code:

with open(self.file_name, 'w', encoding='utf-8') as file: json.dump(self, file, ensure_ascii=False)

Use the dict_list_autosave library objects (fdict, flist) as normal dict, list python objects.

Installation

From Github:

pip install https://github.com/atomlayer/dict_list_autosave/archive/master.zip

Example

from dict_list_autosave.fdict import fdict  
  
d = fdict('test.json')  
d["test"] = 1  
d.update(x=5) 
Result: 
file: test.json
{"test": 1, "x": 5}
from dict_list_autosave.flist import flist  

l = flist("test2.json")  
l.append("test")  
l.extend([5, 8, 9])
Result: 
file: test2.json
["test", 5, 8, 9]

About

The dict_list_autosave library allows you to automatically save changes to dict or list python objects to a file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0