Skip to content

Commit d193693

Browse files
fix: update organization name
1 parent d8b8e25 commit d193693

24 files changed

+387
-399
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Cleanlab Codex
189+
Copyright 2025 Cleanlab
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Cleanlab Codex Python API library
1+
# Cleanlab Python API library
22

33
[![PyPI version](https://img.shields.io/pypi/v/codex.svg)](https://pypi.org/project/codex/)
44

5-
The Cleanlab Codex Python library provides convenient access to the Cleanlab Codex REST API from any Python 3.8+
5+
The Cleanlab Python library provides convenient access to the Cleanlab REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,
77
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
88

@@ -27,9 +27,9 @@ pip install git+ssh://[email protected]/stainless-sdks/codex-python.git
2727
The full API of this library can be found in [api.md](api.md).
2828

2929
```python
30-
from codex import CleanlabCodex
30+
from codex import Cleanlab
3131

32-
client = CleanlabCodex(
32+
client = Cleanlab(
3333
# or 'production' | 'local'; defaults to "production".
3434
environment="staging",
3535
)
@@ -49,13 +49,13 @@ so that your Bearer Token is not stored in source control.
4949

5050
## Async usage
5151

52-
Simply import `AsyncCleanlabCodex` instead of `CleanlabCodex` and use `await` with each API call:
52+
Simply import `AsyncCleanlab` instead of `Cleanlab` and use `await` with each API call:
5353

5454
```python
5555
import asyncio
56-
from codex import AsyncCleanlabCodex
56+
from codex import AsyncCleanlab
5757

58-
client = AsyncCleanlabCodex(
58+
client = AsyncCleanlab(
5959
# or 'production' | 'local'; defaults to "production".
6060
environment="staging",
6161
)
@@ -95,9 +95,9 @@ All errors inherit from `codex.APIError`.
9595

9696
```python
9797
import codex
98-
from codex import CleanlabCodex
98+
from codex import Cleanlab
9999

100-
client = CleanlabCodex()
100+
client = Cleanlab()
101101

102102
try:
103103
client.projects.create(
@@ -138,10 +138,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
138138
You can use the `max_retries` option to configure or disable retry settings:
139139

140140
```python
141-
from codex import CleanlabCodex
141+
from codex import Cleanlab
142142

143143
# Configure the default for all requests:
144-
client = CleanlabCodex(
144+
client = Cleanlab(
145145
# default is 2
146146
max_retries=0,
147147
)
@@ -160,16 +160,16 @@ By default requests time out after 1 minute. You can configure this with a `time
160160
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
161161

162162
```python
163-
from codex import CleanlabCodex
163+
from codex import Cleanlab
164164

165165
# Configure the default for all requests:
166-
client = CleanlabCodex(
166+
client = Cleanlab(
167167
# 20 seconds (default is 1 minute)
168168
timeout=20.0,
169169
)
170170

171171
# More granular control:
172-
client = CleanlabCodex(
172+
client = Cleanlab(
173173
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
174174
)
175175

@@ -191,10 +191,10 @@ Note that requests that time out are [retried twice by default](#retries).
191191

192192
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
193193

194-
You can enable logging by setting the environment variable `CLEANLAB_CODEX_LOG` to `info`.
194+
You can enable logging by setting the environment variable `CLEANLAB_LOG` to `info`.
195195

196196
```shell
197-
$ export CLEANLAB_CODEX_LOG=info
197+
$ export CLEANLAB_LOG=info
198198
```
199199

200200
Or to `debug` for more verbose logging.
@@ -216,9 +216,9 @@ if response.my_field is None:
216216
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
217217

218218
```py
219-
from codex import CleanlabCodex
219+
from codex import Cleanlab
220220

221-
client = CleanlabCodex()
221+
client = Cleanlab()
222222
response = client.projects.with_raw_response.create(
223223
config={},
224224
name="name",
@@ -298,10 +298,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
298298

299299
```python
300300
import httpx
301-
from codex import CleanlabCodex, DefaultHttpxClient
301+
from codex import Cleanlab, DefaultHttpxClient
302302

303-
client = CleanlabCodex(
304-
# Or use the `CLEANLAB_CODEX_BASE_URL` env var
303+
client = Cleanlab(
304+
# Or use the `CLEANLAB_BASE_URL` env var
305305
base_url="http://my.test.server.example.com:8083",
306306
http_client=DefaultHttpxClient(
307307
proxy="http://my.test.proxy.example.com",
@@ -321,9 +321,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
321321
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.
322322

323323
```py
324-
from codex import CleanlabCodex
324+
from codex import Cleanlab
325325

326-
with CleanlabCodex() as client:
326+
with Cleanlab() as client:
327327
# make requests here
328328
...
329329

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Cleanlab Codex please follow the respective company's security reporting guidelines.
19+
or products provided by Cleanlab please follow the respective company's security reporting guidelines.
2020

21-
### Cleanlab Codex Terms and Policies
21+
### Cleanlab Terms and Policies
2222

2323
Please contact [email protected] for any questions or concerns regarding security of our services.
2424

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
22
name = "codex"
33
version = "0.0.1-alpha.0"
4-
description = "The official Python library for the Cleanlab Codex API"
4+
description = "The official Python library for the Cleanlab API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
77
authors = [
8-
{ name = "Cleanlab Codex", email = "[email protected]" },
8+
{ name = "Cleanlab", email = "[email protected]" },
99
]
1010
dependencies = [
1111
"httpx>=0.23.0, <1",

src/codex/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
Client,
99
Stream,
1010
Timeout,
11+
Cleanlab,
1112
Transport,
1213
AsyncClient,
1314
AsyncStream,
14-
CleanlabCodex,
15+
AsyncCleanlab,
1516
RequestOptions,
16-
AsyncCleanlabCodex,
1717
)
1818
from ._models import BaseModel
1919
from ._version import __title__, __version__
2020
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
2121
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
2222
from ._exceptions import (
2323
APIError,
24+
CleanlabError,
2425
ConflictError,
2526
NotFoundError,
2627
APIStatusError,
2728
RateLimitError,
2829
APITimeoutError,
2930
BadRequestError,
3031
APIConnectionError,
31-
CleanlabCodexError,
3232
AuthenticationError,
3333
InternalServerError,
3434
PermissionDeniedError,
@@ -48,7 +48,7 @@
4848
"NotGiven",
4949
"NOT_GIVEN",
5050
"Omit",
51-
"CleanlabCodexError",
51+
"CleanlabError",
5252
"APIError",
5353
"APIStatusError",
5454
"APITimeoutError",
@@ -68,8 +68,8 @@
6868
"AsyncClient",
6969
"Stream",
7070
"AsyncStream",
71-
"CleanlabCodex",
72-
"AsyncCleanlabCodex",
71+
"Cleanlab",
72+
"AsyncCleanlab",
7373
"ENVIRONMENTS",
7474
"file_from_path",
7575
"BaseModel",

src/codex/_client.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"Transport",
4444
"ProxiesTypes",
4545
"RequestOptions",
46-
"CleanlabCodex",
47-
"AsyncCleanlabCodex",
46+
"Cleanlab",
47+
"AsyncCleanlab",
4848
"Client",
4949
"AsyncClient",
5050
]
@@ -56,13 +56,13 @@
5656
}
5757

5858

59-
class CleanlabCodex(SyncAPIClient):
59+
class Cleanlab(SyncAPIClient):
6060
health: health.HealthResource
6161
organizations: organizations.OrganizationsResource
6262
users: users.UsersResource
6363
projects: projects.ProjectsResource
64-
with_raw_response: CleanlabCodexWithRawResponse
65-
with_streaming_response: CleanlabCodexWithStreamedResponse
64+
with_raw_response: CleanlabWithRawResponse
65+
with_streaming_response: CleanlabWithStreamedResponse
6666

6767
# client options
6868
bearer_token: str | None
@@ -97,7 +97,7 @@ def __init__(
9797
# part of our public interface in the future.
9898
_strict_response_validation: bool = False,
9999
) -> None:
100-
"""Construct a new synchronous Cleanlab Codex client instance.
100+
"""Construct a new synchronous Cleanlab client instance.
101101
102102
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
103103
- `bearer_token` from `BEARER_TOKEN`
@@ -118,14 +118,14 @@ def __init__(
118118

119119
self._environment = environment
120120

121-
base_url_env = os.environ.get("CLEANLAB_CODEX_BASE_URL")
121+
base_url_env = os.environ.get("CLEANLAB_BASE_URL")
122122
if is_given(base_url) and base_url is not None:
123123
# cast required because mypy doesn't understand the type narrowing
124124
base_url = cast("str | httpx.URL", base_url) # pyright: ignore[reportUnnecessaryCast]
125125
elif is_given(environment):
126126
if base_url_env and base_url is not None:
127127
raise ValueError(
128-
"Ambiguous URL; The `CLEANLAB_CODEX_BASE_URL` env var and the `environment` argument are given. If you want to use the environment, you must pass base_url=None",
128+
"Ambiguous URL; The `CLEANLAB_BASE_URL` env var and the `environment` argument are given. If you want to use the environment, you must pass base_url=None",
129129
)
130130

131131
try:
@@ -157,8 +157,8 @@ def __init__(
157157
self.organizations = organizations.OrganizationsResource(self)
158158
self.users = users.UsersResource(self)
159159
self.projects = projects.ProjectsResource(self)
160-
self.with_raw_response = CleanlabCodexWithRawResponse(self)
161-
self.with_streaming_response = CleanlabCodexWithStreamedResponse(self)
160+
self.with_raw_response = CleanlabWithRawResponse(self)
161+
self.with_streaming_response = CleanlabWithStreamedResponse(self)
162162

163163
@property
164164
@override
@@ -318,13 +318,13 @@ def _make_status_error(
318318
return APIStatusError(err_msg, response=response, body=body)
319319

320320

321-
class AsyncCleanlabCodex(AsyncAPIClient):
321+
class AsyncCleanlab(AsyncAPIClient):
322322
health: health.AsyncHealthResource
323323
organizations: organizations.AsyncOrganizationsResource
324324
users: users.AsyncUsersResource
325325
projects: projects.AsyncProjectsResource
326-
with_raw_response: AsyncCleanlabCodexWithRawResponse
327-
with_streaming_response: AsyncCleanlabCodexWithStreamedResponse
326+
with_raw_response: AsyncCleanlabWithRawResponse
327+
with_streaming_response: AsyncCleanlabWithStreamedResponse
328328

329329
# client options
330330
bearer_token: str | None
@@ -359,7 +359,7 @@ def __init__(
359359
# part of our public interface in the future.
360360
_strict_response_validation: bool = False,
361361
) -> None:
362-
"""Construct a new async Cleanlab Codex client instance.
362+
"""Construct a new async Cleanlab client instance.
363363
364364
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
365365
- `bearer_token` from `BEARER_TOKEN`
@@ -380,14 +380,14 @@ def __init__(
380380

381381
self._environment = environment
382382

383-
base_url_env = os.environ.get("CLEANLAB_CODEX_BASE_URL")
383+
base_url_env = os.environ.get("CLEANLAB_BASE_URL")
384384
if is_given(base_url) and base_url is not None:
385385
# cast required because mypy doesn't understand the type narrowing
386386
base_url = cast("str | httpx.URL", base_url) # pyright: ignore[reportUnnecessaryCast]
387387
elif is_given(environment):
388388
if base_url_env and base_url is not None:
389389
raise ValueError(
390-
"Ambiguous URL; The `CLEANLAB_CODEX_BASE_URL` env var and the `environment` argument are given. If you want to use the environment, you must pass base_url=None",
390+
"Ambiguous URL; The `CLEANLAB_BASE_URL` env var and the `environment` argument are given. If you want to use the environment, you must pass base_url=None",
391391
)
392392

393393
try:
@@ -419,8 +419,8 @@ def __init__(
419419
self.organizations = organizations.AsyncOrganizationsResource(self)
420420
self.users = users.AsyncUsersResource(self)
421421
self.projects = projects.AsyncProjectsResource(self)
422-
self.with_raw_response = AsyncCleanlabCodexWithRawResponse(self)
423-
self.with_streaming_response = AsyncCleanlabCodexWithStreamedResponse(self)
422+
self.with_raw_response = AsyncCleanlabWithRawResponse(self)
423+
self.with_streaming_response = AsyncCleanlabWithStreamedResponse(self)
424424

425425
@property
426426
@override
@@ -580,38 +580,38 @@ def _make_status_error(
580580
return APIStatusError(err_msg, response=response, body=body)
581581

582582

583-
class CleanlabCodexWithRawResponse:
584-
def __init__(self, client: CleanlabCodex) -> None:
583+
class CleanlabWithRawResponse:
584+
def __init__(self, client: Cleanlab) -> None:
585585
self.health = health.HealthResourceWithRawResponse(client.health)
586586
self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations)
587587
self.users = users.UsersResourceWithRawResponse(client.users)
588588
self.projects = projects.ProjectsResourceWithRawResponse(client.projects)
589589

590590

591-
class AsyncCleanlabCodexWithRawResponse:
592-
def __init__(self, client: AsyncCleanlabCodex) -> None:
591+
class AsyncCleanlabWithRawResponse:
592+
def __init__(self, client: AsyncCleanlab) -> None:
593593
self.health = health.AsyncHealthResourceWithRawResponse(client.health)
594594
self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations)
595595
self.users = users.AsyncUsersResourceWithRawResponse(client.users)
596596
self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects)
597597

598598

599-
class CleanlabCodexWithStreamedResponse:
600-
def __init__(self, client: CleanlabCodex) -> None:
599+
class CleanlabWithStreamedResponse:
600+
def __init__(self, client: Cleanlab) -> None:
601601
self.health = health.HealthResourceWithStreamingResponse(client.health)
602602
self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations)
603603
self.users = users.UsersResourceWithStreamingResponse(client.users)
604604
self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects)
605605

606606

607-
class AsyncCleanlabCodexWithStreamedResponse:
608-
def __init__(self, client: AsyncCleanlabCodex) -> None:
607+
class AsyncCleanlabWithStreamedResponse:
608+
def __init__(self, client: AsyncCleanlab) -> None:
609609
self.health = health.AsyncHealthResourceWithStreamingResponse(client.health)
610610
self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations)
611611
self.users = users.AsyncUsersResourceWithStreamingResponse(client.users)
612612
self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects)
613613

614614

615-
Client = CleanlabCodex
615+
Client = Cleanlab
616616

617-
AsyncClient = AsyncCleanlabCodex
617+
AsyncClient = AsyncCleanlab

0 commit comments

Comments
 (0)