ExIbge.Calendar (ex_ibge v0.4.0)

Copy Markdown View Source

Module for handling the IBGE Calendar API (v3) — Calendário de Divulgações.

Provides access to the IBGE release calendar, including scheduled and past releases of surveys and publications.

Query Parameters

Both all/1 and by_research/2 accept the following options:

  • :quantity (:qtd) — number of items per page (default: 10).
  • :from (:de) — start date filter in ddMMyyyy format.
  • :to (:ate) — end date filter in ddMMyyyy format.

Examples

# Get upcoming releases
ExIbge.Calendar.all()

# Get releases for a specific research
ExIbge.Calendar.by_research(9173)

# With date filters
ExIbge.Calendar.all(from: "01012024", to: "31122024", quantity: 5)

Summary

Functions

Get the calendar of releases.

Same as all/1, but raises on failure.

Get the calendar of releases for a specific research.

Same as by_research/2, but raises on failure.

Functions

all(query \\ [])

@spec all(keyword()) :: {:ok, map()} | {:error, any()}

Get the calendar of releases.

Parameters

  • query — optional keyword list of query parameters (see module docs).

Examples

iex> ExIbge.Calendar.all()
{:ok, %{count: 100, page: 1, total_pages: 10, items: [%ExIbge.Calendar.Release{}, ...]}}

See Also

IBGE API: Calendário

all!(query \\ [])

@spec all!(keyword()) :: map()

Same as all/1, but raises on failure.

by_research(research_id, query \\ [])

@spec by_research(
  integer() | String.t(),
  keyword()
) :: {:ok, map()} | {:error, any()}

Get the calendar of releases for a specific research.

Parameters

  • research_id — the research identifier.
  • query — optional keyword list of query parameters (see module docs).

Examples

iex> ExIbge.Calendar.by_research(9173)
{:ok, %{count: 10, page: 1, total_pages: 1, items: [%ExIbge.Calendar.Release{}, ...]}}

See Also

IBGE API: Calendário por pesquisa

by_research!(research_id, query \\ [])

@spec by_research!(
  integer() | String.t(),
  keyword()
) :: map()

Same as by_research/2, but raises on failure.