Skip to content

woung717/nautilus-trader-cython-stubs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notice

As the Rust port of NautilusTrader is almost done, and I expect the fully ported version to be released soon, this will be the last update to the stubs. From now on, only the stubs created for each previous version will be maintained, and no further stubs will be created for releases of NautilusTrader. (Feel free to fork the project if you need further releases.)

However, if you encounter any issues with the current or previous versions, please report them in the Issues section. Thank you for your interest in and contributions to the project thus far.

Type stubs for NautilusTrader

nautilus-trader-cython-stubs provides .pyi type stubs for the NautilusTrader trading platform, specifically for its Cython interface.

These stubs serve the following purposes:

  • Enhance IntelliSense and docstring support in Visual Studio Code (via Pylance) and other IDEs
  • Provide consistent type annotations and docstring visibility for Cython modules
  • Enable proper import resolution for Cython-based APIs

Installation

Copy all files under the stubs directory into your installed nautilus_trader directory (e.g. {python_path}/lib/{python_version}/site-packages/nautilus_trader/) using rsync or any other tool, so that the .pyi stubs are located next to their corresponding Cython .pyx files.

For example:

rsync -a ./stubs/ {path/to/python/site-packages}/nautilus_trader

Validate stubs

To check if the current version of the .pyi stub is synchronized with the NautilusTrader API, run the following command:

cd nautilus-trader
git checkout {branch_name|tag_name} # branch or tag(release) of nautilus_trader 
cd ..
./scripts/validate_stubs.sh

Note: Python3 and Cython dependencies are required.

Limitations

  • The stubs are manually maintained and may lag behind implementation changes.
  • If you find anything missing or inconsistent with the current API, feel free to create an issue.
  • These stubs cover only the Cython interface — upcoming Rust bindings are not included.

About

Type stubs for NautilusTrader

Resources

License

Stars

Watchers

Forks

Packages

No packages published