publication_documents
Download one, or more, USDA ERS publication Full Report PDFs.
This command returns only the results portion of the OBBject response. It contains a list of dictionaries where the base64 encoded content of the document is under the 'content' key.
Examples
from openbb import obb
obb.usda.publication_documents(provider='usda', urls=['https://www.ers.usda.gov/publications/115092'])
# Download the latest Livestock, Dairy, and Poultry Outlook.
rows = obb.usda.publications(series='LDPM').to_df()
pdfs = obb.usda.publication_documents(urls=[rows.iloc[0]['url']])
Parameters
- standard
- usda
urls: dict[str, list[str]] | list[str] | str | list[dict[str, list[str]] | list[str] | str]
Publication page URLs to download, as returned by the ers_publications endpoint. Each page is resolved to its Full Report PDF. Multiple items allowed.
Returns
Any
Data
- standard
- usda
error_type: str | None
Error type, if the report could not be downloaded.
content: str
Base64-encoded PDF document.
filename: str | None
The filename of the downloaded PDF.
data_format: dict[str, str] | None
Data format information, including data type and filename.