new_contents: #! /usr/bin/env python
  # -*- coding: utf-8 -*-
  
  
  # OpenFisca -- A versatile microsimulation software
  # By: OpenFisca Team <contact@openfisca.fr>
  #
  # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
  # https://github.com/openfisca
  #
  # This file is part of OpenFisca.
  #
  # OpenFisca is free software; you can redistribute it and/or modify
  # it under the terms of the GNU Affero General Public License as
  # published by the Free Software Foundation, either version 3 of the
  # License, or (at your option) any later version.
  #
  # OpenFisca is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  # GNU Affero General Public License for more details.
  #
  # You should have received a copy of the GNU Affero General Public License
  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
  
  """Convert datatrees dict to JSON."""
  
  
  import argparse
  import json
  import logging
  import sys
  
  from openfisca_france import entities
  from openfisca_france.model import datatrees
  
  
  def main():
      parser = argparse.ArgumentParser(description = __doc__)
      parser.add_argument('-v', '--verbose', action = 'store_true', default = False, help = "increase output verbosity")
      args = parser.parse_args()
      logging.basicConfig(level = logging.DEBUG if args.verbose else logging.WARNING, stream = sys.stdout)
  
      columns_name_tree_by_entity_name = {
          entities.entity_class_by_symbol[entity_symbol].key_singular: tree
          for entity_symbol, tree in datatrees.columns_name_tree_by_entity.iteritems()
          }
      print json.dumps(columns_name_tree_by_entity_name, indent = 2)
  
      return 0
  
  
  if __name__ == "__main__":
      sys.exit(main())
  
subject: Add datatrees_to_json.py script