pacifico.request reference

Import

import pacifico

Signature

pacifico.request(
    token="",
    ticker="",
    family="",
    group="",
    market="",
    country="",
    document="",
    item="",
    chapter="",
    section="",
    subsection="",
    paragraph="",
    app="",
    help=False,
    dateStart=date.today(),
    dateEnd=date.today(),
    fixing=Fixing.EOD,
    fieldType="",
    versionType=VersionType.Version_Unspecified,
    author="",
    version="",
    quality=Quality.Quality_Unspecified,
    timeOut=300,
    timeFrecuency=0.5,
    fileName="",
    format="dataFrame",
    **kwargs,
)

The displayed date defaults are evaluated when the module is imported, not anew for each call.

Routing parameters

Name Accepted value Default Behavior
token token string or string path ending .key/.txt "" Empty reads ./token.key
app string "" Non-empty selects hosted application with highest precedence
help bool False On application route, return contract and discard arguments
document string "" Non-empty selects report route
item string "" Non-empty selects report route
chapter string "" Non-empty selects report route; requires document or item overall
section string "" Non-empty selects report route; parent chain required
subsection string "" Non-empty selects report route; parent chain required
paragraph string "" Non-empty selects report route; parent chain required

See Request routing for precedence and invalid combinations.

Value selectors

Name Accepted value Default Behavior
ticker string or list[str] "" Ticker/mnemonic; only selector with explicit list support
family string "" Instrument family
group string "" Instrument group
market string "" Instrument market
country supported string or Country "" String converted case-insensitively; unknown becomes unspecified

These become hosted-application arguments when app is non-empty.

Shared data filters

Name Accepted value Declared default Effective notes
dateStart datetime.date-compatible import date Start of effective-date interval
dateEnd datetime.date-compatible import date Inclusive end; must be on/after start
fixing Fixing Fixing.EOD End of day or one half-hour member
fieldType supported string "" Case-insensitive; unknown silently becomes unspecified
versionType VersionType Version_Unspecified With empty version, request model normalizes it to Pricing
author string "" Source selector; not enforced on every current server path
version string "" Named version/scenario
quality Quality Quality_Unspecified Quality selector

fixing, versionType, and quality require enum instances for value/report routes; strings are not accepted. FieldType is not a public exported enum, so fieldType uses a string.

Delivery and output

Name Accepted value Default Behavior
timeOut positive number 300 Poll-loop elapsed limit in seconds; not an HTTP socket timeout
timeFrecuency non-negative number 0.5 Sleep between polls; spelling is part of API
fileName string base path "" Empty disables saving; extension appended automatically
format supported string "dataFrame" JSON, dictionary, or DataFrame conversion
**kwargs named application arguments none Forwarded only when app is non-empty; ignored otherwise

Accepted strings

fieldType:

Price
Yield
Duration
Convexity
Delta
Gamma
Vega
Volatility
Quote
Clean Price
Clean Quote
Market Presence
Unspecified

format:

json, JSON
dictionary, dict
dataFrame, DataFrame, df

Return

Depending on format:

  • JSON text (str);
  • a JSON-decoded Python object, normally a dict;
  • a pandas.DataFrame.

If fileName is non-empty, the same object is also written and still returned.

Exceptions and failure representations

Local validation and transport can raise:

  • FileNotFoundError for a missing token file;
  • TypeError for invalid selector, enum, or date types;
  • ValueError when dateEnd < dateStart;
  • TimeoutError when asynchronous processing exceeds the poll limit;
  • requests exceptions for network failures;
  • json.JSONDecodeError when dictionary conversion receives invalid JSON;
  • serialization or parsing exceptions for unsupported application arguments.

DataFrame conversion catches many payload errors and returns a synthetic error row instead of raising. JSON/dictionary short-error handling returns an Error object/string. See Errors and troubleshooting.

Current server limitations

  • Version predicates (author, version, versionType) are not currently applied to report requests.
  • They are also not applied to ticker-specific value requests, including ticker lists where every instrument field has a non-empty ticker.
  • Non-EOD value publication keys include a fixing suffix that the current DataFrame converter cannot parse; use JSON/dictionary output for intraday values.
  • The public author is presented as Pacifico in response scenario/author labels; any legacy internal provider identifier is normalized to that public label.
  • Historical ranges can be normalized rather than rejected.
  • Latest value formatting removes observations older than 500 days; latest reports have no equivalent filter.

Validate response authors, dates, schema, and error markers in critical integrations.

Public surface

The supported root imports are:

from pacifico import Country, Fixing, Quality, VersionType, request

Lower-level functions such as requestValue, requestReport, and requestApplication are implementation details and are not re-exported by the package root.