#xml-parser #response #betfair #workflow

betfair-xml-parser

Utilities for interacting with Betfair from Rust

9 releases (4 breaking)

Uses new Rust 2024

new 0.5.0 Apr 25, 2025
0.4.1 Apr 21, 2025
0.3.0 Apr 20, 2025
0.2.1 Apr 6, 2025
0.1.2 Dec 24, 2024

#197 in Finance

Download history 14/week @ 2025-01-03 11/week @ 2025-01-10 5/week @ 2025-01-17 4/week @ 2025-01-31 1/week @ 2025-02-07 17/week @ 2025-02-14 20/week @ 2025-02-21 17/week @ 2025-02-28 4/week @ 2025-03-07 9/week @ 2025-03-14 274/week @ 2025-04-04 43/week @ 2025-04-11 416/week @ 2025-04-18

733 downloads per month
Used in 7 crates (via betfair-typegen)

MIT/Apache

48KB
932 lines

betfair-adapter-rs

Crates.io docs.rs check docs test unused-deps deny

Utilities for interacting with the Betfair API (API‑NG and Streaming) from Rust.

Features

  • High‑level API‑NG client (betfair-adapter) with typed requests and responses
  • API‑NG models in betfair-types
  • Streaming API client with internal caching (betfair-stream-api and betfair-stream-types)
  • Low‑level XML parser for Betfair messages (betfair-xml-parser)
  • Mock RPC server for testing (betfair-rpc-server-mock)
  • Code generation for API definitions (betfair-typegen)
  • TLS certificate generation for streaming (betfair-cert-gen)
  • Examples and xtask automation for development workflows

Crate Overview

  • betfair-adapter: High‑level async client for API‑NG
  • betfair-types: API‑NG request/response types
  • betfair-stream-types: Streaming API message types
  • betfair-stream-api: Streaming client, cache, and trackers
  • betfair-xml-parser: XML parser utilities
  • betfair-rpc-server-mock: Mock Betfair RPC server for integration tests
  • betfair-typegen: Code generator for API definitions
  • betfair-cert-gen: Generate TLS certificates for streaming connections

See the examples/ directory for complete guides.

Development

Clone the repository and explore available tasks:

git clone https://github.com/roberts-pumpurs/betfair-adapter-rs.git
cd betfair-adapter-rs
cargo xtask --help

Run tests, lint checks, and formatters:

cargo xtask test
cargo xtask clippy
cargo xtask fmt

Contributing

Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md for guidelines.

License

Licensed under the MIT OR Apache-2.0 license at your choice:

Dependencies

~0.7–1.3MB
~28K SLoC