Getting Data from a Package
The examples in this section use the aleksey/hurdat
demo package:
Slicing through a package
Use dict
key selection to slice into a package tree:
Slicing into a Package
directory returns another Package
rooted at that subdirectory. Slicing into a package entry returns an individual PackageEntry
.
Downloading package data to disk
To download a subset of files from a package directory to a dest
, use fetch
:
fetch
will default to downloading the files to the current directory, but you can also specify an alternative path:
Downloading package data into memory
Alternatively, you can download data directly into memory:
To apply a custom deserializer to your data, pass the function as a parameter to the function. For example, to load a hypothetical yaml
file using yaml.safe_load
:
The deserializer should accept a byte stream as input.
Getting entry locations
You can get the path to a package entry or directory using get
:
Getting metadata
Metadata is available using the meta
property.
Last updated