trustgraph-cli 1.4.6__tar.gz → 1.4.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of trustgraph-cli might be problematic. Click here for more details.

Files changed (75) hide show
  1. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/PKG-INFO +1 -1
  2. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/pyproject.toml +3 -0
  3. trustgraph_cli-1.4.8/trustgraph/cli/delete_collection.py +72 -0
  4. trustgraph_cli-1.4.8/trustgraph/cli/list_collections.py +86 -0
  5. trustgraph_cli-1.4.8/trustgraph/cli/set_collection.py +103 -0
  6. trustgraph_cli-1.4.8/trustgraph/cli_version.py +1 -0
  7. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph_cli.egg-info/PKG-INFO +1 -1
  8. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph_cli.egg-info/SOURCES.txt +3 -0
  9. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph_cli.egg-info/entry_points.txt +3 -0
  10. trustgraph_cli-1.4.6/trustgraph/cli_version.py +0 -1
  11. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/README.md +0 -0
  12. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/setup.cfg +0 -0
  13. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/__init__.py +0 -0
  14. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/add_library_document.py +0 -0
  15. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/delete_config_item.py +0 -0
  16. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/delete_flow_class.py +0 -0
  17. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/delete_kg_core.py +0 -0
  18. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/delete_mcp_tool.py +0 -0
  19. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/delete_tool.py +0 -0
  20. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/dump_msgpack.py +0 -0
  21. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/get_config_item.py +0 -0
  22. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/get_flow_class.py +0 -0
  23. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/get_kg_core.py +0 -0
  24. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/graph_to_turtle.py +0 -0
  25. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/init_pulsar_manager.py +0 -0
  26. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/init_trustgraph.py +0 -0
  27. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_agent.py +0 -0
  28. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_document_rag.py +0 -0
  29. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_graph_rag.py +0 -0
  30. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_llm.py +0 -0
  31. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_mcp_tool.py +0 -0
  32. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_nlp_query.py +0 -0
  33. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_objects_query.py +0 -0
  34. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_prompt.py +0 -0
  35. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/invoke_structured_query.py +0 -0
  36. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/list_config_items.py +0 -0
  37. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/load_doc_embeds.py +0 -0
  38. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/load_kg_core.py +0 -0
  39. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/load_knowledge.py +0 -0
  40. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/load_pdf.py +0 -0
  41. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/load_sample_documents.py +0 -0
  42. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/load_structured_data.py +0 -0
  43. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/load_text.py +0 -0
  44. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/load_turtle.py +0 -0
  45. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/put_config_item.py +0 -0
  46. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/put_flow_class.py +0 -0
  47. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/put_kg_core.py +0 -0
  48. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/remove_library_document.py +0 -0
  49. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/save_doc_embeds.py +0 -0
  50. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/set_mcp_tool.py +0 -0
  51. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/set_prompt.py +0 -0
  52. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/set_token_costs.py +0 -0
  53. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/set_tool.py +0 -0
  54. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_config.py +0 -0
  55. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_flow_classes.py +0 -0
  56. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_flow_state.py +0 -0
  57. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_flows.py +0 -0
  58. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_graph.py +0 -0
  59. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_kg_cores.py +0 -0
  60. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_library_documents.py +0 -0
  61. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_library_processing.py +0 -0
  62. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_mcp_tools.py +0 -0
  63. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_processor_state.py +0 -0
  64. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_prompts.py +0 -0
  65. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_token_costs.py +0 -0
  66. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_token_rate.py +0 -0
  67. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/show_tools.py +0 -0
  68. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/start_flow.py +0 -0
  69. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/start_library_processing.py +0 -0
  70. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/stop_flow.py +0 -0
  71. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/stop_library_processing.py +0 -0
  72. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph/cli/unload_kg_core.py +0 -0
  73. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph_cli.egg-info/dependency_links.txt +0 -0
  74. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph_cli.egg-info/requires.txt +0 -0
  75. {trustgraph_cli-1.4.6 → trustgraph_cli-1.4.8}/trustgraph_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trustgraph-cli
3
- Version: 1.4.6
3
+ Version: 1.4.8
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Author-email: "trustgraph.ai" <security@trustgraph.ai>
6
6
  Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
@@ -86,6 +86,9 @@ tg-list-config-items = "trustgraph.cli.list_config_items:main"
86
86
  tg-get-config-item = "trustgraph.cli.get_config_item:main"
87
87
  tg-put-config-item = "trustgraph.cli.put_config_item:main"
88
88
  tg-delete-config-item = "trustgraph.cli.delete_config_item:main"
89
+ tg-list-collections = "trustgraph.cli.list_collections:main"
90
+ tg-set-collection = "trustgraph.cli.set_collection:main"
91
+ tg-delete-collection = "trustgraph.cli.delete_collection:main"
89
92
 
90
93
  [tool.setuptools.packages.find]
91
94
  include = ["trustgraph*"]
@@ -0,0 +1,72 @@
1
+ """
2
+ Delete a collection and all its data
3
+ """
4
+
5
+ import argparse
6
+ import os
7
+ from trustgraph.api import Api
8
+
9
+ default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
10
+ default_user = "trustgraph"
11
+
12
+ def delete_collection(url, user, collection, confirm):
13
+
14
+ if not confirm:
15
+ response = input(f"Are you sure you want to delete collection '{collection}' and all its data? (y/N): ")
16
+ if response.lower() not in ['y', 'yes']:
17
+ print("Operation cancelled.")
18
+ return
19
+
20
+ api = Api(url).collection()
21
+
22
+ api.delete_collection(user=user, collection=collection)
23
+
24
+ print(f"Collection '{collection}' deleted successfully.")
25
+
26
+ def main():
27
+
28
+ parser = argparse.ArgumentParser(
29
+ prog='tg-delete-collection',
30
+ description=__doc__,
31
+ )
32
+
33
+ parser.add_argument(
34
+ 'collection',
35
+ help='Collection ID to delete'
36
+ )
37
+
38
+ parser.add_argument(
39
+ '-u', '--api-url',
40
+ default=default_url,
41
+ help=f'API URL (default: {default_url})',
42
+ )
43
+
44
+ parser.add_argument(
45
+ '-U', '--user',
46
+ default=default_user,
47
+ help=f'User ID (default: {default_user})'
48
+ )
49
+
50
+ parser.add_argument(
51
+ '-y', '--yes',
52
+ action='store_true',
53
+ help='Skip confirmation prompt'
54
+ )
55
+
56
+ args = parser.parse_args()
57
+
58
+ try:
59
+
60
+ delete_collection(
61
+ url = args.api_url,
62
+ user = args.user,
63
+ collection = args.collection,
64
+ confirm = args.yes
65
+ )
66
+
67
+ except Exception as e:
68
+
69
+ print("Exception:", e, flush=True)
70
+
71
+ if __name__ == "__main__":
72
+ main()
@@ -0,0 +1,86 @@
1
+ """
2
+ List collections for a user
3
+ """
4
+
5
+ import argparse
6
+ import os
7
+ import tabulate
8
+ from trustgraph.api import Api
9
+ import json
10
+
11
+ default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
12
+ default_user = "trustgraph"
13
+
14
+ def list_collections(url, user, tag_filter):
15
+
16
+ api = Api(url).collection()
17
+
18
+ collections = api.list_collections(user=user, tag_filter=tag_filter)
19
+
20
+ # Handle None or empty collections
21
+ if not collections or len(collections) == 0:
22
+ print("No collections found.")
23
+ return
24
+
25
+ table = []
26
+ for collection in collections:
27
+ table.append([
28
+ collection.collection,
29
+ collection.name,
30
+ collection.description,
31
+ ", ".join(collection.tags),
32
+ collection.created_at,
33
+ collection.updated_at
34
+ ])
35
+
36
+ headers = ["Collection", "Name", "Description", "Tags", "Created", "Updated"]
37
+
38
+ print(tabulate.tabulate(
39
+ table,
40
+ headers=headers,
41
+ tablefmt="pretty",
42
+ stralign="left",
43
+ maxcolwidths=[20, 30, 50, 30, 19, 19],
44
+ ))
45
+
46
+ def main():
47
+
48
+ parser = argparse.ArgumentParser(
49
+ prog='tg-list-collections',
50
+ description=__doc__,
51
+ )
52
+
53
+ parser.add_argument(
54
+ '-u', '--api-url',
55
+ default=default_url,
56
+ help=f'API URL (default: {default_url})',
57
+ )
58
+
59
+ parser.add_argument(
60
+ '-U', '--user',
61
+ default=default_user,
62
+ help=f'User ID (default: {default_user})'
63
+ )
64
+
65
+ parser.add_argument(
66
+ '-t', '--tag-filter',
67
+ action='append',
68
+ help='Filter by tags (can be specified multiple times)'
69
+ )
70
+
71
+ args = parser.parse_args()
72
+
73
+ try:
74
+
75
+ list_collections(
76
+ url = args.api_url,
77
+ user = args.user,
78
+ tag_filter = args.tag_filter
79
+ )
80
+
81
+ except Exception as e:
82
+
83
+ print("Exception:", e, flush=True)
84
+
85
+ if __name__ == "__main__":
86
+ main()
@@ -0,0 +1,103 @@
1
+ """
2
+ Set collection metadata (creates if doesn't exist)
3
+ """
4
+
5
+ import argparse
6
+ import os
7
+ import tabulate
8
+ from trustgraph.api import Api
9
+
10
+ default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
11
+ default_user = "trustgraph"
12
+
13
+ def set_collection(url, user, collection, name, description, tags):
14
+
15
+ api = Api(url).collection()
16
+
17
+ result = api.update_collection(
18
+ user=user,
19
+ collection=collection,
20
+ name=name,
21
+ description=description,
22
+ tags=tags
23
+ )
24
+
25
+ if result:
26
+ print(f"Collection '{collection}' set successfully.")
27
+
28
+ table = []
29
+ table.append(("Collection", result.collection))
30
+ table.append(("Name", result.name))
31
+ table.append(("Description", result.description))
32
+ table.append(("Tags", ", ".join(result.tags)))
33
+ table.append(("Updated", result.updated_at))
34
+
35
+ print(tabulate.tabulate(
36
+ table,
37
+ tablefmt="pretty",
38
+ stralign="left",
39
+ maxcolwidths=[None, 67],
40
+ ))
41
+ else:
42
+ print(f"Failed to set collection '{collection}'.")
43
+
44
+ def main():
45
+
46
+ parser = argparse.ArgumentParser(
47
+ prog='tg-set-collection',
48
+ description=__doc__,
49
+ )
50
+
51
+ parser.add_argument(
52
+ 'collection',
53
+ help='Collection ID to set'
54
+ )
55
+
56
+ parser.add_argument(
57
+ '-u', '--api-url',
58
+ default=default_url,
59
+ help=f'API URL (default: {default_url})',
60
+ )
61
+
62
+ parser.add_argument(
63
+ '-U', '--user',
64
+ default=default_user,
65
+ help=f'User ID (default: {default_user})'
66
+ )
67
+
68
+ parser.add_argument(
69
+ '-n', '--name',
70
+ help='Collection name'
71
+ )
72
+
73
+ parser.add_argument(
74
+ '-d', '--description',
75
+ help='Collection description'
76
+ )
77
+
78
+ parser.add_argument(
79
+ '-t', '--tag',
80
+ action='append',
81
+ dest='tags',
82
+ help='Collection tags (can be specified multiple times)'
83
+ )
84
+
85
+ args = parser.parse_args()
86
+
87
+ try:
88
+
89
+ set_collection(
90
+ url = args.api_url,
91
+ user = args.user,
92
+ collection = args.collection,
93
+ name = args.name,
94
+ description = args.description,
95
+ tags = args.tags
96
+ )
97
+
98
+ except Exception as e:
99
+
100
+ print("Exception:", e, flush=True)
101
+
102
+ if __name__ == "__main__":
103
+ main()
@@ -0,0 +1 @@
1
+ __version__ = "1.4.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trustgraph-cli
3
- Version: 1.4.6
3
+ Version: 1.4.8
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Author-email: "trustgraph.ai" <security@trustgraph.ai>
6
6
  Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
@@ -3,6 +3,7 @@ pyproject.toml
3
3
  trustgraph/cli_version.py
4
4
  trustgraph/cli/__init__.py
5
5
  trustgraph/cli/add_library_document.py
6
+ trustgraph/cli/delete_collection.py
6
7
  trustgraph/cli/delete_config_item.py
7
8
  trustgraph/cli/delete_flow_class.py
8
9
  trustgraph/cli/delete_kg_core.py
@@ -24,6 +25,7 @@ trustgraph/cli/invoke_nlp_query.py
24
25
  trustgraph/cli/invoke_objects_query.py
25
26
  trustgraph/cli/invoke_prompt.py
26
27
  trustgraph/cli/invoke_structured_query.py
28
+ trustgraph/cli/list_collections.py
27
29
  trustgraph/cli/list_config_items.py
28
30
  trustgraph/cli/load_doc_embeds.py
29
31
  trustgraph/cli/load_kg_core.py
@@ -38,6 +40,7 @@ trustgraph/cli/put_flow_class.py
38
40
  trustgraph/cli/put_kg_core.py
39
41
  trustgraph/cli/remove_library_document.py
40
42
  trustgraph/cli/save_doc_embeds.py
43
+ trustgraph/cli/set_collection.py
41
44
  trustgraph/cli/set_mcp_tool.py
42
45
  trustgraph/cli/set_prompt.py
43
46
  trustgraph/cli/set_token_costs.py
@@ -1,5 +1,6 @@
1
1
  [console_scripts]
2
2
  tg-add-library-document = trustgraph.cli.add_library_document:main
3
+ tg-delete-collection = trustgraph.cli.delete_collection:main
3
4
  tg-delete-config-item = trustgraph.cli.delete_config_item:main
4
5
  tg-delete-flow-class = trustgraph.cli.delete_flow_class:main
5
6
  tg-delete-kg-core = trustgraph.cli.delete_kg_core:main
@@ -20,6 +21,7 @@ tg-invoke-nlp-query = trustgraph.cli.invoke_nlp_query:main
20
21
  tg-invoke-objects-query = trustgraph.cli.invoke_objects_query:main
21
22
  tg-invoke-prompt = trustgraph.cli.invoke_prompt:main
22
23
  tg-invoke-structured-query = trustgraph.cli.invoke_structured_query:main
24
+ tg-list-collections = trustgraph.cli.list_collections:main
23
25
  tg-list-config-items = trustgraph.cli.list_config_items:main
24
26
  tg-load-doc-embeds = trustgraph.cli.load_doc_embeds:main
25
27
  tg-load-kg-core = trustgraph.cli.load_kg_core:main
@@ -34,6 +36,7 @@ tg-put-flow-class = trustgraph.cli.put_flow_class:main
34
36
  tg-put-kg-core = trustgraph.cli.put_kg_core:main
35
37
  tg-remove-library-document = trustgraph.cli.remove_library_document:main
36
38
  tg-save-doc-embeds = trustgraph.cli.save_doc_embeds:main
39
+ tg-set-collection = trustgraph.cli.set_collection:main
37
40
  tg-set-mcp-tool = trustgraph.cli.set_mcp_tool:main
38
41
  tg-set-prompt = trustgraph.cli.set_prompt:main
39
42
  tg-set-token-costs = trustgraph.cli.set_token_costs:main
@@ -1 +0,0 @@
1
- __version__ = "1.4.6"
File without changes
File without changes