{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "URLs require a scheme string ("
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "http://"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ") to be used, without it they will fail      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> repos = np.lib.npyio.DataSource()\n>>> repos.exists('www.google.com/index.html')\nFalse\n>>> repos.exists('http://www.google.com/index.html')\nTrue",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Temporary directories are deleted when the DataSource is deleted."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A generic data source file (file, http, ftp, ...)."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "destpath",
              "annotation": "str or None, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Path to the directory where the source file gets downloaded to for use.  If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "destpath"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is None, a temporary directory will be created. The default path is the current directory."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "DataSources can be local files or remote files/URLs.  The files may also be compressed or uncompressed. DataSource hides some of the low-level details of downloading the file, allowing you to simply pass in a valid file path (or URL) and obtain a file object."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/numpy/lib/npyio.py",
  "item_line": null,
  "item_type": "class",
  "aliases": [
    "numpy.lib._datasource.DataSource"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "::\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ds = np.lib.npyio.DataSource('/home/guido')\nurlname = 'http://www.google.com/'\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "gfile = ds.open('http://www.google.com/')\n",
        "execution_status": "unexpected_exception"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ds.abspath(urlname)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ds = np.lib.npyio.DataSource(None)  # use with temporary file\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ds.open('/home/guido/foobar.txt')\n",
        "execution_status": "unexpected_exception"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ds.abspath('/home/guido/foobar.txt')\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "destpath",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "."
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "DataSource"
  },
  "references": null,
  "qa": "numpy.lib.npyio:DataSource",
  "arbitrary": [],
  "local_refs": [
    "destpath"
  ]
}