kscale 0.3.0__tar.gz → 0.3.1__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.
Files changed (43) hide show
  1. {kscale-0.3.0/kscale.egg-info → kscale-0.3.1}/PKG-INFO +1 -1
  2. {kscale-0.3.0 → kscale-0.3.1}/kscale/__init__.py +1 -1
  3. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/cli/robot_class.py +21 -1
  4. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/clients/robot_class.py +8 -0
  5. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/gen/api.py +7 -5
  6. {kscale-0.3.0 → kscale-0.3.1/kscale.egg-info}/PKG-INFO +1 -1
  7. {kscale-0.3.0 → kscale-0.3.1}/LICENSE +0 -0
  8. {kscale-0.3.0 → kscale-0.3.1}/MANIFEST.in +0 -0
  9. {kscale-0.3.0 → kscale-0.3.1}/README.md +0 -0
  10. {kscale-0.3.0 → kscale-0.3.1}/kscale/artifacts/__init__.py +0 -0
  11. {kscale-0.3.0 → kscale-0.3.1}/kscale/artifacts/plane.obj +0 -0
  12. {kscale-0.3.0 → kscale-0.3.1}/kscale/artifacts/plane.urdf +0 -0
  13. {kscale-0.3.0 → kscale-0.3.1}/kscale/cli.py +0 -0
  14. {kscale-0.3.0 → kscale-0.3.1}/kscale/conf.py +0 -0
  15. {kscale-0.3.0 → kscale-0.3.1}/kscale/py.typed +0 -0
  16. {kscale-0.3.0 → kscale-0.3.1}/kscale/requirements-dev.txt +0 -0
  17. {kscale-0.3.0 → kscale-0.3.1}/kscale/requirements.txt +0 -0
  18. {kscale-0.3.0 → kscale-0.3.1}/kscale/utils/__init__.py +0 -0
  19. {kscale-0.3.0 → kscale-0.3.1}/kscale/utils/api_base.py +0 -0
  20. {kscale-0.3.0 → kscale-0.3.1}/kscale/utils/checksum.py +0 -0
  21. {kscale-0.3.0 → kscale-0.3.1}/kscale/utils/cli.py +0 -0
  22. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/__init__.py +0 -0
  23. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/cli/__init__.py +0 -0
  24. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/cli/robot.py +0 -0
  25. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/cli/token.py +0 -0
  26. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/cli/user.py +0 -0
  27. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/clients/__init__.py +0 -0
  28. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/clients/base.py +0 -0
  29. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/clients/client.py +0 -0
  30. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/clients/robot.py +0 -0
  31. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/clients/user.py +0 -0
  32. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/gen/__init__.py +0 -0
  33. {kscale-0.3.0 → kscale-0.3.1}/kscale/web/utils.py +0 -0
  34. {kscale-0.3.0 → kscale-0.3.1}/kscale.egg-info/SOURCES.txt +0 -0
  35. {kscale-0.3.0 → kscale-0.3.1}/kscale.egg-info/dependency_links.txt +0 -0
  36. {kscale-0.3.0 → kscale-0.3.1}/kscale.egg-info/entry_points.txt +0 -0
  37. {kscale-0.3.0 → kscale-0.3.1}/kscale.egg-info/not-zip-safe +0 -0
  38. {kscale-0.3.0 → kscale-0.3.1}/kscale.egg-info/requires.txt +0 -0
  39. {kscale-0.3.0 → kscale-0.3.1}/kscale.egg-info/top_level.txt +0 -0
  40. {kscale-0.3.0 → kscale-0.3.1}/pyproject.toml +0 -0
  41. {kscale-0.3.0 → kscale-0.3.1}/setup.cfg +0 -0
  42. {kscale-0.3.0 → kscale-0.3.1}/setup.py +0 -0
  43. {kscale-0.3.0 → kscale-0.3.1}/tests/test_dummy.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: kscale
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: The kscale project
5
5
  Home-page: https://github.com/kscalelabs/kscale
6
6
  Author: Benjamin Bolte
@@ -1,6 +1,6 @@
1
1
  """Defines the common interface for the K-Scale Python API."""
2
2
 
3
- __version__ = "0.3.0"
3
+ __version__ = "0.3.1"
4
4
 
5
5
  from pathlib import Path
6
6
 
@@ -16,6 +16,11 @@ from kscale.web.gen.api import RobotURDFMetadataInput
16
16
  logger = logging.getLogger(__name__)
17
17
 
18
18
 
19
+ class RobotURDFMetadataInputStrict(RobotURDFMetadataInput):
20
+ class Config:
21
+ extra = "forbid"
22
+
23
+
19
24
  @click.group()
