blob: 64de11cfdef1623a92ed95d38c6ff8cf7374cacd [file] [log] [blame]
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<!-- Elements added to main will be displayed on all pages -->
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="https://streampipes.apache.org/img/favicon/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-8.5.10">
<title>Client - Apache StreamPipes for Python</title>
<link rel="stylesheet" href="../../../assets/stylesheets/main.975780f9.min.css">
<link rel="stylesheet" href="../../../assets/stylesheets/palette.2505c338.min.css">
<link rel="stylesheet" href="../../../assets/_mkdocstrings.css">
<link rel="stylesheet" href="../../../stylesheets/extra.css">
<script>__md_scope=new URL("../../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
/* We explicitly disable cookie tracking to avoid privacy issues */
_paq.push(['disableCookies']);
/* Measure a visit to flink.apache.org and nightlies.apache.org/flink as the same visit */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "//analytics.apache.org/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '35']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="None" data-md-color-accent="None">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#streampipes.client.client" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<div data-md-component="outdated" hidden>
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../../.." title="Apache StreamPipes for Python" class="md-header__button md-logo" aria-label="Apache StreamPipes for Python" data-md-component="logo">
<img src="https://streampipes.apache.org/img/sp-logo-white-right.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Apache StreamPipes for Python
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Client
</span>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/apache/streampipes" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-tabs__inner md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href="../../.." class="md-tabs__link">
Home
</a>
</li>
<li class="md-tabs__item">
<a href="../../../getting-started/first-steps/" class="md-tabs__link">
Getting Started
</a>
</li>
<li class="md-tabs__item">
<a href="../../../examples/1-introduction-to-streampipes-python-client/" class="md-tabs__link">
Examples
</a>
</li>
<li class="md-tabs__item">
<a href="./" class="md-tabs__link md-tabs__link--active">
Reference
</a>
</li>
</ul>
</div>
</nav>
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../../.." title="Apache StreamPipes for Python" class="md-nav__button md-logo" aria-label="Apache StreamPipes for Python" data-md-component="logo">
<img src="https://streampipes.apache.org/img/sp-logo-white-right.png" alt="logo">
</a>
Apache StreamPipes for Python
</label>
<div class="md-nav__source">
<a href="https://github.com/apache/streampipes" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../.." class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2" type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2">
Getting Started
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Getting Started" data-md-level="1">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Getting Started
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../../getting-started/first-steps/" class="md-nav__link">
First Steps
</a>
</li>
<li class="md-nav__item">
<a href="../../../getting-started/developing/" class="md-nav__link">
Developing & Contributing
</a>
</li>
<li class="md-nav__item">
<a href="../../../getting-started/quickstart/" class="md-nav__link">
Quickstart
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
<label class="md-nav__link" for="__nav_3">
Examples
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../../examples/1-introduction-to-streampipes-python-client/" class="md-nav__link">
Introduction to StreamPipes Python
</a>
</li>
<li class="md-nav__item">
<a href="../../../examples/2-extracting-data-from-the-streampipes-data-lake/" class="md-nav__link">
Extracting Data from the StreamPipes data lake
</a>
</li>
<li class="md-nav__item">
<a href="../../../examples/3-getting-live-data-from-the-streampipes-data-stream/" class="md-nav__link">
Getting live data from the StreamPipes data stream
</a>
</li>
<li class="md-nav__item">
<a href="../../../examples/4-using-online-machine-learning-on-a-streampipes-data-stream/" class="md-nav__link">
Using Online Machine Learning on a StreamPipes data stream
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" checked>
<label class="md-nav__link" for="__nav_4">
Reference
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Reference" data-md-level="1">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_1" type="checkbox" id="__nav_4_1" checked>
<label class="md-nav__link" for="__nav_4_1">
Client
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Client" data-md-level="2">
<label class="md-nav__title" for="__nav_4_1">
<span class="md-nav__icon md-icon"></span>
Client
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Client
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
Client
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#streampipes.client.client" class="md-nav__link">
streampipes.client.client
</a>
</li>
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient" class="md-nav__link">
StreamPipesClient
</a>
<nav class="md-nav" aria-label="StreamPipesClient">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient.base_api_path" class="md-nav__link">
base_api_path
</a>
</li>
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient.http_headers" class="md-nav__link">
http_headers
</a>
</li>
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient.create" class="md-nav__link">
create()
</a>
</li>
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient.describe" class="md-nav__link">
describe()
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../config/" class="md-nav__link">
Config
</a>
</li>
<li class="md-nav__item">
<a href="../credential_provider/" class="md-nav__link">
Credential provider
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_2" type="checkbox" id="__nav_4_2" >
<label class="md-nav__link" for="__nav_4_2">
Endpoint
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Endpoint" data-md-level="2">
<label class="md-nav__title" for="__nav_4_2">
<span class="md-nav__icon md-icon"></span>
Endpoint
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../endpoint/endpoint/" class="md-nav__link">
Endpoint
</a>
</li>
<li class="md-nav__item">
<a href="../../endpoint/exceptions/" class="md-nav__link">
Exceptions
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_2_3" type="checkbox" id="__nav_4_2_3" >
<label class="md-nav__link" for="__nav_4_2_3">
Api
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Api" data-md-level="3">
<label class="md-nav__title" for="__nav_4_2_3">
<span class="md-nav__icon md-icon"></span>
Api
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../endpoint/api/data_lake_measure/" class="md-nav__link">
Data lake measure
</a>
</li>
<li class="md-nav__item">
<a href="../../endpoint/api/data_stream/" class="md-nav__link">
Data stream
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_3" type="checkbox" id="__nav_4_3" >
<label class="md-nav__link" for="__nav_4_3">
Function zoo
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Function zoo" data-md-level="2">
<label class="md-nav__title" for="__nav_4_3">
<span class="md-nav__icon md-icon"></span>
Function zoo
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../function_zoo/river_function/" class="md-nav__link">
River function
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_4" type="checkbox" id="__nav_4_4" >
<label class="md-nav__link" for="__nav_4_4">
Functions
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Functions" data-md-level="2">
<label class="md-nav__title" for="__nav_4_4">
<span class="md-nav__icon md-icon"></span>
Functions
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../functions/function_handler/" class="md-nav__link">
Function handler
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/registration/" class="md-nav__link">
Registration
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/streampipes_function/" class="md-nav__link">
Streampipes function
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_4_4" type="checkbox" id="__nav_4_4_4" >
<label class="md-nav__link" for="__nav_4_4_4">
Broker
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Broker" data-md-level="3">
<label class="md-nav__title" for="__nav_4_4_4">
<span class="md-nav__icon md-icon"></span>
Broker
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../functions/broker/broker/" class="md-nav__link">
Broker
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/broker/broker_handler/" class="md-nav__link">
Broker handler
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/broker/kafka_broker/" class="md-nav__link">
Kafka broker
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/broker/kafka_message_fetcher/" class="md-nav__link">
Kafka message fetcher
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/broker/nats_broker/" class="md-nav__link">
Nats broker
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/broker/output_collector/" class="md-nav__link">
Output collector
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_4_5" type="checkbox" id="__nav_4_4_5" >
<label class="md-nav__link" for="__nav_4_4_5">
Utils
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Utils" data-md-level="3">
<label class="md-nav__title" for="__nav_4_4_5">
<span class="md-nav__icon md-icon"></span>
Utils
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../functions/utils/async_iter_handler/" class="md-nav__link">
Async iter handler
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/utils/data_stream_context/" class="md-nav__link">
Data stream context
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/utils/data_stream_generator/" class="md-nav__link">
Data stream generator
</a>
</li>
<li class="md-nav__item">
<a href="../../functions/utils/function_context/" class="md-nav__link">
Function context
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_5" type="checkbox" id="__nav_4_5" >
<label class="md-nav__link" for="__nav_4_5">
Model
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Model" data-md-level="2">
<label class="md-nav__title" for="__nav_4_5">
<span class="md-nav__icon md-icon"></span>
Model
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../model/common/" class="md-nav__link">
Common
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_5_2" type="checkbox" id="__nav_4_5_2" >
<label class="md-nav__link" for="__nav_4_5_2">
Container
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Container" data-md-level="3">
<label class="md-nav__title" for="__nav_4_5_2">
<span class="md-nav__icon md-icon"></span>
Container
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../model/container/data_lake_measures/" class="md-nav__link">
Data lake measures
</a>
</li>
<li class="md-nav__item">
<a href="../../model/container/data_streams/" class="md-nav__link">
Data streams
</a>
</li>
<li class="md-nav__item">
<a href="../../model/container/resource_container/" class="md-nav__link">
Resource container
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_5_3" type="checkbox" id="__nav_4_5_3" >
<label class="md-nav__link" for="__nav_4_5_3">
Resource
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Resource" data-md-level="3">
<label class="md-nav__title" for="__nav_4_5_3">
<span class="md-nav__icon md-icon"></span>
Resource
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../model/resource/data_lake_measure/" class="md-nav__link">
Data lake measure
</a>
</li>
<li class="md-nav__item">
<a href="../../model/resource/data_lake_series/" class="md-nav__link">
Data lake series
</a>
</li>
<li class="md-nav__item">
<a href="../../model/resource/data_stream/" class="md-nav__link">
Data stream
</a>
</li>
<li class="md-nav__item">
<a href="../../model/resource/function_definition/" class="md-nav__link">
Function definition
</a>
</li>
<li class="md-nav__item">
<a href="../../model/resource/resource/" class="md-nav__link">
Resource
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#streampipes.client.client" class="md-nav__link">
streampipes.client.client
</a>
</li>
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient" class="md-nav__link">
StreamPipesClient
</a>
<nav class="md-nav" aria-label="StreamPipesClient">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient.base_api_path" class="md-nav__link">
base_api_path
</a>
</li>
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient.http_headers" class="md-nav__link">
http_headers
</a>
</li>
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient.create" class="md-nav__link">
create()
</a>
</li>
<li class="md-nav__item">
<a href="#streampipes.client.client.StreamPipesClient.describe" class="md-nav__link">
describe()
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/apache/streampipes/streampipes/client/client.py" title="Edit this page" class="md-content__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25Z"/></svg>
</a>
<h1>Client</h1>
<div class="doc doc-object doc-module">
<a id="streampipes.client.client"></a>
<div class="doc doc-contents first">
<p>Implementation of the StreamPipes client.
The client is designed as the central point of interaction with the StreamPipes API and
provides all functionalities to communicate with the API.</p>
<div class="doc doc-children">
<div class="doc doc-object doc-class">
<h2 id="streampipes.client.client.StreamPipesClient" class="doc doc-heading">
<code class="highlight language-python"><span class="n">StreamPipesClient</span><span class="p">(</span><span class="n">client_config</span><span class="p">,</span> <span class="n">logging_level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span></code>
<a href="#streampipes.client.client.StreamPipesClient" class="headerlink" title="Permanent link">&para;</a></h2>
<div class="doc doc-contents ">
<p>The client to connect to StreamPipes.
This is the central point of contact with StreamPipes and
provides all the functionalities to interact with it.</p>
<p>The client provides so-called "endpoints" each of which refers to
an endpoint of the StreamPipes API, e.g. <code>.dataLakeMeasureApi</code>.
An endpoint provides the actual methods to interact with StreamPipes
API (see endpoint.endpoint.APIEndpoint).</p>
<table>
<thead>
<tr>
<th><b>PARAMETER</b></th>
<th><b>DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>client_config</code></td>
<td class="doc-param-details">
<p>Configures the client to connect properly to the StreamPipes instance.</p>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-internal" title="streampipes.client.config.StreamPipesClientConfig" href="../config/#streampipes.client.config.StreamPipesClientConfig">StreamPipesClientConfig</a></code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>logging_level</code></td>
<td class="doc-param-details">
<p>Influences the log messages emitted by the <code>StreamPipesClient</code>.</p>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><span title="typing.Optional">Optional</span>[int]</code>
</span>
<span class="doc-param-default">
<b>DEFAULT:</b>
<code>logging.INFO</code>
</span>
</p>
</td>
</tr>
</tbody>
</table>
<p><strong>Examples:</strong></p>
<div class="highlight"><pre><span></span><code><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">streampipes.client</span> <span class="kn">import</span> <span class="n">StreamPipesClient</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">streampipes.client.config</span> <span class="kn">import</span> <span class="n">StreamPipesClientConfig</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">streampipes.client.credential_provider</span> <span class="kn">import</span> <span class="n">StreamPipesApiKeyCredentials</span>
</code></pre></div>
<div class="highlight"><pre><span></span><code><span class="gp">&gt;&gt;&gt; </span><span class="n">client_config</span> <span class="o">=</span> <span class="n">StreamPipesClientConfig</span><span class="p">(</span>
<span class="gp">... </span> <span class="n">credential_provider</span><span class="o">=</span><span class="n">StreamPipesApiKeyCredentials</span><span class="p">(</span>
<span class="gp">... </span> <span class="n">username</span><span class="o">=</span><span class="s2">&quot;test-user&quot;</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">api_key</span><span class="o">=</span><span class="s2">&quot;api-key&quot;</span>
<span class="gp">... </span> <span class="p">),</span>
<span class="gp">... </span> <span class="n">host_address</span><span class="o">=</span><span class="s2">&quot;localhost&quot;</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">https_disabled</span><span class="o">=</span><span class="kc">True</span>
<span class="gp">... </span><span class="p">)</span>
</code></pre></div>
<p>The following way of instantiating a client instance is
intended to be consistent with the StreamPipes Java client.</p>
<div class="highlight"><pre><span></span><code><span class="gp">&gt;&gt;&gt; </span><span class="n">client</span> <span class="o">=</span> <span class="n">StreamPipesClient</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">client_config</span><span class="o">=</span><span class="n">client_config</span><span class="p">)</span>
</code></pre></div>
<p>If you prefer a more pythonic way, you can simply write:</p>
<div class="highlight"><pre><span></span><code><span class="gp">&gt;&gt;&gt; </span><span class="n">client</span> <span class="o">=</span> <span class="n">StreamPipesClient</span><span class="p">(</span><span class="n">client_config</span><span class="o">=</span><span class="n">client_config</span><span class="p">)</span>
</code></pre></div>
<p>To interact with an endpoint:</p>
<div class="highlight"><pre><span></span><code><span class="gp">&gt;&gt;&gt; </span><span class="n">data_lake_measures</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">dataLakeMeasureApi</span><span class="o">.</span><span class="n">all</span><span class="p">()</span>
</code></pre></div>
<p>To inspect returned data as a pandas dataframe:</p>
<div class="highlight"><pre><span></span><code><span class="gp">&gt;&gt;&gt; </span><span class="n">data_lake_measures</span><span class="o">.</span><span class="n">to_pandas</span><span class="p">()</span>
<span class="go">#</span>
<span class="go"># measure_name timestamp_field ... pipeline_is_running num_event_properties</span>
<span class="go"># 0 test s0::timestamp ... False 2</span>
<span class="go"># [1 rows x 6 columns]</span>
</code></pre></div>
<div class="doc doc-children">
<div class="doc doc-object doc-attribute">
<h3 id="streampipes.client.client.StreamPipesClient.base_api_path" class="doc doc-heading">
<code class="highlight language-python"><span class="n">base_api_path</span><span class="p">:</span> <span class="nb">str</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-property"><code>property</code></small>
</span>
<a href="#streampipes.client.client.StreamPipesClient.base_api_path" class="headerlink" title="Permanent link">&para;</a></h3>
<div class="doc doc-contents ">
<p>Constructs the basic API URL from the given <code>client_config</code>.</p>
<table>
<thead>
<tr>
<th><b>RETURNS</b></th>
<th><b>DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="doc-returns-annotation">
<code>str of the basic API URL</code>
</span>
</td>
<td class="doc-returns-details">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h3 id="streampipes.client.client.StreamPipesClient.http_headers" class="doc doc-heading">
<code class="highlight language-python"><span class="n">http_headers</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">str</span><span class="p">]</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-property"><code>property</code></small>
</span>
<a href="#streampipes.client.client.StreamPipesClient.http_headers" class="headerlink" title="Permanent link">&para;</a></h3>
<div class="doc doc-contents ">
<p>Returns the HTTP headers required for all requests.
The HTTP headers are composed of the authentication headers supplied by the credential
provider and additional required headers (currently this is only the application header).</p>
<table>
<thead>
<tr>
<th><b>RETURNS</b></th>
<th><b>DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="doc-returns-annotation">
<code>Dictionary with header information as string key-value pairs.</code>
</span>
</td>
<td class="doc-returns-details">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h3 id="streampipes.client.client.StreamPipesClient.create" class="doc doc-heading">
<code class="highlight language-python"><span class="n">create</span><span class="p">(</span><span class="n">client_config</span><span class="p">,</span> <span class="n">logging_level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-classmethod"><code>classmethod</code></small>
</span>
<a href="#streampipes.client.client.StreamPipesClient.create" class="headerlink" title="Permanent link">&para;</a></h3>
<div class="doc doc-contents ">
<p>Returns an instance of the <code>StreamPipesPythonClient</code>.
Provides consistency to the Java client.</p>
<table>
<thead>
<tr>
<th><b>PARAMETER</b></th>
<th><b>DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>client_config</code></td>
<td class="doc-param-details">
<p>Configures the client to connect properly to the StreamPipes instance.</p>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-internal" title="streampipes.client.config.StreamPipesClientConfig" href="../config/#streampipes.client.config.StreamPipesClientConfig">StreamPipesClientConfig</a></code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>logging_level</code></td>
<td class="doc-param-details">
<p>Influences the log messages emitted by the <code>StreamPipesClient</code>.</p>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code>int</code>
</span>
<span class="doc-param-default">
<b>DEFAULT:</b>
<code>logging.INFO</code>
</span>
</p>
</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><b>RETURNS</b></th>
<th><b>DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="doc-returns-annotation">
<code><a class="autorefs autorefs-internal" title="streampipes.client.client.StreamPipesClient" href="#streampipes.client.client.StreamPipesClient">StreamPipesClient</a></code>
</span>
</td>
<td class="doc-returns-details">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h3 id="streampipes.client.client.StreamPipesClient.describe" class="doc doc-heading">
<code class="highlight language-python"><span class="n">describe</span><span class="p">()</span></code>
<a href="#streampipes.client.client.StreamPipesClient.describe" class="headerlink" title="Permanent link">&para;</a></h3>
<div class="doc doc-contents ">
<p>Prints short description of the connected StreamPipes instance and the available resources to the console.</p>
<table>
<thead>
<tr>
<th><b>RETURNS</b></th>
<th><b>DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="doc-returns-annotation">
<code> None</code>
</span>
</td>
<td class="doc-returns-details">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<!-- Copyright and theme information -->
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
Apache License 2.0
</div>
powered by
<a href="https://www.mkdocs.org" title="MkDocs">MkDocs</a>
and
<a href="https://squidfunk.github.io/mkdocs-material/"
title="Material for MkDocs">
Material for MkDocs</a>
</div>
<div class="md-social">
<a href="https://github.com/apache/streampipes" target="_blank" rel="noopener" title="github.com" class="md-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tabs", "navigation.instant", "navigation.indexes", "navigation.tracking"], "search": "../../../assets/javascripts/workers/search.16e2a7d4.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "version": {"provider": "mike"}}</script>
<script src="../../../assets/javascripts/bundle.5a2dcb6a.min.js"></script>
</body>
</html>