Files
ResInsight/scripting/pythoninterface/index.html
2025-02-14 14:03:39 +01:00

309 lines
21 KiB
HTML

<!DOCTYPE html>
<html lang="en-us" dir="ltr" itemscope itemtype="http://schema.org/Article" data-r-output-format="html">
<head>
<meta charset="utf-8">
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta name="generator" content="Hugo 0.142.0">
<meta name="generator" content="Relearn 7.3.2+7b470298046df2c96c0da9da07a54572b7c4e1b0">
<meta name="description" content="ResInsight provides a robust programming interface that allows you to interact with a running ResInsight instance using Python 3. This interface enables you to:
Start ResInsight from Python Communicate with a running ResInsight instance Load a ResInsight project file Load data files such as Eclipse EGRID files and summary files Extract data to Python for further processing and automation Export snapshots of graphics For configuration and detailed information, please refer to the ResInsight Python API.">
<meta name="author" content="">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Python Interface :: ResInsight">
<meta name="twitter:description" content="ResInsight provides a robust programming interface that allows you to interact with a running ResInsight instance using Python 3. This interface enables you to:
Start ResInsight from Python Communicate with a running ResInsight instance Load a ResInsight project file Load data files such as Eclipse EGRID files and summary files Extract data to Python for further processing and automation Export snapshots of graphics For configuration and detailed information, please refer to the ResInsight Python API.">
<meta property="og:url" content="https://resinsight.org/scripting/pythoninterface/index.html">
<meta property="og:site_name" content="ResInsight">
<meta property="og:title" content="Python Interface :: ResInsight">
<meta property="og:description" content="ResInsight provides a robust programming interface that allows you to interact with a running ResInsight instance using Python 3. This interface enables you to:
Start ResInsight from Python Communicate with a running ResInsight instance Load a ResInsight project file Load data files such as Eclipse EGRID files and summary files Extract data to Python for further processing and automation Export snapshots of graphics For configuration and detailed information, please refer to the ResInsight Python API.">
<meta property="og:locale" content="en_us">
<meta property="og:type" content="article">
<meta property="article:section" content="Scripting">
<meta itemprop="name" content="Python Interface :: ResInsight">
<meta itemprop="description" content="ResInsight provides a robust programming interface that allows you to interact with a running ResInsight instance using Python 3. This interface enables you to:
Start ResInsight from Python Communicate with a running ResInsight instance Load a ResInsight project file Load data files such as Eclipse EGRID files and summary files Extract data to Python for further processing and automation Export snapshots of graphics For configuration and detailed information, please refer to the ResInsight Python API.">
<meta itemprop="wordCount" content="75">
<title>Python Interface :: ResInsight</title>
<link href="/css/fontawesome-all.min.css?1739538141" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/css/fontawesome-all.min.css?1739538141" rel="stylesheet"></noscript>
<link href="/css/auto-complete.css?1739538141" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/css/auto-complete.css?1739538141" rel="stylesheet"></noscript>
<link href="/css/perfect-scrollbar.min.css?1739538141" rel="stylesheet">
<link href="/css/theme.min.css?1739538141" rel="stylesheet">
<link href="/css/format-html.min.css?1739538141" rel="stylesheet" id="R-format-style">
<script>
window.relearn = window.relearn || {};
window.relearn.relBasePath='..\/..';
window.relearn.relBaseUri='..\/..';
window.relearn.absBaseUri='https:\/\/resinsight.org';
window.relearn.min = `.min`;
window.relearn.disableAnchorCopy=false;
window.relearn.disableAnchorScrolling=false;
// variant stuff
window.relearn.themevariants = [ 'relearn' ];
window.relearn.customvariantname = "my-custom-variant";
window.relearn.changeVariant = function(variant) {
var oldVariant = document.documentElement.dataset.rThemeVariant;
window.localStorage.setItem(window.relearn.absBaseUri + "/variant", variant);
document.documentElement.dataset.rThemeVariant = variant;
if (oldVariant != variant) {
document.dispatchEvent( new CustomEvent('themeVariantLoaded', { detail: { variant, oldVariant } }) );
}
}
window.relearn.markVariant = function() {
var variant = window.localStorage.getItem(window.relearn.absBaseUri + "/variant");
var select = document.querySelector("#R-select-variant");
if (select) {
select.value = variant;
}
}
window.relearn.initVariant = function() {
var variant = window.localStorage.getItem(window.relearn.absBaseUri + "/variant") ?? "";
if( variant == window.relearn.customvariantname ){
}else if( !variant || !window.relearn.themevariants.includes(variant) ){
variant = window.relearn.themevariants[0];
window.localStorage.setItem(window.relearn.absBaseUri + "/variant", variant);
}
document.documentElement.dataset.rThemeVariant = variant;
}
window.relearn.initVariant();
window.relearn.markVariant();
// translations
window.T_Copy_to_clipboard = `Copy to clipboard`;
window.T_Copied_to_clipboard = `Copied to clipboard!`;
window.T_Copy_link_to_clipboard = `Copy link to clipboard`;
window.T_Link_copied_to_clipboard = `Copied link to clipboard!`;
window.T_Reset_view = `Reset view`;
window.T_View_reset = `View reset!`;
window.T_No_results_found = `No results found for "{0}"`;
window.T_N_results_found = `{1} results found for "{0}"`;
</script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
displayMath: [['$$','$$'], ['\\[','\\]']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: { equationNumbers: { autoNumber: "AMS" },
extensions: ["AMSmath.js", "AMSsymbols.js"] }
},
menuSettings: { renderer: "CommonHTML" }
});
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax();
while(jax = all.pop()) {
jax.SourceElement().parentNode.className += ' has-jax';
}
});
MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
</head>
<body class="mobile-support html" data-url="/scripting/pythoninterface/index.html">
<div id="R-body" class="default-animation">
<div id="R-body-overlay"></div>
<nav id="R-topbar">
<div class="topbar-wrapper">
<div class="topbar-sidebar-divider"></div>
<div class="topbar-area topbar-area-start" data-area="start">
<div class="topbar-button topbar-button-sidebar" data-content-empty="disable" data-width-s="show" data-width-m="hide" data-width-l="hide"><button class="topbar-control" onclick="toggleNav()" type="button" title="Menu (CTRL&#43;ALT&#43;n)"><i class="fa-fw fas fa-bars"></i></button>
</div>
<div class="topbar-button topbar-button-toc" data-content-empty="hide" data-width-s="show" data-width-m="show" data-width-l="show"><button class="topbar-control" onclick="toggleTopbarFlyout(this)" type="button" title="Table of Contents (CTRL&#43;ALT&#43;t)"><i class="fa-fw fas fa-list-alt"></i></button>
<div class="topbar-content">
<div class="topbar-content-wrapper">
</div>
</div>
</div>
</div>
<ol class="topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype="http://schema.org/BreadcrumbList"><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><a itemprop="item" href="/index.html"><span itemprop="name">ResInsight</span></a><meta itemprop="position" content="1">&nbsp;>&nbsp;</li><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><a itemprop="item" href="/scripting/index.html"><span itemprop="name">Scripting</span></a><meta itemprop="position" content="2">&nbsp;>&nbsp;</li><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name">Python Interface</span><meta itemprop="position" content="3"></li>
</ol>
<div class="topbar-area topbar-area-end" data-area="end">
<div class="topbar-button topbar-button-prev" data-content-empty="disable" data-width-s="show" data-width-m="show" data-width-l="show"><a class="topbar-control" href="/scripting/index.html" title="Scripting (🡐)"><i class="fa-fw fas fa-chevron-left"></i></a>
</div>
<div class="topbar-button topbar-button-next" data-content-empty="disable" data-width-s="show" data-width-m="show" data-width-l="show"><a class="topbar-control" href="/scripting/commandlineinterface/index.html" title="Command Line Interface (🡒)"><i class="fa-fw fas fa-chevron-right"></i></a>
</div>
<div class="topbar-button topbar-button-more" data-content-empty="hide" data-width-s="show" data-width-m="show" data-width-l="show"><button class="topbar-control" onclick="toggleTopbarFlyout(this)" type="button" title="More"><i class="fa-fw fas fa-ellipsis-v"></i></button>
<div class="topbar-content">
<div class="topbar-content-wrapper">
<div class="topbar-area topbar-area-more" data-area="more">
</div>
</div>
</div>
</div>
</div>
</div>
</nav>
<div id="R-main-overlay"></div>
<main id="R-body-inner" class="highlightable scripting" tabindex="-1">
<div class="flex-block-wrapper">
<article class="default">
<header class="headline">
</header>
<h1 id="python-interface">Python Interface</h1>
<p><a href="#R-image-c59d506c9187e16983adbae7d17bff37" class="lightbox-link"><img class="noborder lazy lightbox noshadow figure-image" loading="lazy" src="/images/scripting/python-logo-master-v3-TM.png" style=" height: auto; width: auto;"></a>
<a href="javascript:history.back();" class="lightbox-back" id="R-image-c59d506c9187e16983adbae7d17bff37"><img class="noborder lazy lightbox noshadow lightbox-image" loading="lazy" src="/images/scripting/python-logo-master-v3-TM.png"></a></p>
<p>ResInsight provides a robust programming interface that allows you to interact with a running ResInsight instance using <a href="https://www.python.org/download/releases/3.0/" rel="external" target="_blank">Python 3</a>. This interface enables you to:</p>
<ul>
<li>Start ResInsight from Python</li>
<li>Communicate with a running ResInsight instance</li>
<li>Load a ResInsight project file</li>
<li>Load data files such as Eclipse EGRID files and summary files</li>
<li>Extract data to Python for further processing and automation</li>
<li>Export snapshots of graphics</li>
</ul>
<p>For configuration and detailed information, please refer to the <a href="https://api.resinsight.org" rel="external" target="_blank">ResInsight Python API</a>.</p>
<footer class="footline">
</footer>
</article>
</div>
</main>
</div>
<aside id="R-sidebar" class="default-animation">
<div id="R-header-topbar" class="default-animation"></div>
<div id="R-header-wrapper" class="default-animation">
<div id="R-header" class="default-animation">
<a id="logo" href="https://resinsight.org/">
<img src="https://resinsight.org//images/ResInsightCroppedIconPicture.png">
</a>
</div>
<script>
window.index_js_url="/searchindex.en.js?1739538141";
</script>
<search><form action="/search/index.html" method="get">
<div class="searchbox default-animation">
<button class="search-detail" type="submit" title="Search (CTRL+ALT+f)"><i class="fas fa-search"></i></button>
<label class="a11y-only" for="R-search-by">Search</label>
<input data-search-input id="R-search-by" name="search-by" class="search-by" type="search" placeholder="Search...">
<button class="search-clear" type="button" data-search-clear="" title="Clear search"><i class="fas fa-times" title="Clear search"></i></button>
</div>
</form></search>
<script>
var contentLangs=['en'];
</script>
<script src="/js/auto-complete.js?1739538141" defer></script>
<script src="/js/lunr/lunr.min.js?1739538141" defer></script>
<script src="/js/lunr/lunr.stemmer.support.min.js?1739538141" defer></script>
<script src="/js/lunr/lunr.multi.min.js?1739538141" defer></script>
<script src="/js/lunr/lunr.en.min.js?1739538141" defer></script>
<script src="/js/search.js?1739538141" defer></script>
<script>
(function() {
const urlParams = new URLSearchParams(window.location.search);
const searchQuery = urlParams.get('q');
if (searchQuery) {
const newUrl = `/search/?search-by=${encodeURIComponent(searchQuery)}`;
window.location.replace(newUrl);
}
})();
</script>
</div>
<div id="R-homelinks" class="default-animation">
<hr class="padding">
</div>
<div id="R-content-wrapper" class="highlightable">
<div id="R-shortcutmenu-home" class="R-sidebarmenu">
<ul class="enlarge morespace collapsible-menu">
<li class="" data-nav-id="/releases/index.html"><a class="padding" href="/releases/index.html">Releases</a><ul id="R-subsections-a71c2f29677ba690c1b8bf454f228c9c" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/getting-started/index.html"><a class="padding" href="/getting-started/index.html">Getting Started</a><ul id="R-subsections-87c0363912f379e0725cbe1d504c985c" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/3d-main-window/index.html"><a class="padding" href="/3d-main-window/index.html">3D Main Window</a><ul id="R-subsections-122c1165ab4202e74b8e3c0619dc7420" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/plot-window/index.html"><a class="padding" href="/plot-window/index.html">Plot Main Window</a><ul id="R-subsections-6087943109d37785a7a7442a1415914b" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/calculated-data/index.html"><a class="padding" href="/calculated-data/index.html">Calculated Data</a><ul id="R-subsections-d7700e605b6718d9f0232aeb66e77ad1" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/wells-and-completions/index.html"><a class="padding" href="/wells-and-completions/index.html">Wells and Completions</a><ul id="R-subsections-6bd77eb465ff0d28f042f42913bdffda" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/import/index.html"><a class="padding" href="/import/index.html">Import</a><ul id="R-subsections-6394d937fb0ab7f32a2b2b5bee229032" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/export/index.html"><a class="padding" href="/export/index.html">Export</a><ul id="R-subsections-5d95f477b90785732dc9d6d81acc75cc" class="collapsible-menu"></ul></li>
<li class="parent " data-nav-id="/scripting/index.html"><a class="padding" href="/scripting/index.html">Scripting</a><ul id="R-subsections-184799376902c8c3045f6aad007b8b97" class="collapsible-menu">
<li class="active " data-nav-id="/scripting/pythoninterface/index.html"><a class="padding" href="/scripting/pythoninterface/index.html">Python Interface</a></li>
<li class="" data-nav-id="/scripting/commandlineinterface/index.html"><a class="padding" href="/scripting/commandlineinterface/index.html">Command Line Interface</a></li>
<li class="" data-nav-id="/scripting/commandfile/index.html"><a class="padding" href="/scripting/commandfile/index.html">Command File</a></li>
<li class="" data-nav-id="/scripting/octaveinterface/index.html"><a class="padding" href="/scripting/octaveinterface/index.html">Octave Interface</a></li>
<li class="" data-nav-id="/scripting/octaveinterfacereference/index.html"><a class="padding" href="/scripting/octaveinterfacereference/index.html">Octave Interface Reference</a></li></ul></li>
<li class="" data-nav-id="/misc/index.html"><a class="padding" href="/misc/index.html">Miscellaneous</a><ul id="R-subsections-f243eab41fb28f51378992bf36c41035" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/best-practices/index.html"><a class="padding" href="/best-practices/index.html">Best Practices</a><ul id="R-subsections-4f78aa4e6926d1389cf4d79364e23592" class="collapsible-menu"></ul></li>
<li class="" data-nav-id="/workflows/index.html"><a class="padding" href="/workflows/index.html">Workflows</a><ul id="R-subsections-87fd3d7b9e4d48a0ba290b60ba4064f4" class="collapsible-menu"></ul></li>
</ul>
</div>
<div id="R-shortcutmenu-shortcuts" class="R-sidebarmenu">
<ul class="space collapsible-menu">
<li class="" data-nav-id="/about"><a class="padding" href="/about"><i class='fas fa-info-circle'></i> About</a></li>
<li class="" data-nav-id="/training"><a class="padding" href="/training"><i class='fa fa-university'></i> Training</a></li>
<li class="" data-nav-id="/support"><a class="padding" href="/support"><i class='far fa-question-circle'></i> Support</a></li>
<li class="" data-nav-id="/releases"><a class="padding" href="/releases"><i class='fas fa-download'></i> Download and Install</a></li>
</ul>
</div>
<div class="padding footermargin footerLangSwitch footerVariantSwitch footerVisitedLinks footerFooter showFooter"></div>
<div id="R-menu-footer">
<hr class="padding default-animation footerLangSwitch footerVariantSwitch footerVisitedLinks footerFooter showFooter">
<div id="R-prefooter" class="footerLangSwitch footerVariantSwitch footerVisitedLinks">
<ul>
<li id="R-select-language-container" class="footerLangSwitch">
<div class="padding menu-control">
<i class="fa-fw fas fa-language"></i>
<span>&nbsp;</span>
<div class="control-style">
<label class="a11y-only" for="R-select-language">Language</label>
<select id="R-select-language" onchange="location = this.querySelector( this.value ).dataset.url;">
<option id="R-select-language-en" value="#R-select-language-en" data-url="/scripting/pythoninterface/index.html" lang="en-us" selected></option>
</select>
</div>
<div class="clear"></div>
</div>
</li>
<li id="R-select-variant-container" class="footerVariantSwitch">
<div class="padding menu-control">
<i class="fa-fw fas fa-paint-brush"></i>
<span>&nbsp;</span>
<div class="control-style">
<label class="a11y-only" for="R-select-variant">Theme</label>
<select id="R-select-variant" onchange="window.relearn.changeVariant( this.value );">
<option id="R-select-variant-relearn" value="relearn" selected>Relearn</option>
</select>
</div>
<div class="clear"></div>
</div>
<script>window.relearn.markVariant();</script>
</li>
<li class="footerVisitedLinks">
<div class="padding menu-control">
<i class="fa-fw fas fa-history"></i>
<span>&nbsp;</span>
<div class="control-style">
<button onclick="clearHistory();">Clear History</button>
</div>
<div class="clear"></div>
</div>
</li>
</ul>
</div>
<div id="R-footer" class="footerFooter showFooter"><a href="https://www.ceetronsolutions.com"><img src='https://resinsight.org//images/CeeSolLogoSmallForDarkBackground.png' style='width: 140px; '></a><br>
ResInsight is developed by <br> <a href="https://www.ceetronsolutions.com">Ceetron Solutions</a>
<p>in collaboration with</p>
<a href="https://www.equinor.com">Equinor ASA</a>
</div>
</div>
</div>
</aside>
<script src="/js/clipboard.min.js?1739538141" defer></script>
<script src="/js/perfect-scrollbar.min.js?1739538141" defer></script>
<script src="/js/theme.js?1739538141" defer></script>
</body>
</html>