{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "urllib.error.URLError",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If a remote file cannot be found."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "OSError",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If problems occur writing or reading a local file."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "contents",
              "annotation": "bytes",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The complete contents of the file as a bytes object."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Retrieves a data file from the standard locations and returns its contents as a bytes object."
            }
          ]
        }
      ],
      "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": "data_name",
              "annotation": "str",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Name/location of the desired data file.  One of the following:"
                    }
                  ]
                },
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "BulletList",
                      "__tag": 4053,
                      "ordered": false,
                      "start": 1,
                      "children": [
                        {
                          "__type": "ListItem",
                          "__tag": 4054,
                          "children": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "The name of a data file included in the source       distribution.  The path is relative to the module       calling this function.  For example, if calling from       "
                                },
                                {
                                  "__type": "InlineCode",
                                  "__tag": 4051,
                                  "value": "astropy.pkname"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": ", use "
                                },
                                {
                                  "__type": "InlineCode",
                                  "__tag": 4051,
                                  "value": "'data/file.dat'"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": " to get the       file in "
                                },
                                {
                                  "__type": "InlineCode",
                                  "__tag": 4051,
                                  "value": "astropy/pkgname/data/file.dat"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": ".  Double-dots       can be used to go up a level.  In the same example, use       "
                                },
                                {
                                  "__type": "InlineCode",
                                  "__tag": 4051,
                                  "value": "'../data/file.dat'"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": " to get "
                                },
                                {
                                  "__type": "InlineCode",
                                  "__tag": 4051,
                                  "value": "astropy/data/file.dat"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "."
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "__type": "ListItem",
                          "__tag": 4054,
                          "children": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "If a matching local file does not exist, the Astropy       data server will be queried for the file."
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "__type": "ListItem",
                          "__tag": 4054,
                          "children": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "A hash like that produced by "
                                },
                                {
                                  "__type": "CrossRef",
                                  "__tag": 4002,
                                  "value": "compute_hash",
                                  "reference": {
                                    "__type": "LocalRef",
                                    "__tag": 4022,
                                    "kind": "module",
                                    "path": "astropy.utils.data:compute_hash"
                                  },
                                  "kind": "module"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": " can be       requested, prefixed by 'hash/'       e.g. 'hash/34c33b3eb0d56eb9462003af249eff28'.  The hash       will first be searched for locally, and if not found,       the Astropy data server will be queried."
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "__type": "ListItem",
                          "__tag": 4054,
                          "children": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "A URL to some other file."
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "package",
              "annotation": "str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If specified, look for a file relative to the given package, rather than the default of looking relative to the calling module's package."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "encoding",
              "annotation": "str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "When "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "None",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (default), returns a file-like object with a "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "read"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " method that returns "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "str",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " ("
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "unicode"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ") objects, using "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "locale.getpreferredencoding",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "locale",
                        "version": "*",
                        "kind": "api",
                        "path": "locale:getpreferredencoding"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " as an encoding.  This matches the default behavior of the built-in "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "open",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " when no "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "mode"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " argument is provided."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "When "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "'binary'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", returns a file-like object where its "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "read"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " method returns "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "bytes",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " objects."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "When another string, it is the name of an encoding, and the file-like object's "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "read"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " method will return "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "str",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " ("
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "unicode"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ") objects, decoded from binary using the given encoding."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "cache",
              "annotation": "bool",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If True, the file will be downloaded and saved locally or the already-cached local copy will be accessed. If False, the file-like object will directly access the resource (e.g. if a remote URL is accessed, an object like that from "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "urllib.request.urlopen",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "urllib",
                        "version": "*",
                        "kind": "api",
                        "path": "urllib.request:urlopen"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is returned)."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "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": "/astropy/utils/data.py",
  "item_line": 760,
  "item_type": "function",
  "aliases": [
    "astropy.utils.data.get_pkg_data_contents"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "get_pkg_data_filename",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "get_pkg_data_filename"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "returns a local name for a file containing the data"
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "get_pkg_data_fileobj",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "get_pkg_data_fileobj"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "returns a file-like object with the data"
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "data_name",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "package",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "encoding",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "cache",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "True"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "get_pkg_data_contents"
  },
  "references": null,
  "qa": "astropy.utils.data:get_pkg_data_contents",
  "arbitrary": [],
  "local_refs": [
    "cache",
    "contents",
    "data_name",
    "encoding",
    "package"
  ]
}