NPD I/O - NPS access library

The Norwegian Petroleum Directorate (NPD) maintains a comprehensive database of the activities in the North Sea. This is public real-time information, updated on a daily basis.

NPD offers an extensive online interface to this information through their NPD fact pages, but in order to get hold of the actual data for performing statistics, advanced computations, visualizations or create custom applications, a library like NPD I/O is required.

NPD I/O is available for Java (NpdIo.jar). The library is lightweight (< 100kB) and self-contained; It has no external dependencies. NPD I/O access data directly through HTTP - no login or password is required.

Videos

NPD
Illustrates the capabilities of NPD I/O and how the library is used in Log Studio. Shows the NPD data model and their associated views.


API Documentation

      NPD I/O for Java: Javadoc

      NPD I/O for .Net: Doxygen (on request)

Coding example

Below are a few examples on how to access some of the main data types from the NPD database.

Correct URLs for each NPD data type is available through the NPD web page.


   import no.petroware.npdio.field.*;
   import no.petroware.npdio.well.*;
   :

   //
   // Read development NPD wellbores
   //
   String url = "http://factpages.npd.no/ReportServer?/FactPages/TableView/wellbore_development_all" + "&" +
                "rs:Command=Render" + "&" +
                "rc:Toolbar=false" + "&" +
                "rc:Parameters=f" + "&" +
                "rs:Format=CSV" + "&" +
                "Top100=false" + "&" +
                "IpAddress=80.239.106.206" + "&" +
                "CultureCode=en";
   List<NpdWellbore> npdWellbores = NpdWellDataReader.readDevelopmentWellbores(url);

   // Loop over the wellbores and write to stdout
   for (NpdWellbore npdWellbore : npdWellbores)
     System.out.println(npdWellbore);

   :


   //
   // Read NPD fields
   //
   String url = ...
   List<NpdField> npdFields = NpdFieldReader.readFields(url);

   // Read production data for all fields
   String url = ...
   ProductionReader.readProduction(url, npdFields);

   // Loop over the fields and write oil production to stdout
   for (NpdField npdField : fields) {
     Production production = field.getProduction();

     for (Production.Entry productionEntry : production.getEntries()) {
       int year = productionEntry.getYear();
       int month = productionEntry.getMonth();

       double oilProduction = productionEntry.getOil();

       System.out.println("Oil production: " + year + "/" + month + ": " + oilProduction);
     }
   }

   :

Note that in an actual client implementation the reading process would better be done asynchronous in threads. The NPD I/O library is all thread-safe.

NPD I/O includes Java implementations for the NPD data types wellbore, license, field, company, survey, facility, discovery, business arrangement area, pipeline and stratigraphy.