1st Edition · 2026

Python for
Oil & Gas

Data Science, Engineering Analytics, and AIin the Petroleum Industry.

22 hands-on chapters taking you from Python fundamentals through PVT correlations, decline curve analysis, and reservoir simulation — all the way to machine learning and cloud deployment. Built on real Niger Delta field data.

By Johnpaul Okeke · SPE Member

Python for Oil & Gas book cover — learn Python for petroleum engineering, by Johnpaul Okeke

What You'll Learn

From Setup to Production

Each chapter builds on the last — starting with Python basics and ending with production-grade ML models deployed on the cloud. Every concept is grounded in real petroleum engineering problems.

terminal

Python Fundamentals

From zero to fluent — variables, functions, OOP, and the scientific stack tailored for petroleum workflows.

database

Petroleum Data Engineering

Load, clean, and transform LAS files, production CSVs, and well test data using Pandas and domain libraries.

calculate

Well Log Analysis

Compute porosity, water saturation, and net pay with Archie's equation and triple-combo log interpretation.

insights

Production Forecasting

Apply Arps decline curves, material balance, and nodal analysis to predict well and reservoir performance.

dashboard

Machine Learning

Build supervised and unsupervised models for facies classification, production prediction, and anomaly detection.

biotech

Dashboards & Deployment

Ship production-ready Streamlit and Dash apps, deploy to the cloud, and integrate with real-time SCADA data.

Who This Book Is For

Built for Engineers Who Build Things

school

Engineering Students

Supplement your petroleum engineering coursework with practical Python skills that employers actually look for.

engineering

Working Engineers

Automate repetitive calculations, build custom analysis tools, and make data-driven decisions faster.

code

Python Developers

Apply your existing programming skills to the energy sector — one of the world's largest and most data-rich industries.

Johnpaul Okeke — Author of Python for Oil & Gas

About the Author

Johnpaul Okeke

Petroleum engineer, SPE member, and the lead developer behind PhiDrillSim — a Python-based drilling simulation engine that models torque-and-drag, hydraulics, and rate-of-penetration in real time. Former VP of the NGA UNILAG Student Chapter, where he organized technical workshops bridging petroleum engineering and modern software practices.

His work focuses on what he calls “Industrial Intelligence” — applying Python, data science, and AI to solve real problems in the Nigerian oil and gas sector and beyond. This book distills that experience into 22 practical chapters.

verifiedSPE MemberterminalPhiDrillSim LeadschoolUNILAG

Pricing

Read free. Unlock the rest for $20.

The whole book is free to read, and you can run every exercise in your browser. One simple upgrade unlocks the parts you take with you.

Free

$0

Read & run — free forever.

  • check_circleRead all 22 chapters
  • check_circleRun code in the playground
  • check_circleGraded exercises + hints
  • check_circleReference solutions
Start reading free
Full Access

Full Access

$20

One-time — yours for good.

  • check_circleEverything in Free
  • check_circleCopy any code, freely
  • check_circleAI tutor — explain, chat, hints
  • check_circleDownload the book — PDF + EPUB
  • check_circleDownloadable datasets
  • check_circleLifetime access — no subscription
Get full access — $20

Python for the energy sector, in your inbox

Python tips for petroleum engineers, early access to new chapters, and case studies from real Niger Delta field operations.

No spam. Unsubscribe anytime.