Liking cljdoc? Tell your friends :D

gridx.client

GridX Pricing API client — shared infrastructure.

Spec-driven HTTP client built on Martian. The OpenAPI spec bundled in resources/ is the single source of truth for endpoint definitions, parameter validation, and response schemas.

For utility-specific clients with sensible defaults, see:

  • gridx.pge.client — PG&E
  • gridx.sce.client — SCE
GridX Pricing API client — shared infrastructure.

Spec-driven HTTP client built on Martian. The OpenAPI spec bundled in
resources/ is the single source of truth for endpoint definitions,
parameter validation, and response schemas.

For utility-specific clients with sensible defaults, see:
- `gridx.pge.client` — PG&E
- `gridx.sce.client` — SCE
raw docstring

gridx.pge.circuits

PG&E circuit ID to location mapping.

Each 9-digit representative circuit ID encodes a PG&E distribution feeder: region, division, substation, and feeder number.

Data derived from:

PG&E circuit ID to location mapping.

Each 9-digit representative circuit ID encodes a PG&E distribution feeder:
region, division, substation, and feeder number.

Data derived from:
- PG&E 2022 Grid Needs Assessment (CPUC filing 496629893, Appendix D)
- Priicer community cross-reference
  (https://forum.priicer.com/t/pg-e-dynamic-pilot-california/33)
raw docstring

gridx.pge.client

PG&E-specific GridX Pricing API client.

Wraps gridx.client with PG&E defaults: utility, market, program, and API URLs. The OpenAPI spec at gridx-pricing-spec/pge/openapi.yaml defines the available rate schedules and circuit IDs.

Required params for get-pricing: :startdate - "YYYYMMDD" (earliest 20240601) :enddate - "YYYYMMDD" (max ~2 weeks span) :ratename - PG&E rate schedule code (e.g. "EELEC") :representativeCircuitId - 9-digit feeder ID (see gridx.pge.circuits for location lookup)

Optional params: :cca - CCA code (e.g. "AVA", "PCE")

Use gridx.pge.circuits/find-circuits to look up circuit IDs by substation name, e.g. (find-circuits "mountain view").

PG&E-specific GridX Pricing API client.

Wraps `gridx.client` with PG&E defaults: utility, market, program,
and API URLs. The OpenAPI spec at `gridx-pricing-spec/pge/openapi.yaml`
defines the available rate schedules and circuit IDs.

Required params for `get-pricing`:
  :startdate               - "YYYYMMDD" (earliest 20240601)
  :enddate                 - "YYYYMMDD" (max ~2 weeks span)
  :ratename                - PG&E rate schedule code (e.g. "EELEC")
  :representativeCircuitId - 9-digit feeder ID (see gridx.pge.circuits
                             for location lookup)

Optional params:
  :cca                     - CCA code (e.g. "AVA", "PCE")

Use `gridx.pge.circuits/find-circuits` to look up circuit IDs by
substation name, e.g. (find-circuits "mountain view").
raw docstring

gridx.pricing

Higher-level functions for working with GridX pricing data.

Two layers:

  • Raw: camelCase keys, string values — direct from the API JSON.
  • Coerced: namespaced keywords, BigDecimals, OffsetDateTimes — Clojure-friendly.

The coerced layer preserves raw data as metadata via :gridx/raw.

Schemas are in separate namespaces for consumer use:

  • gridx.pricing.schema — coerced entity schemas (Component, Interval, Curve)
  • gridx.pricing.schema.raw — raw API response schemas
Higher-level functions for working with GridX pricing data.

Two layers:
- Raw: camelCase keys, string values — direct from the API JSON.
- Coerced: namespaced keywords, BigDecimals, OffsetDateTimes — Clojure-friendly.

The coerced layer preserves raw data as metadata via :gridx/raw.

Schemas are in separate namespaces for consumer use:
- `gridx.pricing.schema`     — coerced entity schemas (Component, Interval, Curve)
- `gridx.pricing.schema.raw` — raw API response schemas
raw docstring

gridx.pricing.schema

Malli schemas for coerced GridX pricing entities.

These describe the Clojure-native shape produced by gridx.pricing/curves: namespaced keywords, BigDecimals, Instants, OffsetDateTimes, and tick intervals.

Component names and price types cover both PG&E and SCE vocabularies.

Malli schemas for coerced GridX pricing entities.

These describe the Clojure-native shape produced by `gridx.pricing/curves`:
namespaced keywords, BigDecimals, Instants, OffsetDateTimes, and tick intervals.

Component names and price types cover both PG&E and SCE vocabularies.
raw docstring

gridx.pricing.schema.raw

Malli schemas for the raw GridX Pricing API response shape.

These mirror the JSON exactly: camelCase keys, string values. Covers both PG&E and SCE response formats (same structure, different component/priceType vocabularies).

Most consumers should use gridx.pricing.schema (the coerced schemas) instead — these are primarily useful for boundary validation.

Malli schemas for the raw GridX Pricing API response shape.

These mirror the JSON exactly: camelCase keys, string values.
Covers both PG&E and SCE response formats (same structure,
different component/priceType vocabularies).

Most consumers should use `gridx.pricing.schema` (the coerced schemas)
instead — these are primarily useful for boundary validation.
raw docstring

gridx.sce.client

SCE-specific GridX Pricing API client.

Wraps gridx.client with SCE defaults: utility, market, program, and API URLs. The OpenAPI spec at gridx-pricing-spec/sce/openapi.yaml defines the available rate schedules and circuit names.

Required params for get-pricing: :startdate - "YYYYMMDD" (earliest 20250701) :enddate - "YYYYMMDD" (max ~2 weeks span) :ratename - SCE rate schedule code (e.g. "TOU-EV-9S") :representativeCircuitId - substation name (e.g. "System", "Alamitos")

SCE-specific GridX Pricing API client.

Wraps `gridx.client` with SCE defaults: utility, market, program,
and API URLs. The OpenAPI spec at `gridx-pricing-spec/sce/openapi.yaml`
defines the available rate schedules and circuit names.

Required params for `get-pricing`:
  :startdate             - "YYYYMMDD" (earliest 20250701)
  :enddate               - "YYYYMMDD" (max ~2 weeks span)
  :ratename              - SCE rate schedule code (e.g. "TOU-EV-9S")
  :representativeCircuitId - substation name (e.g. "System", "Alamitos")
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close