Skip to content

GoCelesteAI/python_working_with_json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Working with JSON

Code examples from Python Tutorial - Lesson 18: Working with JSON.

Files

File Description
json_basics.py JSON serialization with dumps, parsing with loads, pretty printing, type mappings
json_files.py Reading and writing JSON files with dump and load
data_manager.py Mini project: contact manager with custom datetime serializer

Running

python3 json_basics.py
python3 json_files.py
python3 data_manager.py

Topics Covered

  • json.dumps() - Convert Python objects to JSON strings
  • json.loads() - Parse JSON strings to Python objects
  • json.dump() - Write JSON directly to files
  • json.load() - Read JSON directly from files
  • Pretty printing with indent parameter
  • Type mappings: True/true, None/null, False/false
  • Custom serializers with the default parameter
  • Handling datetime objects in JSON

About

Python Tutorial - Lesson 18: Working with JSON

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages