No project description provided
Project description
purr_geographix
Use purr_geographix to locate and query any GeoGraphix project* with zero setup via a simple Python API. It's the missing middleware API for taming an unruly geoscience data environment.
-
Dynamic discovery and query of projects (even lost, unshared)
-
Simple Python API
-
No license checkouts
-
Well-centric exports to JSON:
- completion
- core
- dst
- formation
- ip
- perforation
- production
- raster_log
- survey
- vector_log
- well
- zone
- Each GeoGraphix "project" is a semi-structured collection of E&P assets that interoperate with its own SQLAnywhere database. From an IT perspective, GeoGraphix is a distributed collection of user-managed databases "on the network" containing millions of assets.
Quickstart
PREREQUISITE: You'll need a SQLAnywhere database server instance. The best approach is to install purr_geographix on a PC that already has GeoGraphix. Technically, you could use just the SQLAnywhere client from SAP, but you'll still need a valid database server someplace. Contact me if you need help.
install
pip install purr_geographix
or
poetry add purr_geographix
launch:
uvicorn purr_geographix.main:app --workers 4
purr_geographix uses FastAPI.
You can test-drive your local API at: http://localhost:8000/docs
after install.
Usage
1. Do a POST /purr/ggx/repos/recon
with a network path and server hostname
The path can be a top-level container of GeoGraphix projects (i.e. a Project Home) or just a project itself. Include the server hostname. NOTE: We use the term repo and project interchangeably
or
curl -X 'POST' \
'http://localhost:8000/purr/ggx/repos/recon?recon_root=%5C%5Cscarab%5Cggx_projects&ggx_host=scarab' \
-H 'accept: application/json' \
-d ''
(Replace single quotes with double-quote for Windows)
This might take a few minutes, so you get a 202 Reponse
containing a task id and
task_status:
{
"id": "d0ce171c-3f0f-4b37-953b-fe9df2f14bd1",
"recon_root": "\\\\scarab\\ggx_projects\\",
"ggx_host": "scarab",
"task_status": "pending"
}
Metadata for each repo is stored in a local (sqlite) database.
2. Use the task id to check status with a GET to /purr/ggx/repos/recon/{task_id}
{
"id": "d0ce171c-3f0f-4b37-953b-fe9df2f14bd1",
"recon_root": "\\\\scarab\\ggx_projects\\",
"ggx_host": "scarab",
"task_status": "completed"
}
Possible status values are: pending
, in_progress
, completed
, or failed
.
3. Use the repo_id
to query asset data in a repo. Add a UWI filter to search for specific well identifiers.
This can also be time-consuming, so it returns a 202 Response
with a task id and the
pending export file.
{
"id": "f1de6c36-5693-4cbb-a4a1-9327af501ca1",
"task_status": "pending",
"task_message": "export file (pending): col_7159c5_1721489912_completion.json"
}
4. Check asset export with a GET to /purr/ggx/asset/{repo_id}/{asset}
Like repo/recon
, this returns a tast_status and task_message containing exported file
info.
{
"id": "f1de6c36-5693-4cbb-a4a1-9327af501ca1",
"task_status": "completed",
"task_message": "Exported 72 docs to: C:\\temp\\col_7159c5_1721489912_completion.json"
}
All asset data is exported as a "flattened" JSON representation of the original relational model. Here's a survey example.
Future
Let me know whatever you might want to see in a future release. Some ideas are:
- Better query logic: match terms with
AND
instead ofSIMILAR TO
(OR
) - Structured ASCII (Petra PPF or GeoGraphix ASCII3) exports instead of JSON
- Full Text Search
- Datum-shift and standardize on EPSG:4326 for polygon hull points
- Auto-sync with your PPDM or OSDU store?
- Standardize a multi-project interface with Spotfire
License
MIT License
Copyright (c) 2024 Bryan Hughes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for purr_geographix-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a82e1a6dbfe12b16ae1f509f530bc270f270f5979b995499788887ba1c14ae4b |
|
MD5 | 6a946a6174f922bef2332f89a9e15581 |
|
BLAKE2b-256 | ee57491f7f50f8759c414957332dd3c6edd0ef48ff9c62d17f5b66ab23b7ed67 |