kde_cpi.data.client module

HTTP client for retrieving CPI datasets from BLS.

class kde_cpi.data.client.CpiHttpClient(base_url='https://download.bls.gov/pub/time.series/cu/', timeout=30.0, session=NOTHING, headers=NOTHING)[source]

Bases: object

Thin HTTP wrapper around the BLS CPI flat-file endpoints.

Parameters:
base_url: str
close()[source]

Release the underlying HTTP session.

Return type:

None

get_text(filename, *, encoding='utf-8')[source]

Fetch a remote CPI resource and return its decoded text payload.

Return type:

str

Parameters:
  • filename (str)

  • encoding (str)

headers: dict[str, str]
session: Session
timeout: float