search-api-webui 0.1.3__tar.gz → 0.1.5__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.
@@ -1,4 +1,4 @@
1
- Copyright (c) 2026 querit-ai
1
+ Copyright (c) 2026 QUERIT PRIVATE LIMITED
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: search-api-webui
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: A Search API WebUI for Querit, You, and other search providers.
5
5
  Project-URL: Homepage, https://github.com/querit-ai/search-api-webui
6
6
  Project-URL: Repository, https://github.com/querit-ai/search-api-webui.git
@@ -54,25 +54,26 @@ pip install search-api-webui
54
54
  search-api-webui
55
55
  ```
56
56
 
57
- Open your browser at http://localhost:8889.
58
-
59
57
  ## Development
60
58
 
61
59
  Use this method if you want to contribute to the code or build from source.
62
60
 
63
61
  ### Prerequisites
64
62
 
65
- Python 3.7+
66
- Node.js & npm (for building the frontend)
63
+ * Python 3.7+
64
+ * Node.js & npm (for building the frontend)
65
+
67
66
  ### Setup Steps
68
67
 
69
68
  **Clone the repository**
69
+
70
70
  ```
71
71
  git clone https://github.com/querit-ai/search-api-webui.git
72
72
  cd search-api-webui
73
73
  ```
74
74
 
75
75
  **Build Frontend**
76
+
76
77
  ```
77
78
  cd frontend
78
79
  npm install
@@ -80,23 +81,24 @@ npm run build
80
81
  cd …
81
82
  ```
82
83
 
83
- **Install Backend (Editable Mode)**
84
+ **Install search-api-webui (Editable Mode)**
85
+
84
86
  ```
85
87
  pip install -e .
86
88
  ```
87
89
 
88
90
  **Run the Server**
91
+
89
92
  ```
90
- python -m backend.app
93
+ python -m search_api_webui.app
91
94
  ```
92
95
 
93
96
  ## Configuration
94
97
 
95
98
  ### Add API Keys
96
99
 
97
- Open the WebUI settings page (click the gear icon).
98
- Enter your API Key for the selected provider (e.g., Querit).
99
- Keys are saved locally in user_config.json.
100
+ Open the WebUI settings page (click the gear icon). Enter your API Key for the selected provider (e.g., Querit). Keys are saved locally in $HOME/.search-api-webui/config.json.
101
+
100
102
  ### Add New Providers
101
103
 
102
104
  Edit providers.yaml in the root directory to add custom API endpoints. The system uses JMESPath to map JSON responses to the UI.
@@ -30,25 +30,26 @@ pip install search-api-webui
30
30
  search-api-webui
31
31
  ```
32
32
 
33
- Open your browser at http://localhost:8889.
34
-
35
33
  ## Development
36
34
 
37
35
  Use this method if you want to contribute to the code or build from source.
38
36
 
39
37
  ### Prerequisites
40
38
 
41
- Python 3.7+
42
- Node.js & npm (for building the frontend)
39
+ * Python 3.7+
40
+ * Node.js & npm (for building the frontend)
41
+
43
42
  ### Setup Steps
44
43
 
45
44
  **Clone the repository**
45
+
46
46
  ```
47
47
  git clone https://github.com/querit-ai/search-api-webui.git
48
48
  cd search-api-webui
49
49
  ```
50
50
 
51
51
  **Build Frontend**
52
+
52
53
  ```
53
54
  cd frontend
54
55
  npm install
@@ -56,23 +57,24 @@ npm run build
56
57
  cd …
57
58
  ```
58
59
 
59
- **Install Backend (Editable Mode)**
60
+ **Install search-api-webui (Editable Mode)**
61
+
60
62
  ```
61
63
  pip install -e .
62
64
  ```
63
65
 
64
66
  **Run the Server**
67
+
65
68
  ```
66
- python -m backend.app
69
+ python -m search_api_webui.app
67
70
  ```
68
71
 
69
72
  ## Configuration
70
73
 
71
74
  ### Add API Keys
72
75
 
73
- Open the WebUI settings page (click the gear icon).
74
- Enter your API Key for the selected provider (e.g., Querit).
75
- Keys are saved locally in user_config.json.
76
+ Open the WebUI settings page (click the gear icon). Enter your API Key for the selected provider (e.g., Querit). Keys are saved locally in $HOME/.search-api-webui/config.json.
77
+
76
78
  ### Add New Providers
77
79
 
78
80
  Edit providers.yaml in the root directory to add custom API endpoints. The system uses JMESPath to map JSON responses to the UI.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "search-api-webui"
7
- version = "0.1.3"
7
+ version = "0.1.5"
8
8
  description = "A Search API WebUI for Querit, You, and other search providers."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
@@ -0,0 +1,20 @@
1
+ # Copyright (c) 2026 QUERIT PRIVATE LIMITED
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to
5
+ # deal in the Software without restriction, including without limitation the
6
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ # sell copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ # DEALINGS IN THE SOFTWARE.
20
+
@@ -1,3 +1,23 @@
1
+ # Copyright (c) 2026 QUERIT PRIVATE LIMITED
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to
5
+ # deal in the Software without restriction, including without limitation the
6
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ # sell copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ # DEALINGS IN THE SOFTWARE.
20
+
1
21
  import json
2
22
  import os
3
23
  import webbrowser
