Skip to main content

Independent community Sinopac (Taiwan markets) adapter for NautilusTrader

Project description

sinopac-nt-community

Disclaimer: This is an independent community project. It is not affiliated with, endorsed by, or supported by Nautech Systems Pty Ltd or the official NautilusTrader project.

An independent community adapter integrating SinoPac Securities (Taiwan markets — TWSE / TPEX / TAIFEX, via the Shioaji SDK) with NautilusTrader. It provides a live data client, a live execution client, and an instrument provider, backed by a Rust-native HTTP/WebSocket core — usable from Python (a compiled extension) or pure Rust (the same crate).

  • Pinned to: nautilus_trader==1.228.0 (PyPI) / nautilus-* 0.58.0 (crates.io)
  • Companion gateway: shioaji-server (a separate process the adapter connects to)
  • License: LGPL-3.0-or-later

Install

Python — from PyPI (prebuilt wheels for Python 3.12–3.14 on Linux, macOS, and Windows; pulls in nautilus_trader==1.228.0 automatically):

pip install sinopac-nt-community

Rust — from crates.io:

cargo add sinopac-nt-community

Live data/execution also needs a running shioaji-server gateway (a separate process the adapter connects to).

Build from source

Only needed for contributors or unsupported platforms. Requires Rust 1.96.0, uv, and maturin:

git clone https://github.com/Martingale42/sinopac-nt-community
cd sinopac-nt-community

uv venv --python 3.12
uv pip install nautilus_trader==1.228.0 maturin
uv run maturin develop            # editable install of the sinopac_nt extension
# or a distributable wheel:
uv run maturin build --release    # -> target/wheels/

Usage

Register the factories on a TradingNode and point the configs at your shioaji-server gateway:

from nautilus_trader.live.node import TradingNode
from nautilus_trader.live.config import TradingNodeConfig

from sinopac_nt import (
    SINOPAC,
    SinopacDataClientConfig,
    SinopacExecClientConfig,
    SinopacLiveDataClientFactory,
    SinopacLiveExecClientFactory,
)

config = TradingNodeConfig(
    trader_id="TESTER-001",
    data_clients={SINOPAC: SinopacDataClientConfig(...)},
    exec_clients={SINOPAC: SinopacExecClientConfig(...)},
)

node = TradingNode(config=config)
node.add_data_client_factory(SINOPAC, SinopacLiveDataClientFactory)
node.add_exec_client_factory(SINOPAC, SinopacLiveExecClientFactory)
node.build()
node.run()

Runnable end-to-end testers are in examples/ (sinopac_data_tester.py, sinopac_exec_tester.py).

Using from Rust

The same crate is a Rust library, so pure-Rust NautilusTrader systems can drive the clients directly (no Python needed):

use sinopac_nt::{SinopacHttpClient, SinopacWebSocketClient};

Do not enable the python / extension-module features in a pure-Rust build (they are for the Python wheel only).

Taiwan order semantics

Taiwan-venue order parameters with no native Nautilus equivalent (margin/short, intraday odd lot, futures open-close type, range-market MKP, TIF coercion, limit-up/down) are carried on order.tags via SinopacOrderTags. See the sinopac_nt package docstring and docs/sinopac.md for the full capability matrix.

Development

uv run maturin develop
uv run pytest python/tests -q     # Python integration tests
cargo test                        # Rust unit + integration tests

Maintainer

Maintained by @Martingale42. Please open an issue on this repository for bugs, questions, or contributions.

License

LGPL-3.0-or-later. This project links against and re-homes code from NautilusTrader (also LGPL-3.0-or-later); upstream copyright notices are retained in the source headers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinopac_nt_community-0.1.2.tar.gz (129.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sinopac_nt_community-0.1.2-cp314-cp314-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.14Windows x86-64

sinopac_nt_community-0.1.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

sinopac_nt_community-0.1.2-cp314-cp314-macosx_11_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

sinopac_nt_community-0.1.2-cp313-cp313-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.13Windows x86-64

sinopac_nt_community-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sinopac_nt_community-0.1.2-cp313-cp313-macosx_11_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sinopac_nt_community-0.1.2-cp312-cp312-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.12Windows x86-64

sinopac_nt_community-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sinopac_nt_community-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file sinopac_nt_community-0.1.2.tar.gz.

File metadata

  • Download URL: sinopac_nt_community-0.1.2.tar.gz
  • Upload date:
  • Size: 129.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for sinopac_nt_community-0.1.2.tar.gz
Algorithm Hash digest
SHA256 195a5c32031fdbd6cfe7f8499e2ef35068d2beca0fab0809a9c1a58f2f3e36b9
MD5 545ca60597929a2e6564ab90e1978bf7
BLAKE2b-256 7fc1207de9b18c882205dd2a3899bdb928c451a48f9b981aebeb0cda254fc107

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2.tar.gz:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 426ee05edc6015d4c55ef37ab1d23bd24088f0e5738b2cf622e51912cacc0cd8
MD5 39b3ed80b27b127730129c424b5378e4
BLAKE2b-256 2883ed6a70e3cd7eb8b9540841e7b456669c042e82bb05f611d95a1a5a9c8ef3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp314-cp314-win_amd64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2145363af64e2e70767e7464ae8291cfd75813a9d5546eda21116ef007b7f33
MD5 123eacbe76509de099e75ebd5b90efa5
BLAKE2b-256 9670d5011a3d1f70f9c50e966446f7357c87d50e604c855918912519d2475ed6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 57ee96245314692c6dd8b8467e3667c1654762fb091364585b21eea3dd30b462
MD5 8d23edeb5660b9cc4ccfea1b74bd2e0d
BLAKE2b-256 9450f288f88629dc3577a4dce89f9dccbd2a179dd9f40d6cf5756944978aa4c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b98a05b3a4b69c3d73f8fcc96c30138bc250b7d71de8a3e14e01137c8eaadab3
MD5 ff91137511ea7e5d5dde006fbd5ea57c
BLAKE2b-256 1de8441a84f8220bacc62658e8b2ab88d1d6386181a7b4aeaf265af36be6e3c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp313-cp313-win_amd64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 325e5fee01bc2c2777fa5c446f0b556aa13dc03995c3f9167236e9154eca2208
MD5 21e7ead10434999e07f15606e64bedb2
BLAKE2b-256 2aadd90143a8f40605a168499be41beb4413badeafd114b472e9e50a148c711c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 06bf5d323d11ad67305d050806ff4695101bf2114fa196ef2d6c1c2314074068
MD5 4deaf0de699b3c7a0a0c483f17640b0c
BLAKE2b-256 b5705afdfc53b6e09d010bf0a0c751dab911a133233b83952a80bf04690ca1af

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 43691aa328db345893e61f51e5f2a133c0671ba73b3e0bf90c1a20cd99ced67a
MD5 7be03262227fc4a0dd17c1d2968d01df
BLAKE2b-256 72fc7885a3a0048df7f74916cdbd79f32ecbf6ea7f0c632b4f64ab776154a47c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp312-cp312-win_amd64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb19dc61fabb2596eb82e84a9104379f551ea4d097d3b20de412fbf00c2a3684
MD5 beee0189f86d7d844bad87f1f4c58231
BLAKE2b-256 aa4edee835467ee78666fa3836de5839851c4c15a526474e2af0d479cb2f66c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 db9e0116d67746368078d925380f398a8386ae1665b5486d1b2baf94d862cf6f
MD5 738bef62ff7c5fa6a4a65e6310f5c69b
BLAKE2b-256 3a5db7e33a494915231159700d89db775144cc8fc590a8577d01b3bf2a252578

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page