agentemail 0.1.0__py3-none-any.whl
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.
- .gitignore +30 -0
- PKG-INFO +125 -0
- README.md +99 -0
- __init__.py +89 -0
- _default_clients.py +30 -0
- agentemail-0.1.0.dist-info/METADATA +125 -0
- agentemail-0.1.0.dist-info/RECORD +49 -0
- agentemail-0.1.0.dist-info/WHEEL +4 -0
- client.py +225 -0
- core/__init__.py +127 -0
- core/api_error.py +23 -0
- core/client_wrapper.py +133 -0
- core/datetime_utils.py +70 -0
- core/file.py +67 -0
- core/force_multipart.py +18 -0
- core/http_client.py +839 -0
- core/http_response.py +59 -0
- core/http_sse/__init__.py +42 -0
- core/http_sse/_api.py +148 -0
- core/http_sse/_decoders.py +61 -0
- core/http_sse/_exceptions.py +7 -0
- core/http_sse/_models.py +17 -0
- core/jsonable_encoder.py +120 -0
- core/logging.py +107 -0
- core/parse_error.py +36 -0
- core/pydantic_utilities.py +634 -0
- core/query_encoder.py +58 -0
- core/remove_none_from_dict.py +11 -0
- core/request_options.py +35 -0
- core/serialization.py +276 -0
- environment.py +7 -0
- errors/__init__.py +34 -0
- errors/unprocessable_entity_error.py +11 -0
- pyproject.toml +51 -0
- sdk/__init__.py +4 -0
- sdk/client.py +470 -0
- sdk/raw_client.py +638 -0
- types/__init__.py +68 -0
- types/attachment_response.py +29 -0
- types/email_detail.py +36 -0
- types/email_detail_raw_headers.py +5 -0
- types/http_validation_error.py +20 -0
- types/inbox_response.py +27 -0
- types/paginated_response_inbox_response.py +24 -0
- types/paginated_response_thread_summary.py +24 -0
- types/thread_detail.py +33 -0
- types/thread_summary.py +31 -0
- types/validation_error.py +24 -0
- types/validation_error_loc_item.py +5 -0
.gitignore
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.vercel/
|
|
2
|
+
.venv/
|
|
3
|
+
venv/
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.pyc
|
|
6
|
+
*.pyo
|
|
7
|
+
*.pyd
|
|
8
|
+
.Python
|
|
9
|
+
.DS_Store
|
|
10
|
+
.env*
|
|
11
|
+
|
|
12
|
+
# Cloudflare Worker
|
|
13
|
+
.wrangler/
|
|
14
|
+
cloudflare-worker/node_modules/
|
|
15
|
+
cloudflare-worker/dist/
|
|
16
|
+
cloudflare-worker/.env.local
|
|
17
|
+
cloudflare-worker/wrangler.toml.local
|
|
18
|
+
cloudflare-worker/.wrangler
|
|
19
|
+
|
|
20
|
+
# Node
|
|
21
|
+
node_modules/
|
|
22
|
+
npm-debug.log
|
|
23
|
+
yarn-error.log
|
|
24
|
+
|
|
25
|
+
# IDE
|
|
26
|
+
.vscode/
|
|
27
|
+
.idea/
|
|
28
|
+
*.swp
|
|
29
|
+
*.swo
|
|
30
|
+
dist
|
PKG-INFO
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentemail
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Python SDK for the AgentEmail API — create and manage email inboxes programmatically.
|
|
5
|
+
Project-URL: Homepage, https://agentemail.co
|
|
6
|
+
Project-URL: Documentation, https://agentemail.co/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/mbaiswar/agentemailpy
|
|
8
|
+
Author-email: AgentEmail <support@agentemail.co>
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: agentemail,api,email,inbox,sdk
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
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
|
+
Classifier: Topic :: Communications :: Email
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Requires-Dist: httpx>=0.21.2
|
|
24
|
+
Requires-Dist: pydantic>=1.9.2
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# agentemail
|
|
28
|
+
|
|
29
|
+
Official Python SDK for the [AgentEmail](https://agentemail.co) API.
|
|
30
|
+
|
|
31
|
+
Create and manage email inboxes programmatically for your AI agents and applications.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install agentemail
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from agentemail import AgentemailApi
|
|
43
|
+
|
|
44
|
+
client = AgentemailApi(api_key="aem_your_api_key_here")
|
|
45
|
+
|
|
46
|
+
# List your inboxes
|
|
47
|
+
inboxes = client.sdk.list_inboxes()
|
|
48
|
+
print(inboxes.data)
|
|
49
|
+
|
|
50
|
+
# Create a new inbox
|
|
51
|
+
inbox = client.sdk.create_inbox(name="hello")
|
|
52
|
+
print(inbox.name) # "hello"
|
|
53
|
+
# Full address: hello@agentemail.co
|
|
54
|
+
|
|
55
|
+
# List email threads
|
|
56
|
+
threads = client.sdk.list_threads(inbox_id=inbox.id)
|
|
57
|
+
for thread in threads.data:
|
|
58
|
+
print(thread.subject, thread.message_count)
|
|
59
|
+
|
|
60
|
+
# Get a full thread with all messages
|
|
61
|
+
thread = client.sdk.get_thread(inbox_id=inbox.id, thread_id=threads.data[0].id)
|
|
62
|
+
for message in thread.messages:
|
|
63
|
+
print(message.from_address, message.body_text)
|
|
64
|
+
|
|
65
|
+
# Check usage vs plan limits
|
|
66
|
+
usage = client.sdk.get_usage()
|
|
67
|
+
print(f"Inboxes: {usage.inboxes.used}/{usage.inboxes.limit}")
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Async Usage
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import asyncio
|
|
74
|
+
from agentemail import AsyncAgentemailApi
|
|
75
|
+
|
|
76
|
+
async def main():
|
|
77
|
+
client = AsyncAgentemailApi(api_key="aem_your_api_key_here")
|
|
78
|
+
inboxes = await client.sdk.list_inboxes()
|
|
79
|
+
print(inboxes.data)
|
|
80
|
+
|
|
81
|
+
asyncio.run(main())
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Authentication
|
|
85
|
+
|
|
86
|
+
Generate an API key from your [AgentEmail dashboard](https://app.agentemail.co/api-keys).
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
import os
|
|
90
|
+
from agentemail import AgentemailApi
|
|
91
|
+
|
|
92
|
+
client = AgentemailApi(api_key=os.environ["AGENTEMAIL_API_KEY"])
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## API Reference
|
|
96
|
+
|
|
97
|
+
### Inboxes
|
|
98
|
+
|
|
99
|
+
| Method | Description |
|
|
100
|
+
|--------|-------------|
|
|
101
|
+
| `client.sdk.list_inboxes()` | List all your inboxes (paginated) |
|
|
102
|
+
| `client.sdk.create_inbox(name=...)` | Create a new inbox |
|
|
103
|
+
|
|
104
|
+
### Emails & Threads
|
|
105
|
+
|
|
106
|
+
| Method | Description |
|
|
107
|
+
|--------|-------------|
|
|
108
|
+
| `client.sdk.list_threads(inbox_id=...)` | List email threads for an inbox |
|
|
109
|
+
| `client.sdk.get_thread(inbox_id=..., thread_id=...)` | Get a thread with all messages |
|
|
110
|
+
|
|
111
|
+
### Usage
|
|
112
|
+
|
|
113
|
+
| Method | Description |
|
|
114
|
+
|--------|-------------|
|
|
115
|
+
| `client.sdk.get_usage()` | Get current usage vs plan limits |
|
|
116
|
+
|
|
117
|
+
## Links
|
|
118
|
+
|
|
119
|
+
- [Documentation](https://agentemail.co/docs)
|
|
120
|
+
- [Dashboard](https://app.agentemail.co)
|
|
121
|
+
- [GitHub](https://github.com/mbaiswar/agentemailpy)
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|
README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# agentemail
|
|
2
|
+
|
|
3
|
+
Official Python SDK for the [AgentEmail](https://agentemail.co) API.
|
|
4
|
+
|
|
5
|
+
Create and manage email inboxes programmatically for your AI agents and applications.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install agentemail
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from agentemail import AgentemailApi
|
|
17
|
+
|
|
18
|
+
client = AgentemailApi(api_key="aem_your_api_key_here")
|
|
19
|
+
|
|
20
|
+
# List your inboxes
|
|
21
|
+
inboxes = client.sdk.list_inboxes()
|
|
22
|
+
print(inboxes.data)
|
|
23
|
+
|
|
24
|
+
# Create a new inbox
|
|
25
|
+
inbox = client.sdk.create_inbox(name="hello")
|
|
26
|
+
print(inbox.name) # "hello"
|
|
27
|
+
# Full address: hello@agentemail.co
|
|
28
|
+
|
|
29
|
+
# List email threads
|
|
30
|
+
threads = client.sdk.list_threads(inbox_id=inbox.id)
|
|
31
|
+
for thread in threads.data:
|
|
32
|
+
print(thread.subject, thread.message_count)
|
|
33
|
+
|
|
34
|
+
# Get a full thread with all messages
|
|
35
|
+
thread = client.sdk.get_thread(inbox_id=inbox.id, thread_id=threads.data[0].id)
|
|
36
|
+
for message in thread.messages:
|
|
37
|
+
print(message.from_address, message.body_text)
|
|
38
|
+
|
|
39
|
+
# Check usage vs plan limits
|
|
40
|
+
usage = client.sdk.get_usage()
|
|
41
|
+
print(f"Inboxes: {usage.inboxes.used}/{usage.inboxes.limit}")
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Async Usage
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import asyncio
|
|
48
|
+
from agentemail import AsyncAgentemailApi
|
|
49
|
+
|
|
50
|
+
async def main():
|
|
51
|
+
client = AsyncAgentemailApi(api_key="aem_your_api_key_here")
|
|
52
|
+
inboxes = await client.sdk.list_inboxes()
|
|
53
|
+
print(inboxes.data)
|
|
54
|
+
|
|
55
|
+
asyncio.run(main())
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Authentication
|
|
59
|
+
|
|
60
|
+
Generate an API key from your [AgentEmail dashboard](https://app.agentemail.co/api-keys).
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
import os
|
|
64
|
+
from agentemail import AgentemailApi
|
|
65
|
+
|
|
66
|
+
client = AgentemailApi(api_key=os.environ["AGENTEMAIL_API_KEY"])
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## API Reference
|
|
70
|
+
|
|
71
|
+
### Inboxes
|
|
72
|
+
|
|
73
|
+
| Method | Description |
|
|
74
|
+
|--------|-------------|
|
|
75
|
+
| `client.sdk.list_inboxes()` | List all your inboxes (paginated) |
|
|
76
|
+
| `client.sdk.create_inbox(name=...)` | Create a new inbox |
|
|
77
|
+
|
|
78
|
+
### Emails & Threads
|
|
79
|
+
|
|
80
|
+
| Method | Description |
|
|
81
|
+
|--------|-------------|
|
|
82
|
+
| `client.sdk.list_threads(inbox_id=...)` | List email threads for an inbox |
|
|
83
|
+
| `client.sdk.get_thread(inbox_id=..., thread_id=...)` | Get a thread with all messages |
|
|
84
|
+
|
|
85
|
+
### Usage
|
|
86
|
+
|
|
87
|
+
| Method | Description |
|
|
88
|
+
|--------|-------------|
|
|
89
|
+
| `client.sdk.get_usage()` | Get current usage vs plan limits |
|
|
90
|
+
|
|
91
|
+
## Links
|
|
92
|
+
|
|
93
|
+
- [Documentation](https://agentemail.co/docs)
|
|
94
|
+
- [Dashboard](https://app.agentemail.co)
|
|
95
|
+
- [GitHub](https://github.com/mbaiswar/agentemailpy)
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT
|
__init__.py
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
AttachmentResponse,
|
|
11
|
+
EmailDetail,
|
|
12
|
+
EmailDetailRawHeaders,
|
|
13
|
+
HttpValidationError,
|
|
14
|
+
InboxResponse,
|
|
15
|
+
PaginatedResponseInboxResponse,
|
|
16
|
+
PaginatedResponseThreadSummary,
|
|
17
|
+
ThreadDetail,
|
|
18
|
+
ThreadSummary,
|
|
19
|
+
ValidationError,
|
|
20
|
+
ValidationErrorLocItem,
|
|
21
|
+
)
|
|
22
|
+
from .errors import UnprocessableEntityError
|
|
23
|
+
from . import sdk
|
|
24
|
+
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
|
|
25
|
+
from .client import AgentemailApi, AsyncAgentemailApi
|
|
26
|
+
from .environment import AgentemailApiEnvironment
|
|
27
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
28
|
+
"AgentemailApi": ".client",
|
|
29
|
+
"AgentemailApiEnvironment": ".environment",
|
|
30
|
+
"AsyncAgentemailApi": ".client",
|
|
31
|
+
"AttachmentResponse": ".types",
|
|
32
|
+
"DefaultAioHttpClient": "._default_clients",
|
|
33
|
+
"DefaultAsyncHttpxClient": "._default_clients",
|
|
34
|
+
"EmailDetail": ".types",
|
|
35
|
+
"EmailDetailRawHeaders": ".types",
|
|
36
|
+
"HttpValidationError": ".types",
|
|
37
|
+
"InboxResponse": ".types",
|
|
38
|
+
"PaginatedResponseInboxResponse": ".types",
|
|
39
|
+
"PaginatedResponseThreadSummary": ".types",
|
|
40
|
+
"ThreadDetail": ".types",
|
|
41
|
+
"ThreadSummary": ".types",
|
|
42
|
+
"UnprocessableEntityError": ".errors",
|
|
43
|
+
"ValidationError": ".types",
|
|
44
|
+
"ValidationErrorLocItem": ".types",
|
|
45
|
+
"sdk": ".sdk",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
50
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
51
|
+
if module_name is None:
|
|
52
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
53
|
+
try:
|
|
54
|
+
module = import_module(module_name, __package__)
|
|
55
|
+
if module_name == f".{attr_name}":
|
|
56
|
+
return module
|
|
57
|
+
else:
|
|
58
|
+
return getattr(module, attr_name)
|
|
59
|
+
except ImportError as e:
|
|
60
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
61
|
+
except AttributeError as e:
|
|
62
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def __dir__():
|
|
66
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
67
|
+
return sorted(lazy_attrs)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
__all__ = [
|
|
71
|
+
"AgentemailApi",
|
|
72
|
+
"AgentemailApiEnvironment",
|
|
73
|
+
"AsyncAgentemailApi",
|
|
74
|
+
"AttachmentResponse",
|
|
75
|
+
"DefaultAioHttpClient",
|
|
76
|
+
"DefaultAsyncHttpxClient",
|
|
77
|
+
"EmailDetail",
|
|
78
|
+
"EmailDetailRawHeaders",
|
|
79
|
+
"HttpValidationError",
|
|
80
|
+
"InboxResponse",
|
|
81
|
+
"PaginatedResponseInboxResponse",
|
|
82
|
+
"PaginatedResponseThreadSummary",
|
|
83
|
+
"ThreadDetail",
|
|
84
|
+
"ThreadSummary",
|
|
85
|
+
"UnprocessableEntityError",
|
|
86
|
+
"ValidationError",
|
|
87
|
+
"ValidationErrorLocItem",
|
|
88
|
+
"sdk",
|
|
89
|
+
]
|
_default_clients.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
SDK_DEFAULT_TIMEOUT = 60
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import httpx_aiohttp # type: ignore[import-not-found]
|
|
11
|
+
except ImportError:
|
|
12
|
+
|
|
13
|
+
class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
|
|
14
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
15
|
+
raise RuntimeError("To use the aiohttp client, install the aiohttp extra: pip install agentemail[aiohttp]")
|
|
16
|
+
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
|
|
20
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
21
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
22
|
+
kwargs.setdefault("follow_redirects", True)
|
|
23
|
+
super().__init__(**kwargs)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class DefaultAsyncHttpxClient(httpx.AsyncClient):
|
|
27
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
28
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
29
|
+
kwargs.setdefault("follow_redirects", True)
|
|
30
|
+
super().__init__(**kwargs)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentemail
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Python SDK for the AgentEmail API — create and manage email inboxes programmatically.
|
|
5
|
+
Project-URL: Homepage, https://agentemail.co
|
|
6
|
+
Project-URL: Documentation, https://agentemail.co/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/mbaiswar/agentemailpy
|
|
8
|
+
Author-email: AgentEmail <support@agentemail.co>
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: agentemail,api,email,inbox,sdk
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
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
|
+
Classifier: Topic :: Communications :: Email
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Requires-Dist: httpx>=0.21.2
|
|
24
|
+
Requires-Dist: pydantic>=1.9.2
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# agentemail
|
|
28
|
+
|
|
29
|
+
Official Python SDK for the [AgentEmail](https://agentemail.co) API.
|
|
30
|
+
|
|
31
|
+
Create and manage email inboxes programmatically for your AI agents and applications.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install agentemail
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from agentemail import AgentemailApi
|
|
43
|
+
|
|
44
|
+
client = AgentemailApi(api_key="aem_your_api_key_here")
|
|
45
|
+
|
|
46
|
+
# List your inboxes
|
|
47
|
+
inboxes = client.sdk.list_inboxes()
|
|
48
|
+
print(inboxes.data)
|
|
49
|
+
|
|
50
|
+
# Create a new inbox
|
|
51
|
+
inbox = client.sdk.create_inbox(name="hello")
|
|
52
|
+
print(inbox.name) # "hello"
|
|
53
|
+
# Full address: hello@agentemail.co
|
|
54
|
+
|
|
55
|
+
# List email threads
|
|
56
|
+
threads = client.sdk.list_threads(inbox_id=inbox.id)
|
|
57
|
+
for thread in threads.data:
|
|
58
|
+
print(thread.subject, thread.message_count)
|
|
59
|
+
|
|
60
|
+
# Get a full thread with all messages
|
|
61
|
+
thread = client.sdk.get_thread(inbox_id=inbox.id, thread_id=threads.data[0].id)
|
|
62
|
+
for message in thread.messages:
|
|
63
|
+
print(message.from_address, message.body_text)
|
|
64
|
+
|
|
65
|
+
# Check usage vs plan limits
|
|
66
|
+
usage = client.sdk.get_usage()
|
|
67
|
+
print(f"Inboxes: {usage.inboxes.used}/{usage.inboxes.limit}")
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Async Usage
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import asyncio
|
|
74
|
+
from agentemail import AsyncAgentemailApi
|
|
75
|
+
|
|
76
|
+
async def main():
|
|
77
|
+
client = AsyncAgentemailApi(api_key="aem_your_api_key_here")
|
|
78
|
+
inboxes = await client.sdk.list_inboxes()
|
|
79
|
+
print(inboxes.data)
|
|
80
|
+
|
|
81
|
+
asyncio.run(main())
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Authentication
|
|
85
|
+
|
|
86
|
+
Generate an API key from your [AgentEmail dashboard](https://app.agentemail.co/api-keys).
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
import os
|
|
90
|
+
from agentemail import AgentemailApi
|
|
91
|
+
|
|
92
|
+
client = AgentemailApi(api_key=os.environ["AGENTEMAIL_API_KEY"])
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## API Reference
|
|
96
|
+
|
|
97
|
+
### Inboxes
|
|
98
|
+
|
|
99
|
+
| Method | Description |
|
|
100
|
+
|--------|-------------|
|
|
101
|
+
| `client.sdk.list_inboxes()` | List all your inboxes (paginated) |
|
|
102
|
+
| `client.sdk.create_inbox(name=...)` | Create a new inbox |
|
|
103
|
+
|
|
104
|
+
### Emails & Threads
|
|
105
|
+
|
|
106
|
+
| Method | Description |
|
|
107
|
+
|--------|-------------|
|
|
108
|
+
| `client.sdk.list_threads(inbox_id=...)` | List email threads for an inbox |
|
|
109
|
+
| `client.sdk.get_thread(inbox_id=..., thread_id=...)` | Get a thread with all messages |
|
|
110
|
+
|
|
111
|
+
### Usage
|
|
112
|
+
|
|
113
|
+
| Method | Description |
|
|
114
|
+
|--------|-------------|
|
|
115
|
+
| `client.sdk.get_usage()` | Get current usage vs plan limits |
|
|
116
|
+
|
|
117
|
+
## Links
|
|
118
|
+
|
|
119
|
+
- [Documentation](https://agentemail.co/docs)
|
|
120
|
+
- [Dashboard](https://app.agentemail.co)
|
|
121
|
+
- [GitHub](https://github.com/mbaiswar/agentemailpy)
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
./.gitignore,sha256=9tSe1Em2CY2Kc3eHwMnWYMWrYwzv8YWuAsZsIKoATgg,350
|
|
2
|
+
./PKG-INFO,sha256=cD_TtzwBMNUveFuM-Bj8xHETNq3MHDxdaHjV-eEmZIs,3392
|
|
3
|
+
./README.md,sha256=qOOw8FD7BRrYpnvTzEQqRfranQ-oYOp8r-mc9waMiD0,2281
|
|
4
|
+
./__init__.py,sha256=sn8h7xwsvICKYrLr7977hzMIXo738d1t0k8ZwNrAkAw,2747
|
|
5
|
+
./_default_clients.py,sha256=idR-vsPQpMkzVCrjDh-gKrh1jrB1J89DclQObxAC4NU,1006
|
|
6
|
+
./client.py,sha256=kKnHMwGHrIyS2Zo0iFyd6bQQFt-RYtPkTfuANjVHPMY,9271
|
|
7
|
+
./environment.py,sha256=isk5MOfUxNVGQWB9Z4-oV6xSfB3hgW-LNC6j7Tfr54A,167
|
|
8
|
+
./pyproject.toml,sha256=X1gZMJleKjEqxvnxPPeN6Iea2XcDLgKNtQ_Z90GvQBc,1399
|
|
9
|
+
./core/__init__.py,sha256=103ZnffsdqGZ7Y9uxirEu3sEhBGZxFdRy2HBjH15R2Y,4369
|
|
10
|
+
./core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
|
|
11
|
+
./core/client_wrapper.py,sha256=o8dF3vhXq05V_JhmUy0vv0fTYz_KVKyKltDheuNbgm4,4281
|
|
12
|
+
./core/datetime_utils.py,sha256=ubW9ID5Is8Mz-4y_VXUpaExmvmknYFP3nSI1fCo6e6s,2498
|
|
13
|
+
./core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
14
|
+
./core/force_multipart.py,sha256=cH981xLy0kZVKiZZkFoeUjgJ2Zuq7KXB2aRAnmHzRDc,477
|
|
15
|
+
./core/http_client.py,sha256=GGFHg_FVsnaYdKnULuEUXrE9YgD3nOkVV23ZATghnzM,31555
|
|
16
|
+
./core/http_response.py,sha256=-628gqtkXE8wozoeiJvgh6_HAFwPk7GPtERgO4Kaaq0,1437
|
|
17
|
+
./core/jsonable_encoder.py,sha256=TyA2STyLG19741sWjOltlDowfuNytu-dEfti9v4idfo,4329
|
|
18
|
+
./core/logging.py,sha256=_rzxS8Bps4VNxKgz-tk39Czs4oFFXB818bNS7-1ZQl4,3244
|
|
19
|
+
./core/parse_error.py,sha256=VqCFdcXqqqomql18zSkpYvj5Kx4yZciNXy4zg9ZIXno,1111
|
|
20
|
+
./core/pydantic_utilities.py,sha256=9RyuRyb2cuS_91lAKWf6t-brTBv_p_iaI3-bUZm-8qA,25915
|
|
21
|
+
./core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
|
|
22
|
+
./core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
|
|
23
|
+
./core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
|
|
24
|
+
./core/serialization.py,sha256=ECL3bvv_0i7U4uvPidZCNel--MUbA0iq0aGcNKi3kws,9818
|
|
25
|
+
./core/http_sse/__init__.py,sha256=vE7RxBmzIfV9SmFDw4YCuDN9DaPuJb3FAnoFDo7bqww,1350
|
|
26
|
+
./core/http_sse/_api.py,sha256=hnv9q6ii2gxUrAmpjZHwPrK58SAtUEkKj6tqX4r2qlM,5104
|
|
27
|
+
./core/http_sse/_decoders.py,sha256=tY3L5TZ0y-pgz0Lu1q8ro5Ljz43q4lYyuec73u9WfNw,1733
|
|
28
|
+
./core/http_sse/_exceptions.py,sha256=o8Tp-e8Lvmtn_5MVSYbkW9rVrpwFg5pnKbOcHfrHH14,127
|
|
29
|
+
./core/http_sse/_models.py,sha256=kKvCCm8e6gCilulJpiHv4f2OPVxo9CydLboEqMhplPI,397
|
|
30
|
+
./errors/__init__.py,sha256=4g1JPPnrPS-pG-WGU1S8HrYE5RoctStcA35abyL_tmI,1134
|
|
31
|
+
./errors/unprocessable_entity_error.py,sha256=aDgvUf-6k1fSUL-OxI3MgOIFQNssTUNpv5vW9M4vfRc,401
|
|
32
|
+
./sdk/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
33
|
+
./sdk/client.py,sha256=6Ppp42YPWQiZl19ka-Zn0b09ox4MLGA1yR_A5qMDxrk,12636
|
|
34
|
+
./sdk/raw_client.py,sha256=xEqRxLNhhOvWJe708VIpR8K1N8DCUBfDId7ZNIxKQic,24120
|
|
35
|
+
./types/__init__.py,sha256=ZVtuRRTAcfF7_7DS_LW-HYsbWweRkeZEXYx0DyU9SLI,2484
|
|
36
|
+
./types/attachment_response.py,sha256=-0uyBJu3prgPn081GWizMuNuDK7XBnvWXQlehEYe8b4,780
|
|
37
|
+
./types/email_detail.py,sha256=AVP7hByDy6OFgxQEBVSV1VCucbEyServ-kkGu4kFKes,1108
|
|
38
|
+
./types/email_detail_raw_headers.py,sha256=uXCYmq5FWsasetvYoipOXvdyi_fGfirx0wwdAVc2nD0,152
|
|
39
|
+
./types/http_validation_error.py,sha256=NNTK9AbbHXm0n9m1YcsG5zEaSn1n6RghohUX5R8LGzw,623
|
|
40
|
+
./types/inbox_response.py,sha256=JuhC0QsIQblxuApPm-sb9k7rfEnudevCWVTtXqechmo,661
|
|
41
|
+
./types/paginated_response_inbox_response.py,sha256=bqbPpmUJfLyWQJ96prM0-O1n8emurBOJnGG_3N49Xus,667
|
|
42
|
+
./types/paginated_response_thread_summary.py,sha256=SPoT8a96QJwWfr6_Ot6b4YPfeg0oVMYIV1I5y89ywio,667
|
|
43
|
+
./types/thread_detail.py,sha256=N-15YktGh23mnLjAgAwY6-uI7xt5JMZ9YcNUL4fqhQA,941
|
|
44
|
+
./types/thread_summary.py,sha256=6v6Oqw2HuyZ9n6-B7AyYoiVXERWdqZlQ01MVZ7l-V_g,851
|
|
45
|
+
./types/validation_error.py,sha256=JoDDqrVlWl-jgFM5E2Z5z9hjFgU0jzYsLqQMoNuLB6o,750
|
|
46
|
+
./types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
|
47
|
+
agentemail-0.1.0.dist-info/METADATA,sha256=cD_TtzwBMNUveFuM-Bj8xHETNq3MHDxdaHjV-eEmZIs,3392
|
|
48
|
+
agentemail-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
49
|
+
agentemail-0.1.0.dist-info/RECORD,,
|