profound 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.

Potentially problematic release.


This version of profound might be problematic. Click here for more details.

Files changed (66) hide show
  1. profound/__init__.py +102 -0
  2. profound/_base_client.py +1995 -0
  3. profound/_client.py +448 -0
  4. profound/_compat.py +219 -0
  5. profound/_constants.py +14 -0
  6. profound/_exceptions.py +108 -0
  7. profound/_files.py +123 -0
  8. profound/_models.py +835 -0
  9. profound/_qs.py +150 -0
  10. profound/_resource.py +43 -0
  11. profound/_response.py +830 -0
  12. profound/_streaming.py +333 -0
  13. profound/_types.py +260 -0
  14. profound/_utils/__init__.py +64 -0
  15. profound/_utils/_compat.py +45 -0
  16. profound/_utils/_datetime_parse.py +136 -0
  17. profound/_utils/_logs.py +25 -0
  18. profound/_utils/_proxy.py +65 -0
  19. profound/_utils/_reflection.py +42 -0
  20. profound/_utils/_resources_proxy.py +24 -0
  21. profound/_utils/_streams.py +12 -0
  22. profound/_utils/_sync.py +86 -0
  23. profound/_utils/_transform.py +457 -0
  24. profound/_utils/_typing.py +156 -0
  25. profound/_utils/_utils.py +421 -0
  26. profound/_version.py +4 -0
  27. profound/lib/.keep +4 -0
  28. profound/py.typed +0 -0
  29. profound/resources/__init__.py +61 -0
  30. profound/resources/logs/__init__.py +33 -0
  31. profound/resources/logs/logs.py +102 -0
  32. profound/resources/logs/raw.py +511 -0
  33. profound/resources/organizations/__init__.py +33 -0
  34. profound/resources/organizations/categories.py +372 -0
  35. profound/resources/organizations/organizations.py +269 -0
  36. profound/resources/prompts.py +201 -0
  37. profound/resources/reports.py +609 -0
  38. profound/types/__init__.py +17 -0
  39. profound/types/info.py +13 -0
  40. profound/types/logs/__init__.py +8 -0
  41. profound/types/logs/raw_bots_params.py +111 -0
  42. profound/types/logs/raw_bots_response.py +45 -0
  43. profound/types/logs/raw_logs_params.py +99 -0
  44. profound/types/logs/raw_logs_response.py +39 -0
  45. profound/types/organization_domains_response.py +20 -0
  46. profound/types/organization_models_response.py +10 -0
  47. profound/types/organization_regions_response.py +10 -0
  48. profound/types/organizations/__init__.py +9 -0
  49. profound/types/organizations/category_list_response.py +10 -0
  50. profound/types/organizations/category_prompts_response.py +31 -0
  51. profound/types/organizations/category_tags_response.py +10 -0
  52. profound/types/organizations/category_topics_response.py +10 -0
  53. profound/types/organizations/org_item.py +11 -0
  54. profound/types/pagination_param.py +15 -0
  55. profound/types/prompt_answers_params.py +82 -0
  56. profound/types/prompt_answers_response.py +44 -0
  57. profound/types/report_citations_params.py +83 -0
  58. profound/types/report_citations_response.py +16 -0
  59. profound/types/report_sentiment_params.py +83 -0
  60. profound/types/report_visibility_params.py +83 -0
  61. profound/types/response.py +16 -0
  62. profound/types/result.py +13 -0
  63. profound-0.1.0.dist-info/METADATA +415 -0
  64. profound-0.1.0.dist-info/RECORD +66 -0
  65. profound-0.1.0.dist-info/WHEEL +4 -0
  66. profound-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,83 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, List, Union, Iterable
