exa-py 1.0.16__tar.gz → 1.0.17__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.

Potentially problematic release.


This version of exa-py might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: exa_py
3
- Version: 1.0.16
3
+ Version: 1.0.17
4
4
  Summary: Python SDK for Exa API.
5
5
  Home-page: https://github.com/exa-labs/exa-py
6
6
  Author: Exa
@@ -41,9 +41,9 @@ def snake_to_camel(snake_str: str) -> str:
41
41
  components = snake_str.split("_")
42
42
  return components[0] + "".join(x.title() for x in components[1:])
43
43
 
44
-
45
44
  def to_camel_case(data: dict) -> dict:
46
- """Convert keys in a dictionary from snake_case to camelCase.
45
+ """
46
+ Convert keys in a dictionary from snake_case to camelCase recursively.
47
47
 
48
48
  Args:
49
49
  data (dict): The dictionary with keys in snake_case format.
@@ -51,8 +51,11 @@ def to_camel_case(data: dict) -> dict:
51
51
  Returns:
52
52
  dict: The dictionary with keys converted to camelCase format.
53
53
  """
54
- return {snake_to_camel(k): v for k, v in data.items() if v is not None}
55
-
54
+ return {
55
+ snake_to_camel(k): to_camel_case(v) if isinstance(v, dict) else v
56
+ for k, v in data.items()
57
+ if v is not None
58
+ }
56
59
 
57
60
  def camel_to_snake(camel_str: str) -> str:
58
61
  """Convert camelCase string to snake_case.
@@ -66,9 +69,9 @@ def camel_to_snake(camel_str: str) -> str:
66
69
  snake_str = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", camel_str)
67
70
  return re.sub("([a-z0-9])([A-Z])", r"\1_\2", snake_str).lower()
68
71
 
69
-
70
72
  def to_snake_case(data: dict) -> dict:
71
- """Convert keys in a dictionary from camelCase to snake_case.
73
+ """
74
+ Convert keys in a dictionary from camelCase to snake_case recursively.
72
75
 
73
76
  Args:
74
77
  data (dict): The dictionary with keys in camelCase format.
@@ -76,8 +79,10 @@ def to_snake_case(data: dict) -> dict:
76
79
  Returns:
77
80
  dict: The dictionary with keys converted to snake_case format.
78
81
  """
79
- return {camel_to_snake(k): v for k, v in data.items()}
80
-
82
+ return {
83
+ camel_to_snake(k): to_snake_case(v) if isinstance(v, dict) else v
84
+ for k, v in data.items()
85
+ }
81
86
 
82
87
  SEARCH_OPTIONS_TYPES = {
83
88
  "query": [str], # The query string.
@@ -430,7 +435,7 @@ class Exa:
430
435
  self,
431
436
  api_key: Optional[str],
432
437
  base_url: str = "https://api.exa.ai",
433
- user_agent: str = "exa-py 1.0.16",
438
+ user_agent: str = "exa-py 1.0.17",
434
439
  ):
435
440
  """Initialize the Exa client with the provided API key and optional base URL and user agent.
436
441
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: exa-py
3
- Version: 1.0.16
3
+ Version: 1.0.17
4
4
  Summary: Python SDK for Exa API.
5
5
  Home-page: https://github.com/exa-labs/exa-py
6
6
  Author: Exa
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="exa_py",
5
- version="1.0.16",
5
+ version="1.0.17",
6
6
  description="Python SDK for Exa API.",
7
7
  long_description_content_type="text/markdown",
8
8
  long_description=open("README.md").read(),
File without changes
File without changes
File without changes
File without changes
File without changes