agentberlin 0.4.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,77 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # Environments
56
+ .env
57
+ .venv
58
+ env/
59
+ venv/
60
+ ENV/
61
+ env.bak/
62
+ venv.bak/
63
+
64
+ # IDE
65
+ .idea/
66
+ .vscode/
67
+ *.swp
68
+ *.swo
69
+
70
+ # mypy
71
+ .mypy_cache/
72
+ .dmypy.json
73
+ dmypy.json
74
+
75
+ # uv
76
+ uv.lock
77
+ .python-version
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Agent Berlin
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,182 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentberlin
3
+ Version: 0.4.0
4
+ Summary: Python SDK for Agent Berlin - AI-powered SEO and AEO automation
5
+ Project-URL: Homepage, https://agentberlin.ai
6
+ Project-URL: Documentation, https://docs.agentberlin.ai/sdk/python
7
+ Project-URL: Repository, https://github.com/boat-builder/berlin
8
+ Author-email: Agent Berlin <support@agentberlin.ai>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: aeo,ai,analytics,optimization,search,seo
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
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
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.9
22
+ Requires-Dist: pydantic>=2.0.0
23
+ Requires-Dist: requests>=2.28.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: black>=24.0.0; extra == 'dev'
26
+ Requires-Dist: isort>=5.13.0; extra == 'dev'
27
+ Requires-Dist: mypy>=1.8.0; extra == 'dev'
28
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
29
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
30
+ Requires-Dist: responses>=0.25.0; extra == 'dev'
31
+ Requires-Dist: types-requests>=2.31.0; extra == 'dev'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # Agent Berlin Python SDK
35
+
36
+ Official Python SDK for Agent Berlin - AI-powered SEO and AEO automation.
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ pip install agentberlin
42
+ ```
43
+
44
+ ## Quick Start
45
+
46
+ ```python
47
+ from agentberlin import AgentBerlin
48
+
49
+ # Set your API token as an environment variable
50
+ # export AGENTBERLIN_TOKEN="your-token-here"
51
+
52
+ client = AgentBerlin()
53
+
54
+ # Get analytics for your project
55
+ analytics = client.analytics.get(project_domain="example.com")
56
+ print(f"Visibility: {analytics.visibility.current_percentage}%")
57
+ print(f"LLM Sessions: {analytics.traffic.llm_sessions}")
58
+
59
+ # Search for pages
60
+ pages = client.pages.search(
61
+ project_domain="example.com",
62
+ query="SEO best practices",
63
+ limit=10
64
+ )
65
+ for page in pages.pages:
66
+ print(f" - {page.title}: {page.url}")
67
+
68
+ # Search for keywords
69
+ keywords = client.keywords.search(
70
+ project_domain="example.com",
71
+ query="digital marketing"
72
+ )
73
+ for kw in keywords.keywords:
74
+ print(f" - {kw.keyword} (volume: {kw.volume})")
75
+
76
+ # Get page details
77
+ page = client.pages.get(
78
+ project_domain="example.com",
79
+ url="https://example.com/blog/seo-tips"
80
+ )
81
+ print(f"Title: {page.title}")
82
+ print(f"H1: {page.h1}")
83
+
84
+ # Get brand profile
85
+ profile = client.brand.get_profile(project_domain="example.com")
86
+ print(f"Domain Authority: {profile.domain_authority}")
87
+
88
+ # Update brand profile
89
+ client.brand.update_profile(
90
+ project_domain="example.com",
91
+ field="competitors",
92
+ value="competitor.com",
93
+ mode="add"
94
+ )
95
+
96
+ # Fetch SERP results
97
+ serp = client.serp.fetch(query="best seo tools", max_results=5)
98
+ for result in serp.results:
99
+ print(f" - {result.title}: {result.url}")
100
+ ```
101
+
102
+ ## Authentication
103
+
104
+ The SDK requires an API token. Set it as an environment variable:
105
+
106
+ ```bash
107
+ export AGENTBERLIN_TOKEN="your-token-here"
108
+ ```
109
+
110
+ Or pass it directly:
111
+
112
+ ```python
113
+ client = AgentBerlin(token="your-token-here")
114
+ ```
115
+
116
+ ## Configuration
117
+
118
+ ```python
119
+ client = AgentBerlin(
120
+ token="your-token", # Optional if AGENTBERLIN_TOKEN env var is set
121
+ base_url="https://...", # Optional, defaults to production API
122
+ timeout=30, # Request timeout in seconds
123
+ )
124
+ ```
125
+
126
+ ## Resources
127
+
128
+ ### Analytics
129
+ ```python
130
+ client.analytics.get(project_domain="example.com")
131
+ ```
132
+
133
+ ### Pages
134
+ ```python
135
+ client.pages.search(project_domain, query, domain=None, limit=10, status_code=None, topic=None, page_type=None)
136
+ client.pages.get(project_domain, url, content_length=0)
137
+ ```
138
+
139
+ ### Keywords
140
+ ```python
141
+ client.keywords.search(project_domain, query, limit=10)
142
+ ```
143
+
144
+ ### Brand
145
+ ```python
146
+ client.brand.get_profile(project_domain)
147
+ client.brand.update_profile(project_domain, field, value, mode="add")
148
+ ```
149
+
150
+ ### SERP
151
+ ```python
152
+ client.serp.fetch(query, max_results=10, country=None, language=None)
153
+ ```
154
+
155
+ ## Error Handling
156
+
157
+ ```python
158
+ from agentberlin import AgentBerlin
159
+ from agentberlin.exceptions import (
160
+ AgentBerlinError,
161
+ AgentBerlinAuthenticationError,
162
+ AgentBerlinNotFoundError,
163
+ AgentBerlinRateLimitError,
164
+ )
165
+
166
+ client = AgentBerlin()
167
+
168
+ try:
169
+ analytics = client.analytics.get(project_domain="example.com")
170
+ except AgentBerlinAuthenticationError:
171
+ print("Invalid or missing API token")
172
+ except AgentBerlinNotFoundError:
173
+ print("Domain not found")
174
+ except AgentBerlinRateLimitError as e:
175
+ print(f"Rate limited. Retry after {e.retry_after} seconds")
176
+ except AgentBerlinError as e:
177
+ print(f"API error: {e.message}")
178
+ ```
179
+
180
+ ## License
181
+
182
+ MIT License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,149 @@
1
+ # Agent Berlin Python SDK
2
+
3
+ Official Python SDK for Agent Berlin - AI-powered SEO and AEO automation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install agentberlin
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ from agentberlin import AgentBerlin
15
+
16
+ # Set your API token as an environment variable
17
+ # export AGENTBERLIN_TOKEN="your-token-here"
18
+
19
+ client = AgentBerlin()
20
+
21
+ # Get analytics for your project
22
+ analytics = client.analytics.get(project_domain="example.com")
23
+ print(f"Visibility: {analytics.visibility.current_percentage}%")
24
+ print(f"LLM Sessions: {analytics.traffic.llm_sessions}")
25
+
26
+ # Search for pages
27
+ pages = client.pages.search(
28
+ project_domain="example.com",
29
+ query="SEO best practices",
30
+ limit=10
31
+ )
32
+ for page in pages.pages:
33
+ print(f" - {page.title}: {page.url}")
34
+
35
+ # Search for keywords
36
+ keywords = client.keywords.search(
37
+ project_domain="example.com",
38
+ query="digital marketing"
39
+ )
40
+ for kw in keywords.keywords:
41
+ print(f" - {kw.keyword} (volume: {kw.volume})")
42
+
43
+ # Get page details
44
+ page = client.pages.get(
45
+ project_domain="example.com",
46
+ url="https://example.com/blog/seo-tips"
47
+ )
48
+ print(f"Title: {page.title}")
49
+ print(f"H1: {page.h1}")
50
+
51
+ # Get brand profile
52
+ profile = client.brand.get_profile(project_domain="example.com")
53
+ print(f"Domain Authority: {profile.domain_authority}")
54
+
55
+ # Update brand profile
56
+ client.brand.update_profile(
57
+ project_domain="example.com",
58
+ field="competitors",
59
+ value="competitor.com",
60
+ mode="add"
61
+ )
62
+
63
+ # Fetch SERP results
64
+ serp = client.serp.fetch(query="best seo tools", max_results=5)
65
+ for result in serp.results:
66
+ print(f" - {result.title}: {result.url}")
67
+ ```
68
+
69
+ ## Authentication
70
+
71
+ The SDK requires an API token. Set it as an environment variable:
72
+
73
+ ```bash
74
+ export AGENTBERLIN_TOKEN="your-token-here"
75
+ ```
76
+
77
+ Or pass it directly:
78
+
79
+ ```python
80
+ client = AgentBerlin(token="your-token-here")
81
+ ```
82
+
83
+ ## Configuration
84
+
85
+ ```python
86
+ client = AgentBerlin(
87
+ token="your-token", # Optional if AGENTBERLIN_TOKEN env var is set
88
+ base_url="https://...", # Optional, defaults to production API
89
+ timeout=30, # Request timeout in seconds
90
+ )
91
+ ```
92
+
93
+ ## Resources
94
+
95
+ ### Analytics
96
+ ```python
97
+ client.analytics.get(project_domain="example.com")
98
+ ```
99
+
100
+ ### Pages
101
+ ```python
102
+ client.pages.search(project_domain, query, domain=None, limit=10, status_code=None, topic=None, page_type=None)
103
+ client.pages.get(project_domain, url, content_length=0)
104
+ ```
105
+
106
+ ### Keywords
107
+ ```python
108
+ client.keywords.search(project_domain, query, limit=10)
109
+ ```
110
+
111
+ ### Brand
112
+ ```python
113
+ client.brand.get_profile(project_domain)
114
+ client.brand.update_profile(project_domain, field, value, mode="add")
115
+ ```
116
+
117
+ ### SERP
118
+ ```python
119
+ client.serp.fetch(query, max_results=10, country=None, language=None)
120
+ ```
121
+
122
+ ## Error Handling
123
+
124
+ ```python
125
+ from agentberlin import AgentBerlin
126
+ from agentberlin.exceptions import (
127
+ AgentBerlinError,
128
+ AgentBerlinAuthenticationError,
129
+ AgentBerlinNotFoundError,
130
+ AgentBerlinRateLimitError,
131
+ )
132
+
133
+ client = AgentBerlin()
134
+
135
+ try:
136
+ analytics = client.analytics.get(project_domain="example.com")
137
+ except AgentBerlinAuthenticationError:
138
+ print("Invalid or missing API token")
139
+ except AgentBerlinNotFoundError:
140
+ print("Domain not found")
141
+ except AgentBerlinRateLimitError as e:
142
+ print(f"Rate limited. Retry after {e.retry_after} seconds")
143
+ except AgentBerlinError as e:
144
+ print(f"API error: {e.message}")
145
+ ```
146
+
147
+ ## License
148
+
149
+ MIT License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,75 @@
1
+ [project]
2
+ name = "agentberlin"
3
+ version = "0.4.0"
4
+ description = "Python SDK for Agent Berlin - AI-powered SEO and AEO automation"
5
+ readme = "README.md"
6
+ license = {text = "MIT"}
7
+ requires-python = ">=3.9"
8
+ authors = [
9
+ {name = "Agent Berlin", email = "support@agentberlin.ai"}
10
+ ]
11
+ keywords = ["seo", "aeo", "ai", "search", "optimization", "analytics"]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Intended Audience :: Developers",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Typing :: Typed",
22
+ ]
23
+ dependencies = [
24
+ "requests>=2.28.0",
25
+ "pydantic>=2.0.0",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://agentberlin.ai"
30
+ Documentation = "https://docs.agentberlin.ai/sdk/python"
31
+ Repository = "https://github.com/boat-builder/berlin"
32
+
33
+ [build-system]
34
+ requires = ["hatchling>=1.20.0"]
35
+ build-backend = "hatchling.build"
36
+
37
+ [tool.hatch.build.targets.wheel]
38
+ packages = ["src/agentberlin"]
39
+
40
+ [tool.hatch.build.targets.sdist]
41
+ include = [
42
+ "/src",
43
+ "/tests",
44
+ "/README.md",
45
+ "/LICENSE",
46
+ ]
47
+
48
+ [tool.black]
49
+ line-length = 100
50
+ target-version = ["py39"]
51
+
52
+ [tool.isort]
53
+ profile = "black"
54
+ line_length = 100
55
+
56
+ [tool.mypy]
57
+ python_version = "0.4.0"
58
+ strict = true
59
+ warn_return_any = true
60
+ warn_unused_configs = true
61
+
62
+ [tool.pytest.ini_options]
63
+ testpaths = ["tests"]
64
+ addopts = "-v --tb=short"
65
+
66
+ [project.optional-dependencies]
67
+ dev = [
68
+ "black>=24.0.0",
69
+ "isort>=5.13.0",
70
+ "mypy>=1.8.0",
71
+ "pytest>=8.0.0",
72
+ "pytest-cov>=4.1.0",
73
+ "responses>=0.25.0",
74
+ "types-requests>=2.31.0",
75
+ ]
@@ -0,0 +1,51 @@
1
+ """Agent Berlin Python SDK.
2
+
3
+ A Python SDK for Agent Berlin - AI-powered SEO and AEO automation.
4
+
5
+ Example:
6
+ from agentberlin import AgentBerlin
7
+
8
+ # Set AGENTBERLIN_TOKEN environment variable or pass token directly
9
+ client = AgentBerlin()
10
+
11
+ # Get analytics
12
+ analytics = client.analytics.get(project_domain="example.com")
13
+
14
+ # Search pages
15
+ pages = client.pages.search(project_domain="example.com", query="SEO tips")
16
+
17
+ # Search keywords
18
+ keywords = client.keywords.search(project_domain="example.com", query="marketing")
19
+
20
+ # Get brand profile
21
+ profile = client.brand.get_profile(project_domain="example.com")
22
+
23
+ # Fetch SERP results
24
+ serp = client.serp.fetch(query="best seo tools")
25
+ """
26
+
27
+ from .client import AgentBerlin
28
+ from .exceptions import (
29
+ AgentBerlinAPIError,
30
+ AgentBerlinAuthenticationError,
31
+ AgentBerlinConnectionError,
32
+ AgentBerlinError,
33
+ AgentBerlinNotFoundError,
34
+ AgentBerlinRateLimitError,
35
+ AgentBerlinServerError,
36
+ AgentBerlinValidationError,
37
+ )
38
+
39
+ __version__ = "0.4.0"
40
+
41
+ __all__ = [
42
+ "AgentBerlin",
43
+ "AgentBerlinError",
44
+ "AgentBerlinAuthenticationError",
45
+ "AgentBerlinAPIError",
46
+ "AgentBerlinNotFoundError",
47
+ "AgentBerlinRateLimitError",
48
+ "AgentBerlinServerError",
49
+ "AgentBerlinValidationError",
50
+ "AgentBerlinConnectionError",
51
+ ]