Skip to main content

ta_py/
lib.rs

1//! TA-Py: Python bindings for technical analysis indicators
2//!
3//! This crate provides Python bindings for the core technical analysis library
4//! using PyO3.
5//!
6//! Note: This crate requires a Python 3.x interpreter to build.
7
8use pyo3::prelude::*;
9
10/// Python module for technical analysis indicators
11#[cfg(not(test))]
12#[pymodule]
13fn ta_py(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
14    m.add_function(wrap_pyfunction!(hello_world, m)?)?;
15    Ok(())
16}
17
18/// Example function to verify Python bindings work
19#[cfg_attr(not(test), pyfunction)]
20fn hello_world() -> PyResult<String> {
21    Ok("Hello from ta-py!".to_string())
22}
23
24#[cfg(test)]
25mod tests {
26    use super::*;
27
28    #[test]
29    fn test_hello_world() {
30        assert_eq!(hello_world().unwrap(), "Hello from ta-py!");
31    }
32}