Skip to content

Latest commit

 

History

History
129 lines (92 loc) · 2.66 KB

File metadata and controls

129 lines (92 loc) · 2.66 KB

harvest-exporter

Export timesheets from Harvest with currency conversion via Wise exchange rates.

Installation

nix shell github:numtide/freelancer-toolbox#harvest-exporter

Configuration

Set the following environment variables (or use CLI flags):

Variable Description
HARVEST_ACCOUNT_ID Your Harvest account ID
HARVEST_BEARER_TOKEN API token from Harvest Developers
HARVEST_USER (Optional) Filter by user name

Usage

Basic Export

Export the previous month (default):

harvest-exporter

Date Filtering

Export specific months:

harvest-exporter --months 3           # March of current year
harvest-exporter --months 1 2 3       # Q1
harvest-exporter --months 6 --year 2024

Export date range:

harvest-exporter --start 20240101 --end 20240131

User Filtering

harvest-exporter --user "Jane Doe"    # Specific user
harvest-exporter --all-users          # All users (not just authenticated user)

Client Filtering

harvest-exporter --client "Acme Corp"

Currency Conversion

Convert to a different currency (applies Wise exchange rate):

harvest-exporter --currency CHF
harvest-exporter --currency USD

Hourly Rate Override

Override the rate from Harvest:

harvest-exporter --hourly-rate 100

Output Formats

harvest-exporter --format humanreadable  # Default, human-readable text
harvest-exporter --format json           # JSON for piping to other tools
harvest-exporter --format csv            # CSV format
harvest-exporter --format table          # Rich table format

Agency Mode

By default, a numtide agency rate (75%) is applied. To disable:

harvest-exporter --agency none --client "Direct Client"

Output

JSON output contains entries with:

{
  "user": "Jane Doe",
  "client": "Acme Corp",
  "task": "Development",
  "rounded_hours": 40.5,
  "source_currency": "USD",
  "source_hourly_rate": 100,
  "source_cost": 4050,
  "target_currency": "EUR",
  "target_hourly_rate": 92.5,
  "target_cost": 3746.25,
  "exchange_rate": 0.925,
  "start_date": "20240101",
  "end_date": "20240131",
  "agency": "numtide"
}

Integration

Pipe JSON output to invoice generators:

harvest-exporter --format json > harvest.json
sevdesk-invoicer --customer "1234" harvest.json

See also: