def create_index ( config ) : filename = pathlib . Path ( config . cache_path ) / "index.json" index = { "version" : __version__ } with open ( filename , "w" ) as out : out . write ( json . dumps ( index , indent = 2 ) )
creating an index file in python
Create the root index .
def create_index(config):
    """Create the root index."""
    filename = pathlib.Path(config.cache_path) / "index.json"
    index = {"version": __version__}
    with open(filename, "w") as out:
        out.write(json.dumps(index, indent=2))