Python Forum
Start checking for geology reports
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Start checking for geology reports
#1
Ok Lars60+ please know that everyone here and in Denver are signing your praises and sending you huge thank yous for helping me.

Ok - that leads me to my next step. Let me know if you can think of an easier way. I would like to apply what I (think) have learned. I will post the code the way you have it written (in the typical Python format). I will then re-write it so it matches the new files to download and write what is new in a bold font.

This API is an idea of what I can expect to see. There will be other files as well (especially cores) but it won't be often. http://wogcc.state.wy.us/wellapi.cfm?nAp...ps=ID51558

Let me know if this works or perhaps you have a better idea. If so, I would love to hear it!

Again, your help is most appreciated not only by me, but the rest of the geology department as well!
Reply
#2
Give it a go, I or any other moderator would be glad to advise, but you caught me in a generous moment for the last one.
Will always advise.

Hint use dictionaries for code lookup:
for example:
class Codes:
    def __init__(self):
        self.GeologyCodes = {
            'Well File Status': {
                'PO': 'Producing Oil Well',
                'PG': 'Producing Gas Well',
                'DH': 'Dry Hole ',
                # Add rest of Well Status codes below
                'AP': 'Permit to Drill'
            },
            'Classification': {
                'O': 'Oil Well',
                'G': 'Gas Well',
                # Rest of Classification codes below
                'LW': 'LandOwner Water Well '
            }
            # 'Land Types', 'County Codes', etc. below
        }

    # This dictionary can saved as a json file and recalles in any script that needs it:

    def print_code(self, cd_type, code):
        """
        print_code(cd_type, code)

        Example: you get a well file status code from some data somewhere, and want to display that code

        :cd_type: Holds code type 'Well File Status', or 'Classification', etc.
        :code: Holds actual code like 'AP'
        
        :returns: None
        """
        print(self.GeologyCodes[cd_type][code])

    def try_status(self):
        """
        try_status()

        test print_code
        
        :returns: None
        """
        self.print_code('Well File Status', 'PG')
        code_type_from_file = 'Classification'
        code_from_file = 'LW'
        self.print_code(code_type_from_file, code_from_file)

if __name__ == '__main__':
    cd = Codes()
    cd.try_status()
results:
Output:
[Running] python "i:\python\WellInfo\src\Codes.py" Producing Gas Well LandOwner Water Well [Done] exited with code=0 in 0.054 seconds
Of course, dictionaries like this should be saved in appropriate directories as json data, and loaded when needed
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python best library for Excel reports & review of existing code MasterOfDestr 4 497 Feb-14-2024, 03:39 PM
Last Post: MasterOfDestr
  Help with Creating a Script for Automating Reports SunWers 1 1,882 Dec-29-2020, 10:21 PM
Last Post: jjc385
  Parsing Date/Time from Metar Reports with 6 hourly weather information Lawrence 0 2,289 May-03-2020, 08:15 PM
Last Post: Lawrence
  How do I generate reports in pdf format? okbeat9 2 3,220 Jan-13-2020, 04:38 AM
Last Post: okbeat9
  Python for Reports in HTML or PDF Format ImPyBoy17 1 3,072 Dec-10-2018, 09:35 PM
Last Post: j.crater
  UTF-8 decoder reports bad byte that is not there Skaperen 0 2,248 Oct-11-2018, 04:46 AM
Last Post: Skaperen
  Generate PDF reports giu88 7 9,112 Aug-26-2018, 02:00 PM
Last Post: giu88
  What's the difference b/w assigning start=None and start=" " Madara 1 2,276 Aug-06-2018, 08:23 AM
Last Post: buran
  Best software for creating printed reports? birdieman 5 4,358 Feb-02-2017, 02:39 AM
Last Post: birdieman
  Reports with Python? panoss 1 3,251 Jan-11-2017, 10:33 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020