@@ -0,0 +1,54 @@
1
+ # Copyright (c) 2026 QUERIT PRIVATE LIMITED
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to
5
+ # deal in the Software without restriction, including without limitation the
6
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ # sell copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ # DEALINGS IN THE SOFTWARE.
20
+
21
+ import os
22
+ import yaml
23
+ from .generic import GenericProvider
24
+ from .querit import QueritSdkProvider
25
+
26
+ def load_providers(file_path='providers.yaml'):
27
+ """
28
+ Parses the YAML configuration file and instantiates the appropriate provider classes.
29
+
30
+ Args:
31
+ file_path (str): Path to the providers configuration file.
32
+
33
+ Returns:
34
+ dict: A dictionary mapping provider names to their initialized instances.
35
+ """
36
+ if not os.path.exists(file_path):
37
+ print(f"Warning: Provider config file not found at {file_path}")
38
+ return {}
39
+
40
+ with open(file_path, 'r', encoding='utf-8') as f:
41
+ configs = yaml.safe_load(f)
42
+
43
+ providers = {}
44
+ for name, conf in configs.items():
45
+ conf['name'] = name
46
+ provider_type = conf.get('type', 'generic')
47
+
48
+ # Instantiate specific provider based on type or name
49
+ if provider_type == 'querit_sdk':
50
+ providers[name] = QueritSdkProvider(conf)
51
+ else:
52
+ providers[name] = GenericProvider(conf)
53
+
54
+ return providers
@@ -0,0 +1,45 @@
1
+ # Copyright (c) 2026 QUERIT PRIVATE LIMITED
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to
5
+ # deal in the Software without restriction, including without limitation the
6
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ # sell copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ # DEALINGS IN THE SOFTWARE.
20
+
21
+ from abc import ABC, abstractmethod
22
+
23
+ class BaseProvider(ABC):
24
+ """
25
+ Abstract base class for all search providers.
26
+ Enforces a standard interface for executing search queries.
27
+ """
28
+
29
+ @abstractmethod
30
+ def search(self, query, api_key, **kwargs):
31
+ """
32
+ Execute a search request against the provider.
33
+
34
+ Args:
35
+ query (str): The search keywords.
36
+ api_key (str): The API Key required for authentication.
37
+ **kwargs: Arbitrary keyword arguments (e.g., 'limit', 'language', 'api_url').
38
+
39
+ Returns:
40
+ dict: A standardized dictionary containing:
41
+ - 'results': List of dicts with 'title', 'url', 'snippet'.
42
+ - 'metrics': Dict with 'latency_ms' and 'size_bytes'.
43
+ - 'error': (Optional) Error message string if occurred.
44
+ """
45
+ pass
@@ -1,3 +1,23 @@
1
+ # Copyright (c) 2026 QUERIT PRIVATE LIMITED
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to
5
+ # deal in the Software without restriction, including without limitation the
6
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ # sell copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ # DEALINGS IN THE SOFTWARE.
20
+
1
21
  import time
2
22
  import requests
3
23
  import jmespath
@@ -1,3 +1,23 @@
1
+ # Copyright (c) 2026 QUERIT PRIVATE LIMITED
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to
5
+ # deal in the Software without restriction, including without limitation the
6
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ # sell copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ # DEALINGS IN THE SOFTWARE.
20
+
1
21
  import time
2
22
  import json
3
23
  from querit import QueritClient
File without changes
@@ -1,34 +0,0 @@
1
- import os
2
- import yaml
3
- from .generic import GenericProvider
4
- from .querit import QueritSdkProvider
5
-
6
- def load_providers(file_path='providers.yaml'):
7
- """
8
- Parses the YAML configuration file and instantiates the appropriate provider classes.
9
-
10
- Args:
11
- file_path (str): Path to the providers configuration file.
12
-
13
- Returns:
14
- dict: A dictionary mapping provider names to their initialized instances.
15
- """
16
- if not os.path.exists(file_path):
17
- print(f"Warning: Provider config file not found at {file_path}")
18
- return {}
19
-
20
- with open(file_path, 'r', encoding='utf-8') as f:
21
- configs = yaml.safe_load(f)
22
-
23
- providers = {}
24
- for name, conf in configs.items():
25
- conf['name'] = name
26
- provider_type = conf.get('type', 'generic')
27
-
28
- # Instantiate specific provider based on type or name
29
- if provider_type == 'querit_sdk':
30
- providers[name] = QueritSdkProvider(conf)
31
- else:
32
- providers[name] = GenericProvider(conf)
33
-
34
- return providers
@@ -1,25 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- class BaseProvider(ABC):
4
- """
5
- Abstract base class for all search providers.
6
- Enforces a standard interface for executing search queries.
7
- """
8
-
9
- @abstractmethod
10
- def search(self, query, api_key, **kwargs):
11
- """
12
- Execute a search request against the provider.
13
-
14
- Args:
15
- query (str): The search keywords.
16
- api_key (str): The API Key required for authentication.
17
- **kwargs: Arbitrary keyword arguments (e.g., 'limit', 'language', 'api_url').
18
-
19
- Returns:
20
- dict: A standardized dictionary containing:
21
- - 'results': List of dicts with 'title', 'url', 'snippet'.
22
- - 'metrics': Dict with 'latency_ms' and 'size_bytes'.
23
- - 'error': (Optional) Error message string if occurred.
24
- """
25
- pass