| 1 |
// #![deny( |
| 2 |
// future_incompatible, |
| 3 |
// nonstandard_style, |
| 4 |
// rust_2018_idioms, |
| 5 |
// trivial_casts, |
| 6 |
// trivial_numeric_casts, |
| 7 |
// unsafe_code, |
| 8 |
// unused_qualifications |
| 9 |
// )] |
| 10 |
|
| 11 |
mod nanopub; |
| 12 |
|
| 13 |
use crate::nanopub::*; |
| 14 |
use pyo3::prelude::*; |
| 15 |
use pyo3::wrap_pyfunction; |
| 16 |
|
| 17 |
/// Nanopub Python bindings |
| 18 |
#[pymodule] |
| 19 |
fn nanopub_sign(m: &Bound<'_, PyModule>) -> PyResult<()> { |
| 20 |
m.add("__package__", "nanopub-sign")?; |
| 21 |
m.add("__version__", env!("CARGO_PKG_VERSION"))?; |
| 22 |
m.add("__author__", env!("CARGO_PKG_AUTHORS").replace(':', "\n"))?; |
| 23 |
|
| 24 |
m.add_class::<NpProfilePy>()?; |
| 25 |
m.add_class::<NanopubPy>()?; |
| 26 |
m.add_class::<KeyPair>()?; |
| 27 |
m.add_wrapped(wrap_pyfunction!(get_np_server))?; |
| 28 |
// m.add_function(wrap_pyfunction!(sum_as_string, m))?; |
| 29 |
Ok(()) |
| 30 |
} |