<jupyter_start><jupyter_text>Field wraper NPD The main objective of the wraper is to facilitate extracting data at the field level from NPD using their API<jupyter_code>from npd_wraper import field
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>field Monthly production  Objective is to extract historical production at field level on a monthly basis, an option to filter by a field level is also availableThe result will be a dataframe that could be used for futther processing  1- Extract production for a specific field  lets extract and plot production for "visund" field<jupyter_code># extract field production for visund as an example
df=field().get_field_production_monthly(field_name="visund")
df.plot(kind="area",subplots=True, figsize=(16,9))<jupyter_output><empty_output><jupyter_text>2- Check the best field this year:Let's ranq the best 20 fields roduction this year<jupyter_code>fig=plt.figure(figsize=(8,12))
df= field().get_field_production_yearly()

#deal with some issues on npd database
df["prfPrdOeNetMillSm3"]=df["prfPrdOeNetMillSm3"].str.strip("(").str.strip(")")
df["prfPrdOeNetMillSm3"]=df["prfPrdOeNetMillSm3"].astype("float")

#extract the current year production
df=df.loc["2020",]
df.set_index('prfInformationCarrier')["prfPrdOeNetMillSm3"].sort_values(ascending=False)[:20].plot(kind="barh")<jupyter_output><empty_output><jupyter_text>3-Field description This is very useful to get some insights on each field Let s check field description on __johan sverdrup__ !<jupyter_code>df=field().get_field_description(field_name="johan sverdrup")

#development attribute
for attrib in df.fldDescriptionHeading.unique():
    print(f"{attrib}: \n")
    print (f"{df[df['fldDescriptionHeading']==attrib].values[0]}\n\n")<jupyter_output>Development: 

['Johan Sverdrup is a field on the Utsira High in the central part of the North Sea, 65 kilometres northeast of the Sleipner fields. The water depth is 115 metres. <NAME> was discovered in 2010 and the plan for development and operation (PDO) for Phase I was approved in 2015. The development solution for the first development phase is a field centre with four specialised platforms: living quarters, process, drilling and riser facilities. The four platforms are connected by bridges. The drilling platform has 48 well slots and is prepared for simultaneous drilling, well intervention and production. The field will be operated with power from shore throughout its lifetime. The PDO for Phase II was approved in May 2019. The development solution for the second phase comprises a process platform and five subsea templates. Modification work will in addition be performed on the riser platform.'
 '<NAME>' '22.09.2020' 'Development' '26376286' '13.02.2020']


Reserv[...]<jupyter_text>4- Field in place return field inplace per field, let s investigate field in place in __Oseberg__<jupyter_code>df=field().get_field_inplace_volume(field_name="oseberg")
df[['fldInplaceAssGas','fldInplaceFreeGas','fldInplaceAssLiquid','fldInplaceOil']].T.plot(kind="pie", subplots=True)<jupyter_output><empty_output><jupyter_text>To get some key information on each field .... __get_field_overview__ would be quite helpful<jupyter_code>df=field().get_field_overview(field_name="oseberg")
df.T<jupyter_output><empty_output><jupyter_text>5-Field reserves return a field reserve per field, could get both recoverable and the remaining reserves let s get a reserve in grane<jupyter_code>df=field().get_field_reserves(field_name="grane")
df[["fldRemainingOil","fldRemainingGas"]].T<jupyter_output><empty_output><jupyter_text>6- Field investments<jupyter_code>df=field().get_field_investments(field_name="grane")
df.set_index("prfYear")['prfInvestmentsMillNOK'].plot(kind="bar", figsize=(10,8))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09626512361914781, 'fraction_numerical': 0.01893740136770121, 'mean_word_length': 7.546067415730337, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '451169', 'license': 'MIT', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1162, 'n_words': 367, 'path': 'docs/notebooks/field_wrapper.ipynb', 'repo_name': 'miroine/npd_data', 'size': '3818'}