Tutorials

The repository contains two Spanish-language Jupyter tutorials that informed this documentation:

  • TutorialValues.ipynb
  • TutorialReports.ipynb

They are useful for interactive exploration. This site is the more complete contract reference and includes implementation caveats that the notebooks predate.

Values tutorial map

Notebook topic Expanded documentation
Installation/import Installation
Token authentication Authentication
Ticker/family/group/market Values
Value catalog Metadata discovery
Authors Version and source selectors
Historical values Dates and history
DataFrame/dictionary/JSON Formats and schemas
CSV/text saving Save and export
Market factors Market factors
All arguments pacifico.request reference

Reports tutorial map

Notebook topic Expanded documentation
Item/entity reports Request reports
Document hierarchy Report hierarchy
Report catalog Discover reports
Typed variants Report value types
Delivery formats Formats and schemas
Saving Save and export
All arguments pacifico.request reference

Run safely

Create an isolated environment:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install pacifico jupyter
jupyter lab

Use %pip install pacifico from a notebook only when the active kernel needs the package.

Before running any historical notebook:

  1. replace every token literal with "token.key" or an environment-variable lookup;
  2. clear saved cell outputs;
  3. review file-writing cells and output paths;
  4. use a narrow metadata or ticker request first;
  5. do not commit executed notebooks containing licensed results;
  6. rotate any credential that may already have been saved or shared.

Current API spelling

The active public keyword for the requested value field is:

pacifico.request(
    "token.key",
    ticker="BCP0600323",
    fieldType="Price",
)

Some tutorial prose uses “data type” as a concept. dataType is not the public keyword in the current root function and would be silently ignored on a value/report route.

The active polling keyword is the compatibility spelling timeFrecuency.

Reproducible notebooks

  • Pass dateStart and dateEnd explicitly instead of relying on “today.”
  • Pin the package version in the environment.
  • Record metadata retrieval time and token scope without recording the token.
  • Assert DataFrame columns before analysis.
  • Treat Scenario/Author filtering as a returned-data validation because current server paths do not enforce it universally.
  • Preserve raw JSON only in approved, access-controlled storage.
  • Make examples deterministic by separating data download from downstream charting/analysis.

Example credential pattern

import os

import pacifico

token = os.environ["PACIFICO_API_TOKEN"]
data = pacifico.request(token, ticker="CHILE")

Never use a token copied from tutorial history, notebook output, or another user's environment.