20
25
  def cli() -> None:
21
26
  """Get information about robot classes."""
@@ -83,7 +88,7 @@ async def update_metadata(name: str, json_path: str) -> None:
83
88
  """Updates the metadata of a robot class."""
84
89
  with open(json_path, "r", encoding="utf-8") as f:
85
90
  raw_metadata = json.load(f)
86
- metadata = RobotURDFMetadataInput.model_validate(raw_metadata)
91
+ metadata = RobotURDFMetadataInputStrict.model_validate(raw_metadata)
87
92
  async with RobotClassClient() as client:
88
93
  robot_class = await client.update_robot_class(name, new_metadata=metadata)
89
94
  click.echo("Robot class metadata updated:")
@@ -91,6 +96,21 @@ async def update_metadata(name: str, json_path: str) -> None:
91
96
  click.echo(f" Name: {click.style(robot_class.class_name, fg='green')}")
92
97
 
93
98
 
99
+ @cli.command()
100
+ @click.argument("name")
101
+ @click.option("--json-path", type=click.Path(exists=False))
102
+ @coro
103
+ async def get_metadata(name: str, json_path: str | None = None) -> None:
104
+ """Gets the metadata of a robot class."""
105
+ async with RobotClassClient() as client:
106
+ robot_class = await client.get_robot_class(name)
107
+ if json_path is None:
108
+ click.echo(robot_class.metadata.model_dump_json(indent=2))
109
+ else:
110
+ with open(json_path, "w", encoding="utf-8") as f:
111
+ json.dump(robot_class.model_dump(), f)
112
+
113
+
94
114
  @cli.command()
95
115
  @click.argument("name")
96
116
  @coro
@@ -35,6 +35,14 @@ class RobotClassClient(BaseClient):
35
35
  )
36
36
  return [RobotClass.model_validate(item) for item in data]
37
37
 
38
+ async def get_robot_class(self, class_name: str) -> RobotClass:
39
+ data = await self._request(
40
+ "GET",
41
+ f"/robots/name/{class_name}",
42
+ auth=True,
43
+ )
44
+ return RobotClass.model_validate(data)
45
+
38
46
  async def create_robot_class(self, class_name: str, description: str | None = None) -> RobotClass:
39
47
  data = {}
40
48
  if description is not None:
@@ -2,7 +2,7 @@
2
2
 
3
3
  # generated by datamodel-codegen:
4
4
  # filename: openapi.json
5
- # timestamp: 2025-01-21T07:10:22+00:00
5
+ # timestamp: 2025-01-22T04:20:37+00:00
6
6
 
7
7
  from __future__ import annotations
8
8
 
@@ -11,6 +11,10 @@ from typing import Dict, List, Optional, Union
11
11
  from pydantic import BaseModel, Field
12
12
 
13
13
 
14
+ class APIKeyRequest(BaseModel):
15
+ num_hours: Optional[int] = Field(24, title="Num Hours")
16
+
17
+
14
18
  class APIKeyResponse(BaseModel):
15
19
  api_key: str = Field(..., title="Api Key")
16
20
 
@@ -29,8 +33,7 @@ class JointMetadataInput(BaseModel):
29
33
  kp: Optional[Union[float, str]] = Field(None, title="Kp")
30
34
  kd: Optional[Union[float, str]] = Field(None, title="Kd")
31
35
  offset: Optional[Union[float, str]] = Field(None, title="Offset")
32
- lower_limit: Optional[Union[float, str]] = Field(None, title="Lower Limit")
33
- upper_limit: Optional[Union[float, str]] = Field(None, title="Upper Limit")
36
+ flipped: Optional[bool] = Field(None, title="Flipped")
34
37
 
35
38
 
36
39
  class JointMetadataOutput(BaseModel):
@@ -38,8 +41,7 @@ class JointMetadataOutput(BaseModel):
38
41
  kp: Optional[str] = Field(None, title="Kp")
39
42
  kd: Optional[str] = Field(None, title="Kd")
40
43
  offset: Optional[str] = Field(None, title="Offset")
41
- lower_limit: Optional[str] = Field(None, title="Lower Limit")
42
- upper_limit: Optional[str] = Field(None, title="Upper Limit")
44
+ flipped: Optional[bool] = Field(None, title="Flipped")
43
45
 
44
46
 
45
47
  class OICDInfo(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: kscale
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: The kscale project
5
5
  Home-page: https://github.com/kscalelabs/kscale
6
6
  Author: Benjamin Bolte
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes