Packages ======== This page lists note-worthy classes and data models. ``energyquantified`` -------------------- The top-level package with the main class: * :py:class:`EnergyQuantified `: The client class. Use this class to initialize the client with an API key and to access API operations. There is also additional class available here: * :py:class:`RealtoConnection `: An alternative client class for Realto users. Use this class to connect to the API via a Realto subscription. ``energyquantified.data`` ------------------------- Where the time series, period-based series and OHLC data models are implemented: * :py:class:`Timeseries `: The time series data model. A time series is more or less a series of values. There are three different value types: * :py:class:`Value ` * :py:class:`ScenariosValue ` * :py:class:`MeanScenariosValue ` * :py:class:`TimeseriesList `: A list of time series objects. * :py:class:`Periodseries `: The period-based series data model. It has two different period types: * :py:class:`Period ` * :py:class:`CapacityPeriod ` * :py:class:`OHLC `: A data class for a single OHLC. OHLC objects has a reference to: * :py:class:`Product `: A description of a traded product (future contract). * :py:class:`OHLCList `: A list of OHLC data objects. * :py:class:`SRMC `: The server response from an short-run marginal cost (SRMC) calculation. It has multiple attributes, most are defined and used elsewhere. But it has one that is specific for SRMC: * :py:class:`SRMCOptions `: A data class holding all factors used in an SRMC calculation. * :py:class:`AbsoluteResult `: The absolute forecast data model. It has multiple attributes, most of which are defined and used elsewhere, but the ``items`` attribute is a list of AbsoluteItem's exclusively used in AbsoluteResult: * :py:class:`AbsoluteItem `: A data class consisting of an instance and a value. The value is the instance's forecasted value for the delivery of the AbsoluteResult. ``energyquantified.metadata`` ----------------------------- Metadata classes are data classes with constants, such as enumerators. There are quite many classes in ``energyquantified.metadata``: * These two enumerators are useful for aggregation: * :py:class:`Aggregation `: Aggregetion methods such as mean, max, min, and so forth. * :py:class:`Filter `: Enumerator of filters for electricity futures products such as base, peak. * :py:class:`Area `: Representing a price area (or country). An area has a set of exchange :py:class:`Border ` with some capacity :py:class:`Allocation `. * :py:class:`Curve `: The identifier of any data series on Energy Quantified. Curves have a :py:class:`CurveType ` to define its storage types (time series, instance, period-based, OHLC) and :py:class:`DataType ` for its data type (forecast, normal, actual, etc.) * :py:class:`Instance `: The identifier of any instance (forecasts, mostly). * :py:class:`Place `: An identifier of anything with a geographical location, such as a powerplant, a large consumer, a location on a river. See :py:class:`PlaceType ` for all types. * For :py:class:`OHLC ` data, these metadata classes are used: * :py:class:`OHLCField `: Enumerator of fields in OHLC data objects. * :py:class:`ContractPeriod `: Enumerator of contract periods for OHLC data objects. Typically week, month, quarter, year. * These classes are used for subscription information: * :py:class:`Subscription `: A class describing your subscription for a given curve. * :py:class:`SubscriptionAccess `: Enumerator of access levels for subscriptions. * :py:class:`SubscriptionType `: Enumerator of subscription types. * :py:class:`SubscriptionCollectionPerm `: Enumerator of user's permission for a collection. ``energyquantified.user`` ------------------------- User classes provide details for the user account: * :py:class:`User `: The user account details. * :py:class:`Organization `: The organization details. * :py:class:`AccountManager `: The account manager details. ``energyquantified.time`` ------------------------- Date and time utilities. * :py:class:`Resolution `: A combination of a frequency and a timezone. It has utility methods for stepping forward and backward in a given interval. * :py:class:`Frequency `: Enumerator of supported frequencies on Energy Quantified. Mostly used for aggregations and in combination with resolutions. * Commonly used timezones in the European power markets: * :py:class:`UTC ` – Universal Time * :py:class:`CET ` – Central European Time * :py:class:`EET ` – Eastern European Time * :py:class:`WET ` – Western European Time * :py:class:`TRT ` – Turkish Time * :py:meth:`local_tz() `: Get your the local timezone on your workstation. * Useful functions to get dates and date-times: * :py:meth:`now() `: Get a timezone aware date-time of the current time. * :py:meth:`today() `: Get a timezone aware date-time of the today at midnight. * :py:meth:`to_timezone() `: Convert a date-time to given timezone. * :py:meth:`get_date() `: Create a date with sensible defaults. * :py:meth:`get_datetime() `: Create a date-time with sensible defaults. ``energyquantified.utils`` -------------------------- Most utilities are internals, but there is one public-facing class in utils: * :py:class:`Page `: An immutable list with paging support. Typically used by the metadata APIs to browse "pages" when searching for curves and places. ``energyquantified.exceptions`` ------------------------------- All exceptions are defined in this package. * :py:class:`APIError `: Base exception for all API errors. It's subclasses are: * :py:class:`HTTPError ` * :py:class:`ValidationError ` * :py:class:`NotFoundError ` * :py:class:`UnauthorizedError ` * :py:class:`ForbiddenError ` * :py:class:`InternalServerError ` * :py:class:`InitializationError `: Exception for when client initialization fails. * :py:class:`PageError `: Exception for paging failures (see Page). * :py:class:`ParseException `: Exception for parsing errors on API responses. ``energyquantified.events`` ----------------------------- Implementation of event models and related metadata classes: Events from the stream are accessed through :py:meth:`eq.events.get_next() `, and there are a few different event models. What is common for all events is that they have the ``event_type`` property with an :py:class:`energyquantified.events.EventType`. The different events and possible event types: * :py:class:`CurveUpdateEvent `: The curve event data model. Curve events describe change in data for a :py:class:`Curve `, sometimes also related to an :py:class:`Instance `. How data is changed is described by the ``event_type``: * :py:class:`EventType.CURVE_UPDATE `: Data in a curve is updated * :py:class:`EventType.CURVE_DELETE `: Some data in a curve (or an entire instance) is removed * :py:class:`EventType.CURVE_TRUNCATE `: All data in a curve is removed * :py:class:`ConnectionEvent `: Describes change in the stream connection, such as the cause of a disconnect. Possible event types: * :py:class:`EventType.DISCONNECTED `: Not connected. The cause (e.g., disconnect or never with connected with :py:meth:`eq.events.connect() `) is described by other attributes in the ``ConnectionEvent``. * :py:class:`TimeoutEvent `: Filler event that enable users to act in between events during quiet times. Timeout events are only generated if the ``timeout`` parameter is set when iterating :py:meth:`eq.events.get_next() `. The single event type: * :py:class:`EventType.TIMEOUT `: No new events in the last ``timeout`` seconds Subscribe to curve events in :py:meth:`eq.events.subscribe_curve_events() ` with a list of any of the following filters: * :py:class:`CurveNameFilter `: Filter by exact curves * :py:class:`CurveAttributeFilter `: Search filters similar to the curve search (metadata) A successful subscribe returns a :py:class:`energyquantified.events.CurvesSubscribeResponse` object which consists of the filters and (optionally) event ID subscribed with, confirmed by the server. Request the currently active curve event filters from the server with :py:meth:`eq.events.get_curve_filters() `.