项目作者: zaghaghi

项目描述 :
import json files directly in your python scripts
高级语言: Python
项目地址: git://github.com/zaghaghi/direct-json-import.git
创建时间: 2021-06-09T09:50:18Z
项目社区:https://github.com/zaghaghi/direct-json-import

开源协议:Apache License 2.0

下载


Install

Install from git repository

  1. pip install git+https://github.com/zaghaghi/direct-json-import.git

Use

With the following json in a file named info.json.

  1. {
  2. "name": "hamed",
  3. "lastname": "zaghaghi",
  4. "repos": [
  5. "https://github.com/zaghaghi/direct-json-import"
  6. ]
  7. }

you can directly import it as follows

  1. import info
  2. print(info.data)
  3. # {'name': 'hamed', 'lastname': 'zaghaghi', 'repos': ['https://github.com/zaghaghi/direct-json-import']}