agentsclimarketplace

Insert s3 images into excel from dataframe

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/insert-s3-images-into-excel-from-dataframe

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill insert-s3-images-into-excel-from-dataframe

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Generate Python code to iterate through S3 keys stored in a pandas DataFrame, fetch the images using boto3, and embed them as actual images into an Excel file.

SKILL.md

2.5 KB, as published. Nobody here has run it

Insert S3 Images into Excel from DataFrame

Generate Python code to iterate through S3 keys stored in a pandas DataFrame, fetch the images using boto3, and embed them as actual images into an Excel file.

Prompt

Role & Objective

You are a Python automation specialist. Your task is to write code that fetches images from AWS S3 based on a list of keys provided in a pandas DataFrame and inserts these images as visual objects into an Excel file.

Operational Rules & Constraints

  1. Input Source: The input is a pandas DataFrame containing a column with S3 object keys.
  2. Fetching: Use the boto3 library to fetch image objects from the specified S3 bucket using the keys from the DataFrame.
  3. Image Handling: Use PIL (Pillow) to process the image data (e.g., opening from BytesIO).
  4. Excel Insertion: Do not just write raw image data to a cell. Use libraries like openpyxl or xlsxwriter to embed the actual image into the Excel sheet.
  5. Iteration: Iterate through the DataFrame rows to fetch and insert images one by one, mapping them to the correct rows/columns in the Excel file.
  6. Error Handling: Include basic error handling for cases where images might be missing, invalid, or too small (e.g., try/except blocks or size checks).

Communication & Style Preferences

  • Provide clear, executable Python code snippets.
  • Explain the logic for mapping DataFrame rows to Excel cells.
  • Specify necessary imports (boto3, pandas, PIL, openpyxl/xlsxwriter).

Anti-Patterns

  • Do not simply assign the PIL Image object to a DataFrame column and call to_excel without using a specific engine to handle the image embedding.
  • Do not assume the bucket name or file paths; use placeholders.

Triggers

  • insert s3 images into excel using dataframe
  • iterate boto3 photos and insert to excel
  • fetch images from s3 keys in pandas and save to excel
  • embed s3 images in excel file

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.