oscar-export is a standalone Go CLI for exporting cache data from OSCAR-code directly to CSV without using the OSCAR GUI.
The Go module lives at github.com/dwin/oscar-export. If you install it with go install, the executable name is oscar-export.
It reproduces OSCAR's existing Summary, Sessions, and Details CSV exports from the on-disk cache under an OSCAR data root such as:
/path/to/OSCAR_Data
- Current upstream repository: https://gitlab.com/CrimsonNape/OSCAR-code
- Upstream project license: GPL v3 only, documented in the upstream
COPYINGfile oscar-exportis focused on interoperability with OSCAR cache formats and reproducing OSCAR CSV output behavioroscar-exportis an independent CLI and is not affiliated with the OSCAR maintainers
The CLI supports these export modes:
summary: day-level CSV matching OSCAR'sSummaryexportsessions: per-session CSV matching OSCAR'sSessionsexportdetails: raw event rows matching OSCAR'sDetailsexport
By default it:
- loads the selected OSCAR profile
- merges all CPAP machines in that profile
- uses the profile timezone from
Profile.xml - uses the profile sleep-day split rules from
Profile.xml - writes the same default filename style OSCAR uses when
--outis omitted
This tool is intentionally scoped to the OSCAR cache formats present in the target data set:
Summaries.xml.gz: version1- summary
.000: version18 - event
.001: version10 Sessions.info: version2
Unsupported versions fail fast with a clear error.
This repository is licensed under the GNU General Public License v3.0 only. See LICENSE.
Using GPL v3 only here keeps redistribution terms aligned with the current OSCAR-code upstream license and removes ambiguity around reuse of OSCAR-compatible export behavior and future upstream-derived work.
Install the latest version with Go:
go install github.com/dwin/oscar-export@latestOr run it from a local checkout:
git clone https://github.com/dwin/oscar-export.git
cd oscar-exportThe command layout is:
oscar-export export summary
oscar-export export sessions
oscar-export export details
If you're running from a local checkout instead of an installed binary, replace oscar-export with go run ..
Shared flags:
--root--profile-user--from--to--out--serialoptional, for single-machine debugging
Generate a summary export:
oscar-export export summary \
--root /path/to/OSCAR_Data \
--profile-user your-profile-user \
--from 2026-03-03 \
--to 2026-03-17Generate a sessions export:
oscar-export export sessions \
--root /path/to/OSCAR_Data \
--profile-user your-profile-user \
--from 2026-03-03 \
--to 2026-03-17Generate a details export:
oscar-export export details \
--root /path/to/OSCAR_Data \
--profile-user your-profile-user \
--from 2026-02-20 \
--to 2026-03-06Write to a specific file:
oscar-export export summary \
--root /path/to/OSCAR_Data \
--profile-user your-profile-user \
--from 2026-03-03 \
--to 2026-03-17 \
--out ./oscar_summary.csvExport a single machine by serial:
oscar-export export sessions \
--root /path/to/OSCAR_Data \
--profile-user your-profile-user \
--serial 23182797776 \
--from 2026-03-03 \
--to 2026-03-17- The profile password in
Profile.xmlis only an OSCAR UI access check. It does not encrypt the cache files. - Sleep-day assignment follows OSCAR's day split behavior from
Profile.xml. Summaryuses merged day-level aggregates across enabled CPAP sessions.Sessionsexports per-session rows for the grouped sleep days.Detailsexports only sessions that have event data.- Total time uses overlap-aware union logic, matching OSCAR rather than naively summing session lengths.
Fetch dependencies:
go mod tidyRun unit tests:
go test ./...Run the env-gated fixture comparisons against a real OSCAR data directory and existing OSCAR CSV exports:
OSCAR_DATA_DIR='/path/to/OSCAR_Data' \
OSCAR_EXPORT_DIR='/path/to/oscar-csv-exports' \
go test ./...Optional profile override for integration tests:
OSCAR_PROFILE_USER=your-profile-user.
main.go
cmd/
root.go
export.go
internal/
cache/
export/