6
+ from datetime import datetime
7
+ from typing_extensions import Literal, Required, Annotated, TypedDict
8
+
9
+ from .._types import SequenceNotStr
10
+ from .._utils import PropertyInfo
11
+ from .pagination_param import PaginationParam
12
+
13
+ __all__ = ["ReportSentimentParams", "Filter"]
14
+
15
+
16
+ class ReportSentimentParams(TypedDict, total=False):
17
+ category_id: Required[str]
18
+
19
+ end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
20
+ """End date for the report.
21
+
22
+ Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full ISO timestamp.
23
+ """
24
+
25
+ metrics: Required[List[Literal["positive", "negative"]]]
26
+
27
+ start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
28
+ """Start date for the report.
29
+
30
+ Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full ISO timestamp.
31
+ """
32
+
33
+ date_interval: Literal["day", "week", "month", "year"]
34
+ """Date interval for the report. (only used with date dimension)"""
35
+
36
+ dimensions: List[Literal["theme", "date", "region", "topic", "model", "asset_name", "tag"]]
37
+ """Dimensions to group the report by."""
38
+
39
+ filters: Iterable[Filter]
40
+ """List of filters to apply to the report.
41
+
42
+ Each filter has an operator, field, and value.
43
+ """
44
+
45
+ order_by: Dict[str, Literal["asc", "desc"]]
46
+ """Custom ordering of the report results.
47
+
48
+ The order is a record of key-value pairs where:
49
+
50
+ - key is the field to order by, which can be a metric or dimension
51
+ - value is the direction of the order, either 'asc' for ascending or 'desc' for
52
+ descending.
53
+
54
+ When not specified, the default order is the first metric in the query
55
+ descending.
56
+ """
57
+
58
+ pagination: PaginationParam
59
+ """Pagination settings for the report results."""
60
+
61
+
62
+ class Filter(TypedDict, total=False):
63
+ field: Required[Literal["asset_name", "theme", "region", "topic", "model", "tag"]]
64
+
65
+ operator: Required[
66
+ Literal[
67
+ "is",
68
+ "not_is",
69
+ "in",
70
+ "not_in",
71
+ "contains",
72
+ "not_contains",
73
+ "contains_case_insensitive",
74
+ "not_contains_case_insensitive",
75
+ "matches",
76
+ ]
77
+ ]
78
+
79
+ value: Required[Union[str, SequenceNotStr[str], int, Iterable[int]]]
80
+ """Value for the filter.
81
+
82
+ Can be a single value or a list of depending on the operator.
83
+ """
@@ -0,0 +1,83 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, List, Union, Iterable
6
+ from datetime import datetime
7
+ from typing_extensions import Literal, Required, Annotated, TypedDict
8
+
9
+ from .._types import SequenceNotStr
10
+ from .._utils import PropertyInfo
11
+ from .pagination_param import PaginationParam
12
+
13
+ __all__ = ["ReportVisibilityParams", "Filter"]
14
+
15
+
16
+ class ReportVisibilityParams(TypedDict, total=False):
17
+ category_id: Required[str]
18
+
19
+ end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
20
+ """End date for the report.
21
+
22
+ Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full ISO timestamp.
23
+ """
24
+
25
+ metrics: Required[List[Literal["share_of_voice", "mentions_count", "visibility_score"]]]
26
+
27
+ start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
28
+ """Start date for the report.
29
+
30
+ Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full ISO timestamp.
31
+ """
32
+
33
+ date_interval: Literal["day", "week", "month", "year"]
34
+ """Date interval for the report. (only used with date dimension)"""
35
+
36
+ dimensions: List[Literal["date", "region", "topic", "model", "asset_name", "prompt", "tag"]]
37
+ """Dimensions to group the report by."""
38
+
39
+ filters: Iterable[Filter]
40
+ """List of filters to apply to the report.
41
+
42
+ Each filter has an operator, field, and value.
43
+ """
44
+
45
+ order_by: Dict[str, Literal["asc", "desc"]]
46
+ """Custom ordering of the report results.
47
+
48
+ The order is a record of key-value pairs where:
49
+
50
+ - key is the field to order by, which can be a metric or dimension
51
+ - value is the direction of the order, either 'asc' for ascending or 'desc' for
52
+ descending.
53
+
54
+ When not specified, the default order is the first metric in the query
55
+ descending.
56
+ """
57
+
58
+ pagination: PaginationParam
59
+ """Pagination settings for the report results."""
60
+
61
+
62
+ class Filter(TypedDict, total=False):
63
+ field: Required[Literal["region", "topic", "model", "asset_name", "prompt", "tag"]]
64
+
65
+ operator: Required[
66
+ Literal[
67
+ "is",
68
+ "not_is",
69
+ "in",
70
+ "not_in",
71
+ "contains",
72
+ "not_contains",
73
+ "contains_case_insensitive",
74
+ "not_contains_case_insensitive",
75
+ "matches",
76
+ ]
77
+ ]
78
+
79
+ value: Required[Union[str, SequenceNotStr[str], int, Iterable[int]]]
80
+ """Value for the filter.
81
+
82
+ Can be a single value or a list of depending on the operator.
83
+ """
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from .info import Info
6
+ from .result import Result
7
+ from .._models import BaseModel
8
+
9
+ __all__ = ["Response"]
10
+
11
+
12
+ class Response(BaseModel):
13
+ data: List[Result]
14
+
15
+ info: Info
16
+ """Base model for report information."""
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["Result"]
8
+
9
+
10
+ class Result(BaseModel):
11
+ dimensions: List[str]
12
+
13
+ metrics: List[float]
@@ -0,0 +1,415 @@
1
+ Metadata-Version: 2.3
2
+ Name: profound
3
+ Version: 0.1.0
4
+ Summary: The official Python library for the profound API
5
+ Project-URL: Homepage, https://github.com/cooper-square-technologies/profound-python-sdk
6
+ Project-URL: Repository, https://github.com/cooper-square-technologies/profound-python-sdk
7
+ Author-email: Profound <support@tryprofound.com>
8
+ License: Apache-2.0
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Operating System :: MacOS
12
+ Classifier: Operating System :: Microsoft :: Windows
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Operating System :: POSIX
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.8
25
+ Requires-Dist: anyio<5,>=3.5.0
26
+ Requires-Dist: distro<2,>=1.7.0
27
+ Requires-Dist: httpx<1,>=0.23.0
28
+ Requires-Dist: pydantic<3,>=1.9.0
29
+ Requires-Dist: sniffio
30
+ Requires-Dist: typing-extensions<5,>=4.10
31
+ Provides-Extra: aiohttp
32
+ Requires-Dist: aiohttp; extra == 'aiohttp'
33
+ Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # Profound Python API library
37
+
38
+ <!-- prettier-ignore -->
39
+ [![PyPI version](https://img.shields.io/pypi/v/profound.svg?label=pypi%20(stable))](https://pypi.org/project/profound/)
40
+
41
+ The Profound Python library provides convenient access to the Profound REST API from any Python 3.8+
42
+ application. The library includes type definitions for all request params and response fields,
43
+ and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
44
+
45
+ It is generated with [Stainless](https://www.stainless.com/).
46
+
47
+ ## Documentation
48
+
49
+ The REST API documentation can be found on [docs.tryprofound.com](https://docs.tryprofound.com). The full API of this library can be found in [api.md](https://github.com/cooper-square-technologies/profound-python-sdk/tree/main/api.md).
50
+
51
+ ## Installation
52
+
53
+ ```sh
54
+ # install from PyPI
55
+ pip install profound
56
+ ```
57
+
58
+ ## Usage
59
+
60
+ The full API of this library can be found in [api.md](https://github.com/cooper-square-technologies/profound-python-sdk/tree/main/api.md).
61
+
62
+ ```python
63
+ import os
64
+ from profound import Profound
65
+
66
+ client = Profound(
67
+ api_key=os.environ.get("PROFOUND_API_KEY"), # This is the default and can be omitted
68
+ )
69
+
70
+ org_items = client.organizations.categories.list()
71
+ ```
72
+
73
+ While you can provide an `api_key` keyword argument,
74
+ we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
75
+ to add `PROFOUND_API_KEY="My API Key"` to your `.env` file
76
+ so that your API Key is not stored in source control.
77
+
78
+ ## Async usage
79
+
80
+ Simply import `AsyncProfound` instead of `Profound` and use `await` with each API call:
81
+
82
+ ```python
83
+ import os
84
+ import asyncio
85
+ from profound import AsyncProfound
86
+
87
+ client = AsyncProfound(
88
+ api_key=os.environ.get("PROFOUND_API_KEY"), # This is the default and can be omitted
89
+ )
90
+
91
+
92
+ async def main() -> None:
93
+ org_items = await client.organizations.categories.list()
94
+
95
+
96
+ asyncio.run(main())
97
+ ```
98
+
99
+ Functionality between the synchronous and asynchronous clients is otherwise identical.
100
+
101
+ ### With aiohttp
102
+
103
+ By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
104
+
105
+ You can enable this by installing `aiohttp`:
106
+
107
+ ```sh
108
+ # install from PyPI
109
+ pip install profound[aiohttp]
110
+ ```
111
+
112
+ Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
113
+
114
+ ```python
115
+ import asyncio
116
+ from profound import DefaultAioHttpClient
117
+ from profound import AsyncProfound
118
+
119
+
120
+ async def main() -> None:
121
+ async with AsyncProfound(
122
+ api_key="My API Key",
123
+ http_client=DefaultAioHttpClient(),
124
+ ) as client:
125
+ org_items = await client.organizations.categories.list()
126
+
127
+
128
+ asyncio.run(main())
129
+ ```
130
+
131
+ ## Using types
132
+
133
+ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
134
+
135
+ - Serializing back into JSON, `model.to_json()`
136
+ - Converting to a dictionary, `model.to_dict()`
137
+
138
+ Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
139
+
140
+ from datetime import datetime
141
+
142
+ ## Nested params
143
+
144
+ Nested parameters are dictionaries, typed using `TypedDict`, for example:
145
+
146
+ ```python
147
+ from profound import Profound
148
+
149
+ client = Profound()
150
+
151
+ response = client.prompts.answers(
152
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
153
+ end_date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
154
+ start_date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
155
+ include={},
156
+ )
157
+ print(response.include)
158
+ ```
159
+
160
+ ## Handling errors
161
+
162
+ When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `profound.APIConnectionError` is raised.
163
+
164
+ When the API returns a non-success status code (that is, 4xx or 5xx
165
+ response), a subclass of `profound.APIStatusError` is raised, containing `status_code` and `response` properties.
166
+
167
+ All errors inherit from `profound.APIError`.
168
+
169
+ ```python
170
+ import profound
171
+ from profound import Profound
172
+
173
+ client = Profound()
174
+
175
+ try:
176
+ client.organizations.categories.list()
177
+ except profound.APIConnectionError as e:
178
+ print("The server could not be reached")
179
+ print(e.__cause__) # an underlying Exception, likely raised within httpx.
180
+ except profound.RateLimitError as e:
181
+ print("A 429 status code was received; we should back off a bit.")
182
+ except profound.APIStatusError as e:
183
+ print("Another non-200-range status code was received")
184
+ print(e.status_code)
185
+ print(e.response)
186
+ ```
187
+
188
+ Error codes are as follows:
189
+
190
+ | Status Code | Error Type |
191
+ | ----------- | -------------------------- |
192
+ | 400 | `BadRequestError` |
193
+ | 401 | `AuthenticationError` |
194
+ | 403 | `PermissionDeniedError` |
195
+ | 404 | `NotFoundError` |
196
+ | 422 | `UnprocessableEntityError` |
197
+ | 429 | `RateLimitError` |
198
+ | >=500 | `InternalServerError` |
199
+ | N/A | `APIConnectionError` |
200
+
201
+ ### Retries
202
+
203
+ Certain errors are automatically retried 2 times by default, with a short exponential backoff.
204
+ Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
205
+ 429 Rate Limit, and >=500 Internal errors are all retried by default.
206
+
207
+ You can use the `max_retries` option to configure or disable retry settings:
208
+
209
+ ```python
210
+ from profound import Profound
211
+
212
+ # Configure the default for all requests:
213
+ client = Profound(
214
+ # default is 2
215
+ max_retries=0,
216
+ )
217
+
218
+ # Or, configure per-request:
219
+ client.with_options(max_retries=5).organizations.categories.list()
220
+ ```
221
+
222
+ ### Timeouts
223
+
224
+ By default requests time out after 1 minute. You can configure this with a `timeout` option,
225
+ which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
226
+
227
+ ```python
228
+ from profound import Profound
229
+
230
+ # Configure the default for all requests:
231
+ client = Profound(
232
+ # 20 seconds (default is 1 minute)
233
+ timeout=20.0,
234
+ )
235
+
236
+ # More granular control:
237
+ client = Profound(
238
+ timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
239
+ )
240
+
241
+ # Override per-request:
242
+ client.with_options(timeout=5.0).organizations.categories.list()
243
+ ```
244
+
245
+ On timeout, an `APITimeoutError` is thrown.
246
+
247
+ Note that requests that time out are [retried twice by default](https://github.com/cooper-square-technologies/profound-python-sdk/tree/main/#retries).
248
+
249
+ ## Advanced
250
+
251
+ ### Logging
252
+
253
+ We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
254
+
255
+ You can enable logging by setting the environment variable `PROFOUND_LOG` to `info`.
256
+
257
+ ```shell
258
+ $ export PROFOUND_LOG=info
259
+ ```
260
+
261
+ Or to `debug` for more verbose logging.
262
+
263
+ ### How to tell whether `None` means `null` or missing
264
+
265
+ In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
266
+
267
+ ```py
268
+ if response.my_field is None:
269
+ if 'my_field' not in response.model_fields_set:
270
+ print('Got json like {}, without a "my_field" key present at all.')
271
+ else:
272
+ print('Got json like {"my_field": null}.')
273
+ ```
274
+
275
+ ### Accessing raw response data (e.g. headers)
276
+
277
+ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
278
+
279
+ ```py
280
+ from profound import Profound
281
+
282
+ client = Profound()
283
+ response = client.organizations.categories.with_raw_response.list()
284
+ print(response.headers.get('X-My-Header'))
285
+
286
+ category = response.parse() # get the object that `organizations.categories.list()` would have returned
287
+ print(category)
288
+ ```
289
+
290
+ These methods return an [`APIResponse`](https://github.com/cooper-square-technologies/profound-python-sdk/tree/main/src/profound/_response.py) object.
291
+
292
+ The async client returns an [`AsyncAPIResponse`](https://github.com/cooper-square-technologies/profound-python-sdk/tree/main/src/profound/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
293
+
294
+ #### `.with_streaming_response`
295
+
296
+ The above interface eagerly reads the full response body when you make the request, which may not always be what you want.
297
+
298
+ To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
299
+
300
+ ```python
301
+ with client.organizations.categories.with_streaming_response.list() as response:
302
+ print(response.headers.get("X-My-Header"))
303
+
304
+ for line in response.iter_lines():
305
+ print(line)
306
+ ```
307
+
308
+ The context manager is required so that the response will reliably be closed.
309
+
310
+ ### Making custom/undocumented requests
311
+
312
+ This library is typed for convenient access to the documented API.
313
+
314
+ If you need to access undocumented endpoints, params, or response properties, the library can still be used.
315
+
316
+ #### Undocumented endpoints
317
+
318
+ To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
319
+ http verbs. Options on the client will be respected (such as retries) when making this request.
320
+
321
+ ```py
322
+ import httpx
323
+
324
+ response = client.post(
325
+ "/foo",
326
+ cast_to=httpx.Response,
327
+ body={"my_param": True},
328
+ )
329
+
330
+ print(response.headers.get("x-foo"))
331
+ ```
332
+
333
+ #### Undocumented request params
334
+
335
+ If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
336
+ options.
337
+
338
+ #### Undocumented response properties
339
+
340
+ To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
341
+ can also get all the extra fields on the Pydantic model as a dict with
342
+ [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).
343
+
344
+ ### Configuring the HTTP client
345
+
346
+ You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
347
+
348
+ - Support for [proxies](https://www.python-httpx.org/advanced/proxies/)
349
+ - Custom [transports](https://www.python-httpx.org/advanced/transports/)
350
+ - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
351
+
352
+ ```python
353
+ import httpx
354
+ from profound import Profound, DefaultHttpxClient
355
+
356
+ client = Profound(
357
+ # Or use the `PROFOUND_BASE_URL` env var
358
+ base_url="http://my.test.server.example.com:8083",
359
+ http_client=DefaultHttpxClient(
360
+ proxy="http://my.test.proxy.example.com",
361
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
362
+ ),
363
+ )
364
+ ```
365
+
366
+ You can also customize the client on a per-request basis by using `with_options()`:
367
+
368
+ ```python
369
+ client.with_options(http_client=DefaultHttpxClient(...))
370
+ ```
371
+
372
+ ### Managing HTTP resources
373
+
374
+ By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
375
+
376
+ ```py
377
+ from profound import Profound
378
+
379
+ with Profound() as client:
380
+ # make requests here
381
+ ...
382
+
383
+ # HTTP client is now closed
384
+ ```
385
+
386
+ ## Versioning
387
+
388
+ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
389
+
390
+ 1. Changes that only affect static types, without breaking runtime behavior.
391
+ 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
392
+ 3. Changes that we do not expect to impact the vast majority of users in practice.
393
+
394
+ We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
395
+
396
+ We are keen for your feedback; please open an [issue](https://www.github.com/cooper-square-technologies/profound-python-sdk/issues) with questions, bugs, or suggestions.
397
+
398
+ ### Determining the installed version
399
+
400
+ If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.
401
+
402
+ You can determine the version that is being used at runtime with:
403
+
404
+ ```py
405
+ import profound
406
+ print(profound.__version__)
407
+ ```
408
+
409
+ ## Requirements
410
+
411
+ Python 3.8 or higher.
412
+
413
+ ## Contributing
414
+
415
+ See [the contributing documentation](https://github.com/cooper-square-technologies/profound-python-sdk/tree/main/./CONTRIBUTING.md).
@@ -0,0 +1,66 @@
1
+ profound/__init__.py,sha256=HRSN6HOLquGlgt_YTzCJPZEhmDZXsKybF1ZmQK8XKeY,2683
2
+ profound/_base_client.py,sha256=v8BLlCfQx4-sNQrC9d6CVsYAcXoS2INlkf-ng8f1R6w,67049
3
+ profound/_client.py,sha256=bP5cU_-8D-zMFJVR--PcGCOFE-M7Pa-FeRoRN1tW29U,17271
4
+ profound/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
5
+ profound/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
+ profound/_exceptions.py,sha256=Nuk1mF-xw9lC3BANLWQ_-trv2zh_pVAjJC7IgpPhLHY,3224
7
+ profound/_files.py,sha256=KnEzGi_O756MvKyJ4fOCW_u3JhOeWPQ4RsmDvqihDQU,3545
8
+ profound/_models.py,sha256=lKnskYPONAWDvWo8tmbbVk7HmG7UOsI0Nve0vSMmkRc,30452
9
+ profound/_qs.py,sha256=craIKyvPktJ94cvf9zn8j8ekG9dWJzhWv0ob34lIOv4,4828
10
+ profound/_resource.py,sha256=YhL4zPjSsRL1L5E5naES_gV6TkUELjzC6kVxaY0PdHw,1112
11
+ profound/_response.py,sha256=x5yzUWG_0y3G0zsq7LymfLwgqaQmwvOA5-JptD0VOyA,28800
12
+ profound/_streaming.py,sha256=lmBTdPkE-WAfFtBQgTYup0lycgeOMOKKILPflxXzomg,10108
13
+ profound/_types.py,sha256=lpu9B2IW_aKN4UH2Wy6tCjfci53t1MckP0ymxKwiWbY,7238
14
+ profound/_version.py,sha256=4dXdAUaE8IW-9vSKFrshPnl3OIP-rQUnt7duUC2gxuI,160
15
+ profound/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ profound/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
17
+ profound/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
18
+ profound/_utils/_datetime_parse.py,sha256=bABTs0Bc6rabdFvnIwXjEhWL15TcRgWZ_6XGTqN8xUk,4204
19
+ profound/_utils/_logs.py,sha256=4_G1ABqYXCFaodC9YULc79C47GbcjUMc_I624MVuS3g,780
20
+ profound/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
21
+ profound/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
22
+ profound/_utils/_resources_proxy.py,sha256=bOZZZCJLwy918_XS9Cog1nzur6KqWMiR44pI4wi-UrI,599
23
+ profound/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
24
+ profound/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
25
+ profound/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3ur9mcNF-E,15951
26
+ profound/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
27
+ profound/_utils/_utils.py,sha256=0dDqauUbVZEXV0NVl7Bwu904Wwo5eyFCZpQThhFNhyA,12253
28
+ profound/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
29
+ profound/resources/__init__.py,sha256=W12BGTFhkNpAkkWMKyAXrUuOf0IYrxInKvM8PQtEFIs,1993
30
+ profound/resources/prompts.py,sha256=IEP9hEoOCSnNBU4rH3Uaf7mtg1CHRNZRE4uK347_B9E,7532
31
+ profound/resources/reports.py,sha256=1sIdXeY5L6uGB5G4l4AzA84RTTOO18c3Fe3hTpS0Ms0,24329
32
+ profound/resources/logs/__init__.py,sha256=O6f6TO4gow2FymLgYAZIzT_thUVOIf0MNWKIoHbyo0Q,937
33
+ profound/resources/logs/logs.py,sha256=5ZJXn0glWvBhgW6vzba0b-0g_bKGssW1Lo2spM-mz3s,3528
34
+ profound/resources/logs/raw.py,sha256=BuF0lnvq8c0KmlSrU0eEdyuh2NxZHcmnYwEJ1u2sWO4,18967
35
+ profound/resources/organizations/__init__.py,sha256=emv6wKVQMAX4fIUAee0XkQDQzwvpnrAZHrv9WPhDLIA,1145
36
+ profound/resources/organizations/categories.py,sha256=gHwuYsuHMX-JzgOZFO-Eft_O7rdBiwJ_V0iCf3kdkC4,14540
37
+ profound/resources/organizations/organizations.py,sha256=4EbpHSaS_wU05HOgAi_YRwB7A-PfO-PuQ4RQzcbyMog,10852
38
+ profound/types/__init__.py,sha256=AgEMuLibHC28gMAFkPArFYogzov_Ba9UZJPGuaA_V9Q,1109
39
+ profound/types/info.py,sha256=gk6QqoZkF3dyDXQm94KFJG-3erH20FWigoXGvFkC6bc,266
40
+ profound/types/organization_domains_response.py,sha256=vpXf7RJnU8CoSbpeAgRzBPeDw7pVnr4LHOjsxdh17oc,478
41
+ profound/types/organization_models_response.py,sha256=7k8rbvmOA-iusEiTOfK7ZCC4d4BKBwDkKCUTjC3MCRM,293
42
+ profound/types/organization_regions_response.py,sha256=3rQ20rxQs7qGuHVx8W5P6y1dGSM9Qds3vwCQLm6Xqpk,295
43
+ profound/types/pagination_param.py,sha256=fTWgT_I7UU4bjQtcIhIiovpl30rtlrFF1HbQhFnk0q0,415
44
+ profound/types/prompt_answers_params.py,sha256=AkOGZNxIJFYnBjYuguBilNpN98_iQ0EM6a7IqAfVTGs,1781
45
+ profound/types/prompt_answers_response.py,sha256=lxRsAz3uWn7NQUXh1oTYHahCFDa5DF66zy07iDfWiPc,870
46
+ profound/types/report_citations_params.py,sha256=gRv_JB3AsUXxAYLSYW5r_uGLJuWnfDvmt8m301fAu6E,2516
47
+ profound/types/report_citations_response.py,sha256=u4bP6dSC2Sc0wvuKaar574YVoWEsZ6oDgfj_SpXWN08,361
48
+ profound/types/report_sentiment_params.py,sha256=TW5Vi1JEUu--yT8SU6Ef4qVTAxDz0Z_ZWrIzph9BFKY,2519
49
+ profound/types/report_visibility_params.py,sha256=-aXMm5ingGONzMYvmdWy9Uz2RIdXfQCzHu5DU_EaUHs,2555
50
+ profound/types/response.py,sha256=k3dzezL1fpncuDy1CZFBvlxsrgefaxk3kZgSqrxaIcA,331
51
+ profound/types/result.py,sha256=2pcjIrdxRb61kSkC_BTnZyBKEVkly0rosW1lfsXyW-E,245
52
+ profound/types/logs/__init__.py,sha256=s00zfNR32tlguLjmtxhC_YcH8a1GVzhJEZOC6cYzr28,375
53
+ profound/types/logs/raw_bots_params.py,sha256=maP1yTmvI0ApgeVcszB6Z-YNvI58eZrk0KNuCyn0zW8,2919
54
+ profound/types/logs/raw_bots_response.py,sha256=MquVt4rN2wqj1UwPO0QIoglPt8xJgYkuSAVaykfiRyg,854
55
+ profound/types/logs/raw_logs_params.py,sha256=00RL8fcj16DoJOkJYe8yuB2jusHDcwUKHbF8sZZXfbY,2754
56
+ profound/types/logs/raw_logs_response.py,sha256=LPUtm0r6BubTTjiiqr37HcTNP8w5_BV9xh5RtcuLCHA,724
57
+ profound/types/organizations/__init__.py,sha256=feq64-7LJFh2pvyzJGJzAL-q8DG_KPkMC06dL5J-35g,503
58
+ profound/types/organizations/category_list_response.py,sha256=AvLmruxYC42Pn9ibXNiUah7idFW-tpn1HCBd399zkl4,267
59
+ profound/types/organizations/category_prompts_response.py,sha256=PZ1GaZUK8asTFGxDvOb4iM9VPeHGNRBES3Ly7XfycTc,549
60
+ profound/types/organizations/category_tags_response.py,sha256=Zqxq9O6iUr9WTSXC_T1eF15nbo0zJzu9L0SZW663Kas,267
61
+ profound/types/organizations/category_topics_response.py,sha256=6KXLR0dm3n5WfjxnmN4FGwI7sIUCnBZn9RYXtQ2e914,271
62
+ profound/types/organizations/org_item.py,sha256=UuDIT8tcWLjplrT9Fr37bz1MO-HCQB8Hxdtb4g6POl8,198
63
+ profound-0.1.0.dist-info/METADATA,sha256=uBoG6iZBKMf29GWKObdd75wn6rcht_qTBf3vk9oYmEA,14203
64
+ profound-0.1.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
65
+ profound-0.1.0.dist-info/licenses/LICENSE,sha256=mQrIrzZE8kr7w7NuHiw98Xz-EopSKzbT0MKGCsSRuPI,11338
66
+ profound-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.26.3
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any