Legacy (0.4)#
bookshelf.legacy keeps the 0.4 consumer API working on top of Bookshelf. Every call warns with a DeprecationWarning, and the module is removed in bookshelf 2.0. See Migrating from 0.4 for the replacements.
bookshelf.legacy #
The 0.4 consumer API, kept alive on top of the platform facade.
Every call here warns with a :class:DeprecationWarning and routes to :class:bookshelf.Bookshelf. Data comes from the platform, never from the old S3 bucket, so a remote_bookshelf URL is reported and then ignored.
UnknownBook #
Bases: ValueError
An unknown book is requested.
UnknownVersion #
Bases: ValueError
An unknown version is requested.
UnknownEdition #
Bases: UnknownVersion
An unknown edition is requested.
BookShelf #
The 0.4 BookShelf, backed by the platform.
path becomes the content cache directory. remote_bookshelf has no effect, because the platform is the only source now.
load #
load(name: str, version: str | None = None, edition: int | None = None, force: bool = False) -> LocalBook
Load a book, defaulting to the latest version and edition.
force is accepted and ignored, because there is no metadata cache to refresh.
list_versions #
List the published versions of a volume, oldest first.
is_available #
Report whether a matching published book exists on the platform.
is_cached #
Report whether every resource of a book is already in the local cache.
The book itself still has to be resolved on the platform, so this is best effort.
LocalBook #
The 0.4 LocalBook, reading each resource from the platform.
long_version #
Return the {version}_e{edition:03} identifier, for example v1.0.1_e002.
metadata #
Return a plain dict in the shape of the old datapackage.json descriptor.
timeseries #
Return a timeseries resource as an :class:scmdata.ScmRun.
get_long_format_data #
Return a timeseries resource in the 0.4 long format.