Hosted applications¶
Hosted applications are server-side financial models or workflows invoked through the same pacifico.request(...) function. Application names, contracts, results, and access are managed by the service and can differ by token.
Inspect an application contract¶
For a known application name, request help before execution:
import pacifico
contract = pacifico.request(
"token.key",
app="<APPLICATION_NAME>",
help=True,
)
print(contract)
When help=True, application arguments are discarded and the response describes the accepted arguments. Help is normally returned through the report-style schema. The client itself expects argument type declarations in rows where:
Sectionis the argument name;SubsectionisType;Valueis a supported value-type label.
Treat the returned contract as authoritative for that application.
Run an application¶
Pass application arguments as named keywords:
result = pacifico.request(
"token.key",
app="<APPLICATION_NAME>",
help=False,
ticker="CHILE",
customArgument="<VALUE>",
timeOut=900,
timeFrecuency=1.0,
)
app has the highest routing precedence. ticker and other shared request parameters become application arguments rather than selecting a value/report route.
Argument rules¶
- Extra
**kwargsare forwarded only for application requests. - Unknown extra keywords are silently ignored for value and report requests.
- Shared arguments at their client defaults are removed before application serialization.
- Non-default shared arguments are forwarded along with custom keywords.
- Prefer JSON-compatible primitives: strings, numbers, booleans, and contract-approved structures.
- The application name and argument names are case- and spelling-sensitive unless its contract says otherwise.
The client serializes some complex values in implementation-specific ways. In particular, non-default exported enum instances nested in application arguments are not guaranteed to be JSON serializable. If an application contract asks for a fixing or similar concept, follow the type and representation shown by help=True rather than reusing a value-request enum automatically.
File arguments¶
Before every normal application run, the client makes an internal help request and looks for arguments typed File. If a local path was provided for such an argument, the client uploads the file to temporary storage and replaces the local path with the resulting URL.
result = pacifico.request(
"token.key",
app="<APPLICATION_NAME>",
inputFile="/secure/input/portfolio.csv",
)
Operational consequences:
- the local file must exist and be readable;
- the content leaves the local machine and is uploaded before application execution;
- its confidentiality and retention must be appropriate for the service;
- the help lookup adds another API request;
- even if the caller fetched help earlier, the current implementation fetches it again;
- the internal help lookup uses a fixed 300-second polling limit and 0.5-second interval, independent of the outer
timeOutandtimeFrecuency.
Do not pass a secret key, credential file, or data that is not approved for service-side processing.
Help versus execution¶
| Call | Arguments sent | Typical purpose |
|---|---|---|
app=..., help=True |
Empty application argument dictionary | Discover names, types, and other contract details |
app=..., help=False |
Non-default shared arguments plus custom kwargs | Execute the application |
Passing custom arguments with help=True does not validate those values; they are discarded.
Result formats¶
Application results use the same local conversion and saving pipeline as other requests:
raw = pacifico.request(
"token.key",
app="<APPLICATION_NAME>",
customArgument="<VALUE>",
format="json",
)
Many application results are report-shaped, but the application contract determines the actual payload. Start with raw JSON when integrating a new application, validate the shape, and only then rely on DataFrame conversion.
Typed Browser output can launch Selenium during DataFrame conversion. Use raw JSON in unattended environments. See Formats and schemas and Security.
Failure checklist¶
- Confirm that the token is entitled to the exact application name.
- Fetch
help=Trueand compare every argument name and type. - Ensure required files exist and are approved for upload.
- Increase the outer polling time for long model runs.
- Retry with
format="json"to distinguish service output from DataFrame parsing. - Remember that the preliminary help request can fail or time out before execution starts.