Xanthos
F# wrapper library for JRA-VAN JV-Link API.
Overview
Xanthos provides a type-safe F# interface to the JRA-VAN JV-Link COM API, enabling developers to access Japanese horse racing data in a modern, functional programming style.
Features
- Type-safe API: Leverage F#'s type system for safer JV-Link interactions
- Stub mode: Test without COM dependencies on any platform
- Cross-platform: Core library works on Windows, macOS, and Linux (COM features Windows-only)
Text Encoding
- In-memory: Xanthos represents text as Unicode
string(UTF-16). - JV-Link input boundary: JV-Link returns CP932/Shift-JIS for “text”; Xanthos decodes it into
stringviaXanthos.Core.Text. - Output boundary: console/log/file text is UTF-8 (no BOM).
samples/Xanthos.Cliconfigures stdout/stderr accordingly.
Quick Start
open System
open Xanthos.Runtime
open Xanthos.Interop
// Create configuration
let config =
{ Sid = "YOUR_SID"
SavePath = Some @"C:\JVData"
ServiceKey = None
UseJvGets = None }
let request =
{ Spec = "RACE"
FromTime = DateTime.Today.AddDays(-7.0)
Option = 1 }
// IMPORTANT: JvLinkService takes ownership of the client and MUST be disposed.
// Use the 'use' keyword to ensure proper cleanup of COM resources.
use service = new JvLinkService(new ComJvLinkClient(), config)
// Fetch data
match service.FetchPayloads(request) with
| Ok payloads -> printfn "Fetched %d payloads" payloads.Length
| Error err -> printfn "Error: %A" err
// Service and client are automatically disposed when leaving scope
Note: For testing without JV-Link installed, use
JvLinkStub()instead ofComJvLinkClient().
Documentation
- API Reference - Auto-generated from XML documentation
- Architecture - Design documents
License
This project is licensed under the MIT License.
namespace System
val config: 'a
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
val request: 'a
Multiple items
[<Struct>] type DateTime = new: date: DateOnly * time: TimeOnly -> unit + 16 overloads member Add: value: TimeSpan -> DateTime member AddDays: value: float -> DateTime member AddHours: value: float -> DateTime member AddMicroseconds: value: float -> DateTime member AddMilliseconds: value: float -> DateTime member AddMinutes: value: float -> DateTime member AddMonths: months: int -> DateTime member AddSeconds: value: float -> DateTime member AddTicks: value: int64 -> DateTime ...
<summary>Represents an instant in time, typically expressed as a date and time of day.</summary>
--------------------
DateTime ()
(+0 other overloads)
DateTime(ticks: int64) : DateTime
(+0 other overloads)
DateTime(date: DateOnly, time: TimeOnly) : DateTime
(+0 other overloads)
DateTime(ticks: int64, kind: DateTimeKind) : DateTime
(+0 other overloads)
DateTime(date: DateOnly, time: TimeOnly, kind: DateTimeKind) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int, calendar: Globalization.Calendar) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, kind: DateTimeKind) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, calendar: Globalization.Calendar) : DateTime
(+0 other overloads)
[<Struct>] type DateTime = new: date: DateOnly * time: TimeOnly -> unit + 16 overloads member Add: value: TimeSpan -> DateTime member AddDays: value: float -> DateTime member AddHours: value: float -> DateTime member AddMicroseconds: value: float -> DateTime member AddMilliseconds: value: float -> DateTime member AddMinutes: value: float -> DateTime member AddMonths: months: int -> DateTime member AddSeconds: value: float -> DateTime member AddTicks: value: int64 -> DateTime ...
<summary>Represents an instant in time, typically expressed as a date and time of day.</summary>
--------------------
DateTime ()
(+0 other overloads)
DateTime(ticks: int64) : DateTime
(+0 other overloads)
DateTime(date: DateOnly, time: TimeOnly) : DateTime
(+0 other overloads)
DateTime(ticks: int64, kind: DateTimeKind) : DateTime
(+0 other overloads)
DateTime(date: DateOnly, time: TimeOnly, kind: DateTimeKind) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int, calendar: Globalization.Calendar) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, kind: DateTimeKind) : DateTime
(+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, calendar: Globalization.Calendar) : DateTime
(+0 other overloads)
property DateTime.Today: DateTime with get
<summary>Gets the current date.</summary>
<returns>An object that is set to today's date, with the time component set to 00:00:00.</returns>
<summary>Gets the current date.</summary>
<returns>An object that is set to today's date, with the time component set to 00:00:00.</returns>
DateTime.AddDays(value: float) : DateTime
module Option
from Microsoft.FSharp.Core
val service: obj
union case Result.Ok: ResultValue: 'T -> Result<'T,'TError>
val payloads: obj
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
union case Result.Error: ErrorValue: 'TError -> Result<'T,'TError>
val err: obj
Xanthos