From 33e8942a0fa20646ca1907d07d220e37f6b39e71 Mon Sep 17 00:00:00 2001
From: Niko PLP
Date: Tue, 25 Feb 2025 23:00:01 +0200
Subject: [PATCH] rename python package from nextgraph to nextgraphpy
---
README.md | 2 +-
ng-sdk-python/Cargo.toml | 2 +-
ng-sdk-python/README.md | 4 ++--
ng-sdk-python/pyproject.toml | 2 +-
ng-sdk-python/src/lib.rs | 17 ++++++++++-------
ng-sdk-python/test.py | 4 ++--
ng-verifier/src/lib.rs | 9 +++++++++
7 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index 2d43460..bdf6686 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
[](https://crates.io/crates/nextgraph)
[](https://docs.rs/nextgraph)
[](https://www.npmjs.com/package/nextgraph)
-[](https://pypi.org/project/nextgraph/)
+[](https://pypi.org/project/nextgraphpy/)
Rust implementation of NextGraph
diff --git a/ng-sdk-python/Cargo.toml b/ng-sdk-python/Cargo.toml
index 2d98ce4..97aca0f 100644
--- a/ng-sdk-python/Cargo.toml
+++ b/ng-sdk-python/Cargo.toml
@@ -13,7 +13,7 @@ rust-version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
-name = "nextgraph"
+name = "nextgraphpy"
crate-type = ["cdylib"]
[dependencies]
diff --git a/ng-sdk-python/README.md b/ng-sdk-python/README.md
index 557aff3..2b2dc9c 100644
--- a/ng-sdk-python/README.md
+++ b/ng-sdk-python/README.md
@@ -2,13 +2,13 @@
-# nextgraph
+# nextgraphpy
![MSRV][rustc-image]
[![Apache 2.0 Licensed][license-image]][license-link]
[![MIT Licensed][license-image2]][license-link2]
[](https://forum.nextgraph.org)
-[](https://pypi.org/project/nextgraph/)
+[](https://pypi.org/project/nextgraphpy/)
Python package for NextGraph, implemented in Rust
diff --git a/ng-sdk-python/pyproject.toml b/ng-sdk-python/pyproject.toml
index f846b3c..f51a2d1 100644
--- a/ng-sdk-python/pyproject.toml
+++ b/ng-sdk-python/pyproject.toml
@@ -3,7 +3,7 @@ requires = ["maturin>=1.8,<2.0"]
build-backend = "maturin"
[project]
-name = "nextgraph"
+name = "nextgraphpy"
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."
readme = "README.md"
diff --git a/ng-sdk-python/src/lib.rs b/ng-sdk-python/src/lib.rs
index e257d5b..dd921fb 100644
--- a/ng-sdk-python/src/lib.rs
+++ b/ng-sdk-python/src/lib.rs
@@ -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
+//
+// or the MIT license ,
+// 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::prelude::*;
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,
-}
-
#[pyfunction]
#[pyo3(signature = (session_id, sparql, nuri=None))]
fn doc_sparql_update(
@@ -134,7 +137,7 @@ fn disconnect_and_close<'a>(
}
#[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!(doc_sparql_update, m)?)?;
m.add_function(wrap_pyfunction!(disconnect_and_close, m)?)?;
diff --git a/ng-sdk-python/test.py b/ng-sdk-python/test.py
index 3ca7d03..76d3d73 100644
--- a/ng-sdk-python/test.py
+++ b/ng-sdk-python/test.py
@@ -1,5 +1,5 @@
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():
wallet_session = await wallet_open_with_mnemonic_words(
@@ -22,7 +22,7 @@ async def main():
print(wallet_name)
print(session_info)
await doc_sparql_update(session_info["session_id"],
- "INSERT DATA { \"An example value16\". }",
+ "INSERT DATA { \"An example value22\". }",
"did:ng:o:Dn0QpE9_4jhta1mUWRl_LZh1SbXUkXfOB5eu38PNIk4A:v:Z4ihjV3KMVIqBxzjP6hogVLyjkZunLsb7MMsCR0kizQA")
await disconnect_and_close(session_info["user"], wallet_name)
diff --git a/ng-verifier/src/lib.rs b/ng-verifier/src/lib.rs
index f6cbb0c..18ae899 100644
--- a/ng-verifier/src/lib.rs
+++ b/ng-verifier/src/lib.rs
@@ -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
+//
+// or the MIT license ,
+// 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 site;