code: def get_networks(base_file, ipaddr_file):
      
      networks = []
  
      base = open(base_file, 'r')
  
      csv_reader = csv.reader(base, delimiter='\t')
  
      buffer = ""
      for row in csv_reader:
  
          # Fixes quotation bug in ipplan exporter for base.txt
          if len(networks) > 0 and len(buffer) > 0:
              networks[-1]['comment'] += " ".join(buffer)
              buffer = ""
          if len(row) < 3:
              buffer = row
          else:
  
              network = {
                  'network': ipaddress.ip_network("{}/{}".format(row[0], row[2])),
                  'description': row[1],
                  'hosts': [],
                  'comment': ""
              }
  
              if len(row) > 3:
                  network['additional'] = " ".join(row[3:])
  
              networks.append(network)
  
      base.close()
  
      ipaddr = open(ipaddr_file, 'r')
  
      csv_reader = csv.reader(ipaddr, delimiter='\t')
      for row in csv_reader:
  
          host = {
              'ipaddr': ipaddress.ip_address(row[0]),
              'user': row[1],
              'location': row[2],
              'description': row[3],
              'fqdn': row[4],
              'phone': row[5],
              'mac': row[6]
          }
  
          if len(row) > 7:
              host['additional'] = " ".join(row[7:])
  
          add_ip_to_net(networks, host)
  
      ipaddr.close()
  
      return networks
docs: Gather network and host information from ipplan export files.