code: def init_project_by_yml(project_config=None, dist=None):
      
      if os.path.isfile(project_config):
          project_config = open(project_config)
      try:
          yml_data = yaml.load(project_config)
          project_name = yml_data['project']
          project_tree = yml_data['tree']
      except Exception as e:
          raise KeyError('project config format Error: {}'.format(e))
      if dist is None:
          dist = os.path.abspath('.')
      project_path = os.path.join(dist, project_name)
      _makedirs_if_not_extis(project_path)
      _makedirs_and_files(project_path, project_tree)
docs: 通过配置文件初始化一个 project
  
          :param:
              * project_config: (string) 用来生成 project 的配置文件
              * dist: (string) project 位置
  
          举例如下::
  
              print('--- init_project_by_yml demo ---')
              # define yml string
              package_yml = '''
              project: hellopackage
              tree:
                  - README.md
                  - requirements.txt
                  - setup.py
                  - MANIFEST.in
                  - hellopackage: # project name
                      - __init__.py
                  - test: # unittest file
                      - __init__.py
                  - demo: # usage demo
                      - __init__.py
                  - doc: # documents
              '''
              # init project by yml
              init_project_by_yml(package_yml, '.')
              print(os.listdir('./hellopackage'))
              print('---')
  
          输出结果::
  
              --- init_project_by_yml demo ---
              ['demo', 'requirements.txt', 'test', 'MANIFEST.in', 'hellopackage', 'README.md', 'setup.py', 'doc']
              ---