Convert GlobalCache to Unfolded Circle Upload Format - Quickly Online

I’ve been trying to work out the best (quickest) way to upload IR codes into Entities on my new Remote 3.

The GlobalCache code sets are great but in the wrong format, so I wrote some code to convert them quickly. See Below

This is designed to be run on https://colab.research.google.com/ which allows free accounts so it should let anyone do a quick convert of a GlobalCache CSV File.

Instructions

  1. Go here and select the data SET you want Database | Global Caché Control Tower
  2. Check your email and copy and paste the data set to a file called something like SamsnugTV.csv
  3. Run the code
  4. Upload the CSV File
  5. Wait a few seconds and it will auto download a UC-file.csv with the converted IR codes into the correct format to upload into Entities in the UC interface.
  6. Go to your remote interface
  7. Create new IR with EMPTY IRs
  8. Upload the UC-File.csv
  9. You should now have a fully working Entity with all the codes from GlobalCache
  10. Ensure the Dock is set to IR Blast on at least one IR Port

Hope this is useful to others.

p.s. think it might be a good idea to have a page on the forum for Converted CSVs aka a Database for others to share.

import pandas as pd
from google.colab import files
import os

# Upload the input CSV file
print("Please upload your CSV file")
uploaded = files.upload()

# Get the name of the uploaded file
if not uploaded:
    print("No file uploaded. Please try again.")
    raise SystemExit

input_file = list(uploaded.keys())[0]
output_file = 'UC-' + input_file

print(f"Processing file: '{input_file}'")


# Read the input CSV
try:
    df = pd.read_csv(input_file)
except FileNotFoundError:
    print(f"Error: '{input_file}' not found after upload. This is unexpected.")
    raise
except Exception as e:
    print(f"Error reading '{input_file}': {str(e)}")
    raise

# Normalize column names (strip spaces, convert to lowercase)
df.columns = df.columns.str.strip().str.lower()

# Check if required columns exist
required_columns = ['function', 'hexcode1']
if not all(col in df.columns for col in required_columns):
    print(f"Error: Missing columns. Available columns: {df.columns.tolist()}")
    raise SystemExit

# Rename columns
df = df.rename(columns={'function': 'key', 'hexcode1': 'code'})

# Clean up the 'code' column: remove leading/trailing spaces and quotes
df['code'] = df['code'].str.strip().str.strip('"')


# Add 'format' column with static value 'PRONTO'
df['format'] = 'PRONTO'

# Select only the required columns
df = df[['key', 'format', 'code']]

# Save to new CSV
try:
    df.to_csv(output_file, index=False)
    print(f"Conversion complete. Output saved to '{output_file}'.")
    # Download the output file
    files.download(output_file)
except Exception as e:
    print(f"Error writing to '{output_file}': {str(e)}")
    print("DataFrame content (you can copy this if file saving fails):")
    print(df.to_csv(index=False))

# Optional: Display the DataFrame for verification
print("\nOutput DataFrame preview:")
print(df.head())

Edit 2nd July 2025 Updated the code above to remove extra spaces and " from the HexCode that appear in several of GlobalCache Sets of data causing upload problems

2 Likes

You don’t need a script for this. Just change hexcode1 to code in the first line and save it as a csv file. This works as all non needed columns are ignored.

1 Like

I tried that based on answers on this forum and it only loaded some of the rows at best and total error at worst.

So I created this to load 140+ codes without error.

If there is a better way please ignore or delete this post. :wink: Sorry it it did not help.

Can you please tell me how to Run the code you posted in step 3 above. I am not a software programmer so do not know how to run this script in https://colab.research.google.com/ that you mentioned. Can you please give me guidance to do this. Trevor

  1. Open URL https://colab.research.google.com/

  2. Click New Notebook in Drive Google Colab

  3. Copy and Paste the Code into the Box

  4. Click the Play Button

  5. Scroll down to the bottom of the page

  6. Click Choose Files

  7. Select your CSV File from GlobalCache the program then converts it.

  8. Check your downloads for a new file named with a prefix of UC- which will look like this and is now the format the the remote template recommended.

  9. Rename that file so it had .csv at the end and use that to upload to the Remote.

Hope this helps.

Can you name a device where my method doesn’t work? I suspect a formatting error when copying the text from the mail.

I’ve converted so many I can’t remember which ones, but if you work for GlobalCache thank you so much for all the codes and the database. It’s really appreciated and a great source of information.

Thanks for your really clear instructions. I followed everything you said and uploaded the file to Colabs when prompted. After twenty minutes it still says it is processing the file. Is this normal or has it crashed. I used my Mac to search for files beginning with UC_ but I found nothing on my Mac . Trevor

When you uploaded the CSV file do you see this below

If not please screen shot what you see