rename python package from nextgraph to nextgraphpy

master
Niko PLP 2 weeks ago
parent 5bfe3750b6
commit 33e8942a0f
  1. 2
      README.md
  2. 2
      ng-sdk-python/Cargo.toml
  3. 4
      ng-sdk-python/README.md
  4. 2
      ng-sdk-python/pyproject.toml
  5. 17
      ng-sdk-python/src/lib.rs
  6. 4
      ng-sdk-python/test.py
  7. 9
      ng-verifier/src/lib.rs

@ -11,7 +11,7 @@
[![Crates.io Version](https://img.shields.io/crates/v/nextgraph)](https://crates.io/crates/nextgraph) [![Crates.io Version](https://img.shields.io/crates/v/nextgraph)](https://crates.io/crates/nextgraph)
[![docs.rs](https://img.shields.io/docsrs/nextgraph)](https://docs.rs/nextgraph) [![docs.rs](https://img.shields.io/docsrs/nextgraph)](https://docs.rs/nextgraph)
[![NPM Version](https://img.shields.io/npm/v/nextgraph)](https://www.npmjs.com/package/nextgraph) [![NPM Version](https://img.shields.io/npm/v/nextgraph)](https://www.npmjs.com/package/nextgraph)
[![PyPI - Version](https://img.shields.io/pypi/v/nextgraph)](https://pypi.org/project/nextgraph/) [![PyPI - Version](https://img.shields.io/pypi/v/nextgraphpy)](https://pypi.org/project/nextgraphpy/)
Rust implementation of NextGraph Rust implementation of NextGraph

@ -13,7 +13,7 @@ rust-version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib] [lib]
name = "nextgraph" name = "nextgraphpy"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [dependencies]

@ -2,13 +2,13 @@
<img src="https://git.nextgraph.org/NextGraph/nextgraph-rs/raw/branch/master/nextgraph/.static/header.png" alt="nextgraph-header" /> <img src="https://git.nextgraph.org/NextGraph/nextgraph-rs/raw/branch/master/nextgraph/.static/header.png" alt="nextgraph-header" />
</p> </p>
# nextgraph # nextgraphpy
![MSRV][rustc-image] ![MSRV][rustc-image]
[![Apache 2.0 Licensed][license-image]][license-link] [![Apache 2.0 Licensed][license-image]][license-link]
[![MIT Licensed][license-image2]][license-link2] [![MIT Licensed][license-image2]][license-link2]
[![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://forum.nextgraph.org) [![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://forum.nextgraph.org)
[![PyPI - Version](https://img.shields.io/pypi/v/nextgraph)](https://pypi.org/project/nextgraph/) [![PyPI - Version](https://img.shields.io/pypi/v/nextgraphpy)](https://pypi.org/project/nextgraphpy/)
Python package for NextGraph, implemented in Rust Python package for NextGraph, implemented in Rust

@ -3,7 +3,7 @@ requires = ["maturin>=1.8,<2.0"]
build-backend = "maturin" build-backend = "maturin"
[project] [project]
name = "nextgraph" name = "nextgraphpy"
requires-python = ">=3.7.3" requires-python = ">=3.7.3"
description = "NextGraph brings about the convergence of P2P and Semantic Web technologies, towards a decentralized, secure and privacy-preserving cloud, based on CRDTs." description = "NextGraph brings about the convergence of P2P and Semantic Web technologies, towards a decentralized, secure and privacy-preserving cloud, based on CRDTs."
readme = "README.md" readme = "README.md"

@ -1,3 +1,12 @@
// Copyright (c) 2022-2025 Niko Bonnieure, Par le Peuple, NextGraph.org developers
// All rights reserved.
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE2 or http://www.apache.org/licenses/LICENSE-2.0>
// or the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be copied, modified, or distributed except
// according to those terms.
use pyo3::exceptions::PyTypeError; use pyo3::exceptions::PyTypeError;
use pyo3::prelude::*; use pyo3::prelude::*;
use pythonize::{depythonize, pythonize}; use pythonize::{depythonize, pythonize};
@ -86,12 +95,6 @@ fn wallet_open_with_mnemonic_words(
}) })
} }
#[derive(Debug, Serialize, Deserialize, PartialEq)]
struct Sample {
foo: u64,
bar: Option<usize>,
}
#[pyfunction] #[pyfunction]
#[pyo3(signature = (session_id, sparql, nuri=None))] #[pyo3(signature = (session_id, sparql, nuri=None))]
fn doc_sparql_update( fn doc_sparql_update(
@ -134,7 +137,7 @@ fn disconnect_and_close<'a>(
} }
#[pymodule] #[pymodule]
fn nextgraph(m: &Bound<'_, PyModule>) -> PyResult<()> { fn nextgraphpy(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(wallet_open_with_mnemonic_words, m)?)?; m.add_function(wrap_pyfunction!(wallet_open_with_mnemonic_words, m)?)?;
m.add_function(wrap_pyfunction!(doc_sparql_update, m)?)?; m.add_function(wrap_pyfunction!(doc_sparql_update, m)?)?;
m.add_function(wrap_pyfunction!(disconnect_and_close, m)?)?; m.add_function(wrap_pyfunction!(disconnect_and_close, m)?)?;

@ -1,5 +1,5 @@
import asyncio import asyncio
from nextgraph import wallet_open_with_mnemonic_words, doc_sparql_update, disconnect_and_close from nextgraphpy import wallet_open_with_mnemonic_words, doc_sparql_update, disconnect_and_close
async def main(): async def main():
wallet_session = await wallet_open_with_mnemonic_words( wallet_session = await wallet_open_with_mnemonic_words(
@ -22,7 +22,7 @@ async def main():
print(wallet_name) print(wallet_name)
print(session_info) print(session_info)
await doc_sparql_update(session_info["session_id"], await doc_sparql_update(session_info["session_id"],
"INSERT DATA { <did:ng:_> <example:predicate> \"An example value16\". }", "INSERT DATA { <did:ng:_> <example:predicate> \"An example value22\". }",
"did:ng:o:Dn0QpE9_4jhta1mUWRl_LZh1SbXUkXfOB5eu38PNIk4A:v:Z4ihjV3KMVIqBxzjP6hogVLyjkZunLsb7MMsCR0kizQA") "did:ng:o:Dn0QpE9_4jhta1mUWRl_LZh1SbXUkXfOB5eu38PNIk4A:v:Z4ihjV3KMVIqBxzjP6hogVLyjkZunLsb7MMsCR0kizQA")
await disconnect_and_close(session_info["user"], wallet_name) await disconnect_and_close(session_info["user"], wallet_name)

@ -1,3 +1,12 @@
// Copyright (c) 2022-2025 Niko Bonnieure, Par le Peuple, NextGraph.org developers
// All rights reserved.
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE2 or http://www.apache.org/licenses/LICENSE-2.0>
// or the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be copied, modified, or distributed except
// according to those terms.
pub mod types; pub mod types;
pub mod site; pub mod site;

Loading…
Cancel
Save