open-index/open-npm huggingface dataset:
npm package: @openpanel/plausible-exporter
Description: Barebones ClickHouse CSV exporter for Plausible events.
Author: OpenPanel
Latest version: 0.7.0

# @openpanel/plausible-exporter

Export your Plausible ClickHouse data to a CSV which you can use for migrating to OpenPanel.dev.

## Install / Run

Use npx with a ClickHouse URL:

```bash
npx @openpanel/plausible-exporter "http://localhost:8123/plausible_events_db" --output export.csv --job-id 00000000-0000-0000-0000-000000000000
```

Filter by site_id:

```bash
npx @openpanel/plausible-exporter "http://localhost:8123/plausible_events_db" --site-id 2 --output export.csv
```

Or via env vars:

```bash
export DATABASE_URL="http://localhost:8123/plausible_events_db"
export OUTPUT=export.csv
export JOB_ID=00000000-0000-0000-0000-000000000000
export SITE_ID=2  # optional
npx @openpanel/plausible-exporter
```

## Output format

Header and column order:

"timestamp","name","site_id","user_id","session_id","hostname","pathname","referrer","referrer_source","country_code","country_name","screen_size","operating_system","browser","utm_medium","utm_source","utm_campaign","utm_content","utm_term","browser_version","operating_system_version","subdivision1_code","subdivision1_name","subdivision2_code","city_geoname_id","city_name","revenue_reporting_amount","revenue_reporting_currency","revenue_source_amount","revenue_source_currency","channel","meta.key","meta.value","job_id"

- All values are quoted and escaped per RFC4180 CSV format.
- Null values are rendered as empty fields.
- `timestamp` is the event timestamp from `events_v2.timestamp`.
- `country_name`, `subdivision1_name`, and `city_name` come from JOINs with `location_data` table.
- `meta.key` and `meta.value` are JSON stringified arrays from `events_v2.meta.key` and `events_v2.meta.value`.
- `job_id` is a constant per run (env/flag), appended to each row.

## Flags

- `--output, -o`     Output file path (default: `export.csv`)
- `--job-id`         Job id to append to each row (default: empty string)
- `--site-id`        Filter by site_id (optional, exports all sites if not specified)
- `--batch-size`     Number of rows per paginated query (default: 50000)

## Notes

This package needs access to your ClickHouse database. The connection string format is:

```
http://[username:password@]host:port/database
```

Examples:
- `http://localhost:8123/plausible_events_db`
- `http://user:password@clickhouse.example.com:8123/plausible_events_db`

The exporter queries the `events_v2` table and joins with `location_data` to include country, region, and city names. It does not include imported data tables.

Ensure you have correct credentials and that the ClickHouse server is accessible from your network.
npm package: @openpanel/umami-exporter
Description: Barebones Postgres CSV exporter for Umami events (no Prisma).
Author: OpenPanel
Latest version: 0.3.0

# @openpanel/umami-exporter

Export your Umami data to a CSV which you can use for migrating to OpenPanel.dev.

## Install / Run

Use npx with a Postgres URL:

```bash
npx @openpanel/umami-exporter "postgres://user:pass@host:5432/db" --output export.csv --job-id 00000000-0000-0000-0000-000000000000
```

Or via env vars:

```bash
export DATABASE_URL="postgres://user:pass@host:5432/db"
export OUTPUT=export.csv
export JOB_ID=00000000-0000-0000-0000-000000000000
npx @openpanel/umami-exporter
```

Write to stdout:

```bash
npx @openpanel/umami-exporter "postgres://..." --output - > export.csv
```

## Output format

Header and column order exactly:

"website_id","session_id","visit_id","event_id","hostname","browser","os","device","screen","language","country","region","city","url_path","url_query","utm_source","utm_medium","utm_campaign","utm_content","utm_term","referrer_path","referrer_query","referrer_domain","page_title","gclid","fbclid","msclkid","ttclid","li_fat_id","twclid","event_type","event_name","tag","distinct_id","created_at","job_id"

- All values are quoted except `event_type` which is unquoted integer to match the sample.
- Nulls are rendered as empty fields.
- `created_at` is formatted as `YYYY-MM-DD HH24:MI:SS` from `website_event.created_at`.
- `job_id` is a constant per run (env/flag), appended to each row.

## Flags

- `--output, -o`     Output path; use `-` for stdout (default: `export.csv`)
- `--job-id`         Job id to append to each row (default: all-zero UUID)
- `--batch-size`     Cursor batch size (default: 50000)

## Notes

This package need access to your postgres database, by default, the port 5432 is not exposed in umami. You can expose it by adding (see below) to your docker-compose.yml and then restart it (`docker compose restart`)

```
ports:
 - "5432:5432"
```

Ensure you have correct user and password for your database. Umami's default database url is `postgresql://umami:umami@localhost:5432/umami`