serp-cli 2026.4.5.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.
- serp_cli-2026.4.5.0/.env.example +9 -0
- serp_cli-2026.4.5.0/CHANGELOG.md +24 -0
- serp_cli-2026.4.5.0/LICENSE +21 -0
- serp_cli-2026.4.5.0/PKG-INFO +156 -0
- serp_cli-2026.4.5.0/README.md +110 -0
- serp_cli-2026.4.5.0/pyproject.toml +118 -0
- serp_cli-2026.4.5.0/serp_cli/__init__.py +1 -0
- serp_cli-2026.4.5.0/serp_cli/__main__.py +5 -0
- serp_cli-2026.4.5.0/serp_cli/commands/__init__.py +0 -0
- serp_cli-2026.4.5.0/serp_cli/commands/info.py +50 -0
- serp_cli-2026.4.5.0/serp_cli/commands/search.py +295 -0
- serp_cli-2026.4.5.0/serp_cli/core/__init__.py +0 -0
- serp_cli-2026.4.5.0/serp_cli/core/client.py +93 -0
- serp_cli-2026.4.5.0/serp_cli/core/config.py +39 -0
- serp_cli-2026.4.5.0/serp_cli/core/exceptions.py +37 -0
- serp_cli-2026.4.5.0/serp_cli/core/output.py +201 -0
- serp_cli-2026.4.5.0/serp_cli/main.py +70 -0
- serp_cli-2026.4.5.0/tests/conftest.py +104 -0
- serp_cli-2026.4.5.0/tests/test_client.py +121 -0
- serp_cli-2026.4.5.0/tests/test_commands.py +194 -0
- serp_cli-2026.4.5.0/tests/test_config.py +52 -0
- serp_cli-2026.4.5.0/tests/test_integration.py +47 -0
- serp_cli-2026.4.5.0/tests/test_output.py +127 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# AceDataCloud API Token
|
|
2
|
+
# Get yours at https://platform.acedata.cloud
|
|
3
|
+
ACEDATACLOUD_API_TOKEN=
|
|
4
|
+
|
|
5
|
+
# Optional: Custom API base URL (default: https://api.acedata.cloud)
|
|
6
|
+
# ACEDATACLOUD_API_BASE_URL=https://api.acedata.cloud
|
|
7
|
+
|
|
8
|
+
# Optional: Request timeout in seconds (default: 30)
|
|
9
|
+
# SERP_REQUEST_TIMEOUT=30
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2025-01-21
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Initial release of SERP CLI
|
|
10
|
+
- `search` command for Google web search with all search types
|
|
11
|
+
- `images` shortcut command for Google Image search
|
|
12
|
+
- `news` shortcut command for Google News search
|
|
13
|
+
- `videos` shortcut command for Google Video search
|
|
14
|
+
- `places` shortcut command for Google Places search
|
|
15
|
+
- `maps` shortcut command for Google Maps search
|
|
16
|
+
- `search-types` command to list available search types
|
|
17
|
+
- `time-ranges` command to list time range filters
|
|
18
|
+
- `config` command to show current configuration
|
|
19
|
+
- Country and language localization support
|
|
20
|
+
- Time range filtering for news and trending content
|
|
21
|
+
- Pagination support with `--number` and `--page`
|
|
22
|
+
- `--json` flag for machine-readable output on all commands
|
|
23
|
+
- Rich terminal formatting for human-readable output
|
|
24
|
+
- Docker support via Dockerfile and docker-compose.yaml
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 AceDataCloud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: serp-cli
|
|
3
|
+
Version: 2026.4.5.0
|
|
4
|
+
Summary: CLI tool for Google SERP (Search Engine Results) via AceDataCloud API
|
|
5
|
+
Project-URL: Homepage, https://github.com/AceDataCloud/SerpCli
|
|
6
|
+
Project-URL: Repository, https://github.com/AceDataCloud/SerpCli
|
|
7
|
+
Project-URL: Issues, https://github.com/AceDataCloud/SerpCli/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/AceDataCloud/SerpCli/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: AceDataCloud <support@acedata.cloud>
|
|
10
|
+
Maintainer-email: AceDataCloud <support@acedata.cloud>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: acedata,cli,command-line,google,search,serp,web-search
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: click>=8.1.0
|
|
27
|
+
Requires-Dist: httpx>=0.27.0
|
|
28
|
+
Requires-Dist: pydantic>=2.0.0
|
|
29
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
30
|
+
Requires-Dist: rich>=13.0.0
|
|
31
|
+
Provides-Extra: all
|
|
32
|
+
Requires-Dist: serp-cli[dev,release,test]; extra == 'all'
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: mypy>=1.10.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
37
|
+
Provides-Extra: release
|
|
38
|
+
Requires-Dist: build>=1.2.0; extra == 'release'
|
|
39
|
+
Requires-Dist: twine>=6.1.0; extra == 'release'
|
|
40
|
+
Provides-Extra: test
|
|
41
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'test'
|
|
42
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'test'
|
|
43
|
+
Requires-Dist: pytest>=8.0.0; extra == 'test'
|
|
44
|
+
Requires-Dist: respx>=0.21.0; extra == 'test'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
# SERP CLI
|
|
48
|
+
|
|
49
|
+
A command-line tool for Google Search (SERP) via the [AceDataCloud](https://platform.acedata.cloud) platform.
|
|
50
|
+
|
|
51
|
+
## Features
|
|
52
|
+
|
|
53
|
+
- **Web Search** — Search Google and get structured results (organic, knowledge graph, answer box)
|
|
54
|
+
- **Image Search** — Find images with `serp images`
|
|
55
|
+
- **News Search** — Get news articles with time filtering
|
|
56
|
+
- **Video Search** — Find video content from YouTube and more
|
|
57
|
+
- **Places Search** — Find local businesses and places
|
|
58
|
+
- **Maps Search** — Search Google Maps for locations
|
|
59
|
+
- **Rich Output** — Beautiful terminal formatting with `--json` for scripting
|
|
60
|
+
- **Localization** — Country and language support for localized results
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install serp-cli
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Set your API token
|
|
72
|
+
export ACEDATACLOUD_API_TOKEN=your_token_here
|
|
73
|
+
|
|
74
|
+
# Web search
|
|
75
|
+
serp search "artificial intelligence"
|
|
76
|
+
|
|
77
|
+
# Image search
|
|
78
|
+
serp images "sunset photography"
|
|
79
|
+
|
|
80
|
+
# News with time filter
|
|
81
|
+
serp news "tech news" --time-range qdr:d
|
|
82
|
+
|
|
83
|
+
# Places search
|
|
84
|
+
serp places "coffee shops near Times Square" -c us
|
|
85
|
+
|
|
86
|
+
# Search with pagination
|
|
87
|
+
serp search "python tutorials" -n 20 -p 2
|
|
88
|
+
|
|
89
|
+
# Get JSON output
|
|
90
|
+
serp search "hello world" --json | jq '.organic[0].title'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Commands
|
|
94
|
+
|
|
95
|
+
| Command | Description |
|
|
96
|
+
|---------|-------------|
|
|
97
|
+
| `search` | Google web search (all types via `-t`) |
|
|
98
|
+
| `images` | Google Image search |
|
|
99
|
+
| `news` | Google News search |
|
|
100
|
+
| `videos` | Google Video search |
|
|
101
|
+
| `places` | Google Places search |
|
|
102
|
+
| `maps` | Google Maps search |
|
|
103
|
+
| `search-types` | List available search types |
|
|
104
|
+
| `time-ranges` | List time range filters |
|
|
105
|
+
| `config` | Show current configuration |
|
|
106
|
+
|
|
107
|
+
## Search Options
|
|
108
|
+
|
|
109
|
+
| Option | Description |
|
|
110
|
+
|--------|-------------|
|
|
111
|
+
| `-t`, `--type` | Search type: search, images, news, maps, places, videos |
|
|
112
|
+
| `-c`, `--country` | Country code (e.g. us, cn, uk) |
|
|
113
|
+
| `-l`, `--language` | Language code (e.g. en, zh-cn, fr) |
|
|
114
|
+
| `--time-range` | Time filter: qdr:h (hour), qdr:d (day), qdr:w (week), qdr:m (month) |
|
|
115
|
+
| `-n`, `--number` | Number of results per page (default: 10) |
|
|
116
|
+
| `-p`, `--page` | Page number for pagination |
|
|
117
|
+
| `--json` | Output raw JSON |
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
| Environment Variable | Description | Default |
|
|
122
|
+
|---------------------|-------------|---------|
|
|
123
|
+
| `ACEDATACLOUD_API_TOKEN` | API authentication token | (required) |
|
|
124
|
+
| `ACEDATACLOUD_API_BASE_URL` | API base URL | `https://api.acedata.cloud` |
|
|
125
|
+
| `SERP_REQUEST_TIMEOUT` | Request timeout in seconds | `30` |
|
|
126
|
+
|
|
127
|
+
You can also use a `.env` file or pass `--token` directly.
|
|
128
|
+
|
|
129
|
+
## Docker
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
docker compose run serp-cli search "hello world"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Development
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Install with dev dependencies
|
|
139
|
+
pip install -e ".[all]"
|
|
140
|
+
|
|
141
|
+
# Run tests
|
|
142
|
+
pytest
|
|
143
|
+
|
|
144
|
+
# Run linter
|
|
145
|
+
ruff check .
|
|
146
|
+
ruff format --check .
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
152
|
+
|
|
153
|
+
## Links
|
|
154
|
+
|
|
155
|
+
- [AceDataCloud Platform](https://platform.acedata.cloud)
|
|
156
|
+
- [API Documentation](https://docs.acedata.cloud)
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# SERP CLI
|
|
2
|
+
|
|
3
|
+
A command-line tool for Google Search (SERP) via the [AceDataCloud](https://platform.acedata.cloud) platform.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Web Search** — Search Google and get structured results (organic, knowledge graph, answer box)
|
|
8
|
+
- **Image Search** — Find images with `serp images`
|
|
9
|
+
- **News Search** — Get news articles with time filtering
|
|
10
|
+
- **Video Search** — Find video content from YouTube and more
|
|
11
|
+
- **Places Search** — Find local businesses and places
|
|
12
|
+
- **Maps Search** — Search Google Maps for locations
|
|
13
|
+
- **Rich Output** — Beautiful terminal formatting with `--json` for scripting
|
|
14
|
+
- **Localization** — Country and language support for localized results
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install serp-cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Set your API token
|
|
26
|
+
export ACEDATACLOUD_API_TOKEN=your_token_here
|
|
27
|
+
|
|
28
|
+
# Web search
|
|
29
|
+
serp search "artificial intelligence"
|
|
30
|
+
|
|
31
|
+
# Image search
|
|
32
|
+
serp images "sunset photography"
|
|
33
|
+
|
|
34
|
+
# News with time filter
|
|
35
|
+
serp news "tech news" --time-range qdr:d
|
|
36
|
+
|
|
37
|
+
# Places search
|
|
38
|
+
serp places "coffee shops near Times Square" -c us
|
|
39
|
+
|
|
40
|
+
# Search with pagination
|
|
41
|
+
serp search "python tutorials" -n 20 -p 2
|
|
42
|
+
|
|
43
|
+
# Get JSON output
|
|
44
|
+
serp search "hello world" --json | jq '.organic[0].title'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
| Command | Description |
|
|
50
|
+
|---------|-------------|
|
|
51
|
+
| `search` | Google web search (all types via `-t`) |
|
|
52
|
+
| `images` | Google Image search |
|
|
53
|
+
| `news` | Google News search |
|
|
54
|
+
| `videos` | Google Video search |
|
|
55
|
+
| `places` | Google Places search |
|
|
56
|
+
| `maps` | Google Maps search |
|
|
57
|
+
| `search-types` | List available search types |
|
|
58
|
+
| `time-ranges` | List time range filters |
|
|
59
|
+
| `config` | Show current configuration |
|
|
60
|
+
|
|
61
|
+
## Search Options
|
|
62
|
+
|
|
63
|
+
| Option | Description |
|
|
64
|
+
|--------|-------------|
|
|
65
|
+
| `-t`, `--type` | Search type: search, images, news, maps, places, videos |
|
|
66
|
+
| `-c`, `--country` | Country code (e.g. us, cn, uk) |
|
|
67
|
+
| `-l`, `--language` | Language code (e.g. en, zh-cn, fr) |
|
|
68
|
+
| `--time-range` | Time filter: qdr:h (hour), qdr:d (day), qdr:w (week), qdr:m (month) |
|
|
69
|
+
| `-n`, `--number` | Number of results per page (default: 10) |
|
|
70
|
+
| `-p`, `--page` | Page number for pagination |
|
|
71
|
+
| `--json` | Output raw JSON |
|
|
72
|
+
|
|
73
|
+
## Configuration
|
|
74
|
+
|
|
75
|
+
| Environment Variable | Description | Default |
|
|
76
|
+
|---------------------|-------------|---------|
|
|
77
|
+
| `ACEDATACLOUD_API_TOKEN` | API authentication token | (required) |
|
|
78
|
+
| `ACEDATACLOUD_API_BASE_URL` | API base URL | `https://api.acedata.cloud` |
|
|
79
|
+
| `SERP_REQUEST_TIMEOUT` | Request timeout in seconds | `30` |
|
|
80
|
+
|
|
81
|
+
You can also use a `.env` file or pass `--token` directly.
|
|
82
|
+
|
|
83
|
+
## Docker
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
docker compose run serp-cli search "hello world"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Install with dev dependencies
|
|
93
|
+
pip install -e ".[all]"
|
|
94
|
+
|
|
95
|
+
# Run tests
|
|
96
|
+
pytest
|
|
97
|
+
|
|
98
|
+
# Run linter
|
|
99
|
+
ruff check .
|
|
100
|
+
ruff format --check .
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
106
|
+
|
|
107
|
+
## Links
|
|
108
|
+
|
|
109
|
+
- [AceDataCloud Platform](https://platform.acedata.cloud)
|
|
110
|
+
- [API Documentation](https://docs.acedata.cloud)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "serp-cli"
|
|
3
|
+
version = "2026.4.5.0"
|
|
4
|
+
description = "CLI tool for Google SERP (Search Engine Results) via AceDataCloud API"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = { text = "MIT" }
|
|
7
|
+
requires-python = ">=3.10"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "AceDataCloud", email = "support@acedata.cloud" }
|
|
10
|
+
]
|
|
11
|
+
maintainers = [
|
|
12
|
+
{ name = "AceDataCloud", email = "support@acedata.cloud" }
|
|
13
|
+
]
|
|
14
|
+
keywords = [
|
|
15
|
+
"cli",
|
|
16
|
+
"serp",
|
|
17
|
+
"google",
|
|
18
|
+
"search",
|
|
19
|
+
"web-search",
|
|
20
|
+
"acedata",
|
|
21
|
+
"command-line",
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 4 - Beta",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"License :: OSI Approved :: MIT License",
|
|
27
|
+
"Operating System :: OS Independent",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"Programming Language :: Python :: 3.10",
|
|
30
|
+
"Programming Language :: Python :: 3.11",
|
|
31
|
+
"Programming Language :: Python :: 3.12",
|
|
32
|
+
"Topic :: Internet :: WWW/HTTP",
|
|
33
|
+
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
|
|
34
|
+
"Environment :: Console",
|
|
35
|
+
]
|
|
36
|
+
dependencies = [
|
|
37
|
+
"click>=8.1.0",
|
|
38
|
+
"httpx>=0.27.0",
|
|
39
|
+
"python-dotenv>=1.0.0",
|
|
40
|
+
"rich>=13.0.0",
|
|
41
|
+
"pydantic>=2.0.0",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.optional-dependencies]
|
|
45
|
+
dev = [
|
|
46
|
+
"ruff>=0.4.0",
|
|
47
|
+
"mypy>=1.10.0",
|
|
48
|
+
"pre-commit>=3.7.0",
|
|
49
|
+
]
|
|
50
|
+
test = [
|
|
51
|
+
"pytest>=8.0.0",
|
|
52
|
+
"pytest-asyncio>=0.23.0",
|
|
53
|
+
"pytest-cov>=5.0.0",
|
|
54
|
+
"respx>=0.21.0",
|
|
55
|
+
]
|
|
56
|
+
release = [
|
|
57
|
+
"build>=1.2.0",
|
|
58
|
+
"twine>=6.1.0",
|
|
59
|
+
]
|
|
60
|
+
all = [
|
|
61
|
+
"serp-cli[dev,test,release]",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[project.scripts]
|
|
65
|
+
serp-cli = "serp_cli.main:cli"
|
|
66
|
+
serp = "serp_cli.main:cli"
|
|
67
|
+
|
|
68
|
+
[project.urls]
|
|
69
|
+
Homepage = "https://github.com/AceDataCloud/SerpCli"
|
|
70
|
+
Repository = "https://github.com/AceDataCloud/SerpCli"
|
|
71
|
+
Issues = "https://github.com/AceDataCloud/SerpCli/issues"
|
|
72
|
+
Changelog = "https://github.com/AceDataCloud/SerpCli/blob/main/CHANGELOG.md"
|
|
73
|
+
|
|
74
|
+
[build-system]
|
|
75
|
+
requires = ["hatchling>=1.21.0,<1.22.0"]
|
|
76
|
+
build-backend = "hatchling.build"
|
|
77
|
+
|
|
78
|
+
[tool.hatch.build.targets.wheel]
|
|
79
|
+
packages = ["serp_cli"]
|
|
80
|
+
|
|
81
|
+
[tool.hatch.build.targets.sdist]
|
|
82
|
+
include = [
|
|
83
|
+
"serp_cli/",
|
|
84
|
+
"tests/",
|
|
85
|
+
"README.md",
|
|
86
|
+
"LICENSE",
|
|
87
|
+
"CHANGELOG.md",
|
|
88
|
+
".env.example",
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
# Mypy Configuration
|
|
92
|
+
[tool.mypy]
|
|
93
|
+
python_version = "3.10"
|
|
94
|
+
warn_return_any = true
|
|
95
|
+
warn_unused_configs = true
|
|
96
|
+
disallow_untyped_defs = true
|
|
97
|
+
check_untyped_defs = true
|
|
98
|
+
|
|
99
|
+
# Pytest Configuration
|
|
100
|
+
[tool.pytest.ini_options]
|
|
101
|
+
testpaths = ["tests"]
|
|
102
|
+
asyncio_mode = "auto"
|
|
103
|
+
markers = [
|
|
104
|
+
"integration: marks tests that require real API access",
|
|
105
|
+
"slow: marks slow tests",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
# Ruff Configuration
|
|
109
|
+
[tool.ruff]
|
|
110
|
+
line-length = 100
|
|
111
|
+
target-version = "py310"
|
|
112
|
+
|
|
113
|
+
[tool.ruff.lint]
|
|
114
|
+
select = ["E", "W", "F", "I", "B", "C4", "UP", "ARG", "SIM"]
|
|
115
|
+
ignore = ["E501"]
|
|
116
|
+
|
|
117
|
+
[tool.ruff.format]
|
|
118
|
+
quote-style = "double"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""SERP CLI - Google Search via AceDataCloud API."""
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Info and utility commands."""
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
from serp_cli.core.config import settings
|
|
6
|
+
from serp_cli.core.output import console, print_search_types
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@click.command("search-types")
|
|
10
|
+
def search_types() -> None:
|
|
11
|
+
"""List available search types."""
|
|
12
|
+
print_search_types()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@click.command("time-ranges")
|
|
16
|
+
def time_ranges() -> None:
|
|
17
|
+
"""List available time range filters."""
|
|
18
|
+
from rich.table import Table
|
|
19
|
+
|
|
20
|
+
table = Table(title="Time Range Filters")
|
|
21
|
+
table.add_column("Code", style="bold cyan")
|
|
22
|
+
table.add_column("Period")
|
|
23
|
+
table.add_column("Description")
|
|
24
|
+
|
|
25
|
+
table.add_row("qdr:h", "Past Hour", "Results from the last hour")
|
|
26
|
+
table.add_row("qdr:d", "Past Day", "Results from the last 24 hours")
|
|
27
|
+
table.add_row("qdr:w", "Past Week", "Results from the last 7 days")
|
|
28
|
+
table.add_row("qdr:m", "Past Month", "Results from the last 30 days")
|
|
29
|
+
table.add_row("(none)", "Any Time", "No time restriction (default)")
|
|
30
|
+
|
|
31
|
+
console.print(table)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@click.command()
|
|
35
|
+
def config() -> None:
|
|
36
|
+
"""Show current configuration."""
|
|
37
|
+
from rich.table import Table
|
|
38
|
+
|
|
39
|
+
table = Table(title="SERP CLI Configuration")
|
|
40
|
+
table.add_column("Setting", style="bold cyan")
|
|
41
|
+
table.add_column("Value")
|
|
42
|
+
|
|
43
|
+
table.add_row("API Base URL", settings.api_base_url)
|
|
44
|
+
table.add_row(
|
|
45
|
+
"API Token",
|
|
46
|
+
f"{settings.api_token[:8]}..." if settings.api_token else "[red]Not set[/red]",
|
|
47
|
+
)
|
|
48
|
+
table.add_row("Request Timeout", f"{settings.request_timeout}s")
|
|
49
|
+
|
|
50
|
+
console.print(table)
|