qp-well-parser
A small package to help destructure api responses into standard well objects
Last updated 6 months ago by jtaks .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install qp-well-parser 
SYNC missed versions from official npm registry.

qp-well-parser

A helper function that parses wells from the api into a standard format

Usage

Importing:

const WellParser = require('qp-well-parser')
// import WellParser from 'qp-well-parser'

// initialize the parser to use a specific QueryPark api version
// defaults to latest
const wellParser = WellParser('v1')

API

version

console.log(wellParser.apiVersion) // v1

parse

const standardWell = wellParser.valueOf()
console.log(standardWell)
/*
{
  uuid: '',
  primaryHeader: {
    label: '',
    value: ''
  },
  subheader: {
    label: '',
    value: ''
  },
  govId: {
    label: '',
    value: ''
  },
  surfaceLocation: {
    label: '',
    value: ''
  },
  owner: {
    label: '',
    value: ''
  },
  attributes: {
    country: '',
    region: '',
    coordinates: {
      lat: 0,
      lon: 0
    },
    wellStatus: '',
    substance: '',
    drillDirection: '',

    isLatest: true
  },
  wellData: {}
}
*/

const well = {
  "FieldCenter": "Medicine Hat",
  "WellName": "HANSAR ENERGY DD CHINCO 1-1-8-13",
  "LicenseNumber": "0443004",
  "DrillingOperation": "DIRECTIONAL",
  "UWI": "100/01-01-008-13W4/00",
  "WellType": "PRODUCTION",
  "ProjectedDepth": 1132,
  "TerminatingZone": "LIVINGSTONE FM",
  "Field": "UNDEFINED",
  "GroundElevation": 847.4,
  "WellPurpose": "NEW",
  "LaheeClassification": "NPW (C)",
  "MineralRights": "ALBERTA CROWN",
  "CreatedDate": 1326870000000,
  "SurfaceCoordinates": "N 395.8M W 546.8M",
  "Substance": "GAS",
  "SurfaceLocation": "02-01-008-13W4",
  "Licensee": "HANSAR ENERGY CORP.",
  "Uuid": "30d3c778-ef5e-44b4-903e-3daa26c291b5",
  "Region": "AB",
  "Country": "CA",
  "StatusDate": 1330637400000,
  "Next": "null",
  "Prev": "32e919af-3744-4eb1-a4d1-3846e8f6a264",
  "LicenseeName": "Hansar Energy Corp.",
  "ActivityType": "Drill To LD",
  "ContractorCode": "0ZM7",
  "ContractorName": "Champion Drilling Inc.",
  "LicenseeCode": "A645",
  "RigNumber": "333"
}

const parsedWell = wellParser(well)
// const parsedWell = wellParser.v1Parse(well)

console.log(parsedWell)
/*
{
  uuid: '30d3c778-ef5e-44b4-903e-3daa26c291b5',
  primaryHeader: {
    label: 'Well Name',
    value: 'HANSAR ENERGY DD CHINCO 1-1-8-13'
  },
  subheader: {
    label: 'UWI',
    value: '100/01-01-008-13W4/00'
  },
  govId: {
    label: 'License Number',
    value: '0443004'
  },
  surfaceLocation: {
    label: 'Surface Location',
    value: '02-01-008-13W4'
  },
  owner: {
    label: 'Licensee',
    value: 'HANSAR ENERGY CORP.'
  },
  attributes: {
    country: 'CA',
    region: 'AB',
    coordinates: null,

    wellStatus: 'NPW (C)',
    substance: 'GAS',
    drillDirection: 'DIR',

    isLatest: true
  },
  wellData: { ... }
}
*/

Current Tags

  • 4.0.1                                ...           latest (6 months ago)

20 Versions

  • 4.0.1                                ...           6 months ago
  • 4.0.0                                ...           6 months ago
  • 3.2.2                                ...           7 months ago
  • 3.2.1                                ...           8 months ago
  • 3.2.0                                ...           9 months ago
  • 3.1.0                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.4                                ...           2 years ago
  • 1.2.3                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |