links-client 1.0.0__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.
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: links-client
3
+ Version: 1.0.0
4
+ Summary: Python client library for link-cli (Links Theory database)
5
+ Author: DronDoc Team
6
+ License: Unlicense
7
+ Project-URL: Homepage, https://github.com/link-foundation/links-client
8
+ Project-URL: Repository, https://github.com/link-foundation/links-client
9
+ Project-URL: Issues, https://github.com/link-foundation/links-client/issues
10
+ Keywords: link-cli,links-theory,database,associative,clink
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: Public Domain
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Requires-Python: >=3.8
21
+ Description-Content-Type: text/markdown
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
24
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
25
+
26
+ # Links Client - Python Implementation
27
+
28
+ Python client library for [link-cli](https://github.com/link-foundation/link-cli) — implementation of Links Theory database.
29
+
30
+ ## Installation
31
+
32
+ ### Prerequisites
33
+
34
+ Install link-cli globally:
35
+ ```bash
36
+ dotnet tool install --global clink
37
+ ```
38
+
39
+ ### Package Installation
40
+
41
+ ```bash
42
+ pip install -e .
43
+ ```
44
+
45
+ Or install from the repository root:
46
+
47
+ ```bash
48
+ cd python
49
+ pip install -e .
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ ### Basic Usage
55
+
56
+ ```python
57
+ from links_client import LinkDBService
58
+
59
+ db = LinkDBService('/path/to/database.links')
60
+
61
+ # Create a link
62
+ link = db.create_link(100, 200)
63
+ print(link) # {'id': 1, 'source': 100, 'target': 200}
64
+
65
+ # Read all links
66
+ links = db.read_all_links()
67
+
68
+ # Delete a link
69
+ db.delete_link(1)
70
+ ```
71
+
72
+ ### Menu Storage
73
+
74
+ ```python
75
+ from links_client import MenuStorageService
76
+
77
+ menu_storage = MenuStorageService()
78
+
79
+ menu = [
80
+ {
81
+ "label": "Dashboard",
82
+ "icon": "pi pi-home",
83
+ "to": "/dashboard",
84
+ "items": [
85
+ {"label": "Analytics", "to": "/dashboard/analytics"}
86
+ ]
87
+ }
88
+ ]
89
+
90
+ menu_storage.store_menu_structure(menu, 0)
91
+ retrieved_menu = menu_storage.get_menu_structure(0)
92
+ ```
93
+
94
+ ### Authentication Storage
95
+
96
+ ```python
97
+ from links_client import AuthStorageService
98
+
99
+ auth_storage = AuthStorageService()
100
+
101
+ # Create user
102
+ user = auth_storage.create_user({
103
+ "username": "alice",
104
+ "email": "alice@example.com"
105
+ })
106
+
107
+ # Set password
108
+ auth_storage.set_password(user['userId'], {
109
+ "hash": "hashed_password",
110
+ "salt": "random_salt"
111
+ })
112
+ ```
113
+
114
+ ## API
115
+
116
+ For detailed API documentation, see the docs/ directory.
117
+
118
+ ## Examples
119
+
120
+ See examples in the examples/ directory:
121
+
122
+ - `basic_usage.py` - Basic clink integration tests
123
+ - `menu_storage_example.py` - Menu storage demonstration
124
+ - `auth_storage_example.py` - Authentication storage demonstration
125
+
126
+ ## Testing
127
+
128
+ Run tests with pytest:
129
+
130
+ ```bash
131
+ pytest tests/
132
+ ```
133
+
134
+ ## License
135
+
136
+ The Unlicense
137
+
138
+ ## Links
139
+
140
+ - Source repository: https://github.com/link-foundation/links-client
141
+ - link-cli: https://github.com/link-foundation/link-cli
@@ -0,0 +1,116 @@
1
+ # Links Client - Python Implementation
2
+
3
+ Python client library for [link-cli](https://github.com/link-foundation/link-cli) — implementation of Links Theory database.
4
+
5
+ ## Installation
6
+
7
+ ### Prerequisites
8
+
9
+ Install link-cli globally:
10
+ ```bash
11
+ dotnet tool install --global clink
12
+ ```
13
+
14
+ ### Package Installation
15
+
16
+ ```bash
17
+ pip install -e .
18
+ ```
19
+
20
+ Or install from the repository root:
21
+
22
+ ```bash
23
+ cd python
24
+ pip install -e .
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ### Basic Usage
30
+
31
+ ```python
32
+ from links_client import LinkDBService
33
+
34
+ db = LinkDBService('/path/to/database.links')
35
+
36
+ # Create a link
37
+ link = db.create_link(100, 200)
38
+ print(link) # {'id': 1, 'source': 100, 'target': 200}
39
+
40
+ # Read all links
41
+ links = db.read_all_links()
42
+
43
+ # Delete a link
44
+ db.delete_link(1)
45
+ ```
46
+
47
+ ### Menu Storage
48
+
49
+ ```python
50
+ from links_client import MenuStorageService
51
+
52
+ menu_storage = MenuStorageService()
53
+
54
+ menu = [
55
+ {
56
+ "label": "Dashboard",
57
+ "icon": "pi pi-home",
58
+ "to": "/dashboard",
59
+ "items": [
60
+ {"label": "Analytics", "to": "/dashboard/analytics"}
61
+ ]
62
+ }
63
+ ]
64
+
65
+ menu_storage.store_menu_structure(menu, 0)
66
+ retrieved_menu = menu_storage.get_menu_structure(0)
67
+ ```
68
+
69
+ ### Authentication Storage
70
+
71
+ ```python
72
+ from links_client import AuthStorageService
73
+
74
+ auth_storage = AuthStorageService()
75
+
76
+ # Create user
77
+ user = auth_storage.create_user({
78
+ "username": "alice",
79
+ "email": "alice@example.com"
80
+ })
81
+
82
+ # Set password
83
+ auth_storage.set_password(user['userId'], {
84
+ "hash": "hashed_password",
85
+ "salt": "random_salt"
86
+ })
87
+ ```
88
+
89
+ ## API
90
+
91
+ For detailed API documentation, see the docs/ directory.
92
+
93
+ ## Examples
94
+
95
+ See examples in the examples/ directory:
96
+
97
+ - `basic_usage.py` - Basic clink integration tests
98
+ - `menu_storage_example.py` - Menu storage demonstration
99
+ - `auth_storage_example.py` - Authentication storage demonstration
100
+
101
+ ## Testing
102
+
103
+ Run tests with pytest:
104
+
105
+ ```bash
106
+ pytest tests/
107
+ ```
108
+
109
+ ## License
110
+
111
+ The Unlicense
112
+
113
+ ## Links
114
+
115
+ - Source repository: https://github.com/link-foundation/links-client
116
+ - link-cli: https://github.com/link-foundation/link-cli
@@ -0,0 +1,22 @@
1
+ """
2
+ Links Client - Python client library for link-cli (Links Theory database)
3
+
4
+ This package provides a Python interface to the link-cli (clink) tool for
5
+ working with Links Theory databases.
6
+ """
7
+
8
+ from links_client.services.link_db_service import LinkDBService
9
+ from links_client.services.menu_storage_service import MenuStorageService
10
+ from links_client.services.auth_storage_service import AuthStorageService
11
+ from links_client.api.ilinks import ILinks, LinkConstants
12
+ from links_client.api.recursive_links import RecursiveLinks
13
+
14
+ __version__ = "1.0.0"
15
+ __all__ = [
16
+ "LinkDBService",
17
+ "MenuStorageService",
18
+ "AuthStorageService",
19
+ "ILinks",
20
+ "LinkConstants",
21
+ "RecursiveLinks"
22
+ ]
@@ -0,0 +1,7 @@
1
+ """Services for interacting with link-cli database"""
2
+
3
+ from links_client.services.link_db_service import LinkDBService
4
+ from links_client.services.menu_storage_service import MenuStorageService
5
+ from links_client.services.auth_storage_service import AuthStorageService
6
+
7
+ __all__ = ["LinkDBService", "MenuStorageService", "AuthStorageService"]