Files
zynktime/CSV_FORMAT_EXAMPLES.md
T
2025-12-02 21:26:08 +01:00

2.0 KiB

CSV Format Examples

ZynkTime supports flexible CSV formats with automatic delimiter and column detection.

Example 1: Standard Time Reporting Format

reg_period,xreg_period,T,Time code,Time code (T),Vouch.date,Project Activity,Project Activity (T),Work package,Work package (T),Hours,Workflow status,Text
202544,,A,0,Standard Time,10/27/2025,,,,,2.00,N,
202544,,A,0,Standard Time,10/27/2025,,,,,2.00,N,
202544,,A,0,Standard Time,10/27/2025,,,,,4.00,N,
202544,,A,0,Standard Time,10/28/2025,,,,,4.00,N,
202544,,A,0,Standard Time,10/28/2025,,,,,1.00,N,

Result:

  • 2025-10-27: 8.0 hours
  • 2025-10-28: 5.0 hours

Example 2: Semicolon-Separated Format

project;task;user;status;notes;date;client;region;type;category;hours;approved
ProjectA;Task1;John;Done;Notes;01/15/2024;ClientX;EU;Dev;Backend;8.5;Yes
ProjectA;Task2;John;Done;Notes;01/16/2024;ClientX;EU;Dev;Backend;7,5;Yes

Result:

  • 2024-01-15: 8.5 hours
  • 2024-01-16: 7.5 hours

Features

Automatic Detection

  • Delimiter: Auto-detects comma (,) or semicolon (;)
  • Date Column: Searches for "date", "vouch", or similar keywords
  • Hours Column: Searches for "hour", "time" keywords
  • Date Formats: Supports MM/DD/YYYY and YYYY-MM-DD
  • Decimal Separator: Handles both comma and dot (, or .)

Data Processing

  • Header row automatically skipped
  • Whitespace trimmed from values
  • Hours below threshold (0.2) filtered out
  • Multiple entries for same date are aggregated
  • Invalid rows logged and skipped gracefully

Testing Your CSV

To test if your CSV will work:

# Method 1: Use the API
curl -X POST "http://localhost:8000/report-time?project_name=YourProject" \
  -F "file=@your_file.csv"

# Method 2: Use the CLI
python main.py cli
# Then follow the interactive prompts

The application will:

  1. Auto-detect your CSV format
  2. Show detected columns in logs
  3. Display parsed work time before submission
  4. Ask for confirmation before reporting