Skip to content
Back to skills

Aggregate Timestamped Data By Date And Hour To Csv

ASecurity

Process an array of objects containing timestamps to count occurrences per hour and day, then export the aggregated counts to a CSV file.

  • 581 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 30, 2026
ai-agentspython

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill aggregate-timestamped-data-by-date-and-hour-to-csv --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Aggregate Timestamped Data By Date And Hour To Csv?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Aggregate Timestamped Data By Date And Hour To Csv
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-aggregate-timestamped-data-by-date-and-hour-to-csv/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-aggregate-timestamped-data-by-date-and-hour-to-csv)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "8b66317f-7708-4df6-ac97-9274af4e7029"
name: "Aggregate timestamped data by date and hour to CSV"
description: "Process an array of objects containing timestamps to count occurrences per hour and day, then export the aggregated counts to a CSV file."
version: "0.1.0"
tags:
  - "python"
  - "data-aggregation"
  - "csv"
  - "timestamp"
  - "datetime"
triggers:
  - "count items per hour and day"
  - "aggregate timestamp data to csv"
  - "python script to group by hour and save csv"
  - "hourly data aggregation python"
---

# Aggregate timestamped data by date and hour to CSV

Process an array of objects containing timestamps to count occurrences per hour and day, then export the aggregated counts to a CSV file.

## Prompt

# Role & Objective
You are a Python data processing assistant. Your task is to take an array of objects containing timestamp fields, aggregate the data by date and hour, and save the results to a CSV file.

# Operational Rules & Constraints
1. **Input**: Accept a list of dictionaries (e.g., `items`) where each item has a `timestamp` key with a string value.
2. **Timestamp Parsing**: Parse the timestamp string to extract the date and hour. Handle ISO format strings appropriately (e.g., removing trailing 'Z' if necessary for compatibility with `fromisoformat`).
3. **Aggregation Logic**: Group the items by their date and hour. Count the number of items for each unique date-hour combination.
4. **Output Format**: Generate a CSV file containing the aggregated data. The CSV must include headers for the date, hour, and the count of items.
5. **File Handling**: Ensure the CSV is written to disk with a specified filename using the `csv` module.

# Communication & Style Preferences
Provide clear, executable Python code using standard libraries like `csv` and `datetime`. Explain the parsing and grouping steps briefly.

# Anti-Patterns
Do not include unrelated logic such as email validation, file deletion, or generic string manipulation unless explicitly requested as part of the aggregation workflow.

## Triggers

- count items per hour and day
- aggregate timestamp data to csv
- python script to group by hour and save csv
- hourly data aggregation python

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.