Request reports¶
Reports represent typed facts and documents associated with entities, instruments, and other items. A report request is selected whenever app is empty and at least one report selector is non-empty.
Report hierarchy¶
Document → Chapter → Section → Subsection → Paragraph → Item
The hierarchy describes where a fact appears, while item identifies the entity or object to which it applies.
Request by item¶
An item can be an entity identifier:
import pacifico
entity = pacifico.request(
"token.key",
item="97004000-5",
)
It can also be an instrument:
instrument = pacifico.request(
"token.key",
item="BCP0600323",
)
The available documents and facts differ by item.
Request by document¶
identifications = pacifico.request(
"token.key",
document="Identification",
)
calendars = pacifico.request(
"token.key",
document="Calendar",
)
Document names come from the server-side catalog and may be entitlement-dependent. Discover them through report metadata.
Combine document and item¶
balance_sheet = pacifico.request(
"token.key",
document="Balance Sheet",
item="96800570-7",
)
This is also the required shape for dependable multi-day report history: include both document and item.
Narrow the hierarchy¶
facts = pacifico.request(
"token.key",
document="<DOCUMENT>",
chapter="<CHAPTER>",
section="<SECTION>",
subsection="<SUBSECTION>",
paragraph="<PARAGRAPH>",
item="<ITEM>",
)
At least document or item must be non-empty. A request with only chapter, section, subsection, or paragraph selects the report route but cannot construct a valid report and fails before a useful response is returned.
The client also normalizes broken parent chains:
- if
chapteris empty,sectionand all lower text levels are cleared; - if
sectionis empty,subsectionandparagraphare cleared; - if
subsectionis empty,paragraphis cleared.
Supply each parent level required to preserve a deeper filter.
Date, fixing, version, and quality¶
Reports accept the same shared filters as values:
from datetime import date, timedelta
from pacifico import Fixing, Quality, VersionType
import pacifico
end = date.today()
start = end - timedelta(days=7)
history = pacifico.request(
"token.key",
document="<DOCUMENT>",
item="<ITEM>",
dateStart=start,
dateEnd=end,
fixing=Fixing.EOD,
versionType=VersionType.Version_Pricing,
quality=Quality.Quality_Production,
)
Current filter-enforcement limitation
The current server does not add its version predicate for report queries. author, version, and versionType are accepted by the client but may not restrict returned reports. Inspect the Author column and apply a client-side check when source identity matters.
The public response display label is Pacifico; any legacy internal provider
identifier is normalized to it. Use the returned label when enforcing an
Author allowlist.
Multi-day history is normalized to the latest request unless both document and item are present and the version type is not prediction. A single requested date is retained with either document or item. See Dates and history.
Typed values¶
Each canonical report leaf contains a variant:
{
"variant": {
"value": "<VALUE>",
"type": "String"
},
"dateTenor": "31/12/2030 00:00:00",
"other": "<OPTIONAL CONTEXT>"
}
The DataFrame converter coerces the value according to its type and records the label in Value Type. Supported scalar and list labels are documented under Report value types.
Browser values¶
A report value typed as Browser has a side effect when the default DataFrame conversion is used: the client downloads the referenced HTML, writes a temporary browser.html in the current directory, and attempts to open it through Selenium/Chrome.
For unattended jobs or untrusted report content, request format="json" or format="dictionary" and decide explicitly whether to open the URL.
DataFrame columns¶
Author, Document, Chapter, Section, Subsection, Paragraph, Item,
Date Publication, Date Effective, Fixing, Value, Value Type,
Date Tenor, Other
Do not assume Value has one Python type across the DataFrame. Mixed report variants commonly make the column an object dtype.