planpoint-sdk 0.0.2__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 (69) hide show
  1. planpoint_sdk-0.0.2/PKG-INFO +173 -0
  2. planpoint_sdk-0.0.2/README.md +146 -0
  3. planpoint_sdk-0.0.2/pyproject.toml +58 -0
  4. planpoint_sdk-0.0.2/src/planpoint/__init__.py +89 -0
  5. planpoint_sdk-0.0.2/src/planpoint/authentication/__init__.py +2 -0
  6. planpoint_sdk-0.0.2/src/planpoint/authentication/client.py +280 -0
  7. planpoint_sdk-0.0.2/src/planpoint/client.py +160 -0
  8. planpoint_sdk-0.0.2/src/planpoint/core/__init__.py +46 -0
  9. planpoint_sdk-0.0.2/src/planpoint/core/api_error.py +15 -0
  10. planpoint_sdk-0.0.2/src/planpoint/core/client_wrapper.py +78 -0
  11. planpoint_sdk-0.0.2/src/planpoint/core/datetime_utils.py +28 -0
  12. planpoint_sdk-0.0.2/src/planpoint/core/file.py +43 -0
  13. planpoint_sdk-0.0.2/src/planpoint/core/http_client.py +477 -0
  14. planpoint_sdk-0.0.2/src/planpoint/core/jsonable_encoder.py +101 -0
  15. planpoint_sdk-0.0.2/src/planpoint/core/pydantic_utilities.py +208 -0
  16. planpoint_sdk-0.0.2/src/planpoint/core/query_encoder.py +58 -0
  17. planpoint_sdk-0.0.2/src/planpoint/core/remove_none_from_dict.py +11 -0
  18. planpoint_sdk-0.0.2/src/planpoint/core/request_options.py +32 -0
  19. planpoint_sdk-0.0.2/src/planpoint/core/serialization.py +170 -0
  20. planpoint_sdk-0.0.2/src/planpoint/environment.py +7 -0
  21. planpoint_sdk-0.0.2/src/planpoint/errors/__init__.py +17 -0
  22. planpoint_sdk-0.0.2/src/planpoint/errors/bad_request_error.py +9 -0
  23. planpoint_sdk-0.0.2/src/planpoint/errors/forbidden_error.py +9 -0
  24. planpoint_sdk-0.0.2/src/planpoint/errors/internal_server_error.py +9 -0
  25. planpoint_sdk-0.0.2/src/planpoint/errors/method_not_allowed_error.py +9 -0
  26. planpoint_sdk-0.0.2/src/planpoint/errors/not_found_error.py +9 -0
  27. planpoint_sdk-0.0.2/src/planpoint/errors/unauthorized_error.py +9 -0
  28. planpoint_sdk-0.0.2/src/planpoint/floors/__init__.py +5 -0
  29. planpoint_sdk-0.0.2/src/planpoint/floors/client.py +979 -0
  30. planpoint_sdk-0.0.2/src/planpoint/floors/types/__init__.py +5 -0
  31. planpoint_sdk-0.0.2/src/planpoint/floors/types/create_floor_body_project.py +19 -0
  32. planpoint_sdk-0.0.2/src/planpoint/groups/__init__.py +2 -0
  33. planpoint_sdk-0.0.2/src/planpoint/groups/client.py +953 -0
  34. planpoint_sdk-0.0.2/src/planpoint/leads/__init__.py +2 -0
  35. planpoint_sdk-0.0.2/src/planpoint/leads/client.py +251 -0
  36. planpoint_sdk-0.0.2/src/planpoint/projects/__init__.py +2 -0
  37. planpoint_sdk-0.0.2/src/planpoint/projects/client.py +931 -0
  38. planpoint_sdk-0.0.2/src/planpoint/py.typed +0 -0
  39. planpoint_sdk-0.0.2/src/planpoint/types/__init__.py +55 -0
  40. planpoint_sdk-0.0.2/src/planpoint/types/collection.py +21 -0
  41. planpoint_sdk-0.0.2/src/planpoint/types/commercial_space.py +24 -0
  42. planpoint_sdk-0.0.2/src/planpoint/types/commercial_space_status.py +5 -0
  43. planpoint_sdk-0.0.2/src/planpoint/types/error_response.py +20 -0
  44. planpoint_sdk-0.0.2/src/planpoint/types/floor.py +24 -0
  45. planpoint_sdk-0.0.2/src/planpoint/types/floor_full.py +26 -0
  46. planpoint_sdk-0.0.2/src/planpoint/types/group.py +30 -0
  47. planpoint_sdk-0.0.2/src/planpoint/types/group_project.py +23 -0
  48. planpoint_sdk-0.0.2/src/planpoint/types/groups_list_response.py +21 -0
  49. planpoint_sdk-0.0.2/src/planpoint/types/lead.py +25 -0
  50. planpoint_sdk-0.0.2/src/planpoint/types/login_response.py +20 -0
  51. planpoint_sdk-0.0.2/src/planpoint/types/project.py +62 -0
  52. planpoint_sdk-0.0.2/src/planpoint/types/project_custom_button_txt.py +27 -0
  53. planpoint_sdk-0.0.2/src/planpoint/types/project_internal_ur_ls.py +27 -0
  54. planpoint_sdk-0.0.2/src/planpoint/types/project_summary.py +27 -0
  55. planpoint_sdk-0.0.2/src/planpoint/types/unit.py +33 -0
  56. planpoint_sdk-0.0.2/src/planpoint/types/unit_full.py +31 -0
  57. planpoint_sdk-0.0.2/src/planpoint/types/unit_full_status.py +5 -0
  58. planpoint_sdk-0.0.2/src/planpoint/types/unit_model.py +21 -0
  59. planpoint_sdk-0.0.2/src/planpoint/types/unit_status.py +5 -0
  60. planpoint_sdk-0.0.2/src/planpoint/types/units_list_response.py +21 -0
  61. planpoint_sdk-0.0.2/src/planpoint/types/update_floor_body.py +5 -0
  62. planpoint_sdk-0.0.2/src/planpoint/types/update_group_body.py +5 -0
  63. planpoint_sdk-0.0.2/src/planpoint/types/update_project_body.py +5 -0
  64. planpoint_sdk-0.0.2/src/planpoint/types/update_unit_body.py +5 -0
  65. planpoint_sdk-0.0.2/src/planpoint/units/__init__.py +5 -0
  66. planpoint_sdk-0.0.2/src/planpoint/units/client.py +1398 -0
  67. planpoint_sdk-0.0.2/src/planpoint/units/types/__init__.py +5 -0
  68. planpoint_sdk-0.0.2/src/planpoint/units/types/create_unit_body_floor.py +19 -0
  69. planpoint_sdk-0.0.2/src/planpoint/version.py +3 -0
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.1
2
+ Name: planpoint-sdk
3
+ Version: 0.0.2
4
+ Summary:
5
+ Requires-Python: >=3.8,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: httpx (>=0.21.2)
22
+ Requires-Dist: pydantic (>=1.9.2)
23
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
24
+ Requires-Dist: typing_extensions (>=4.0.0)
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Planpoint Python Library
28
+
29
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Planpoint%2FPython)
30
+ [![pypi](https://img.shields.io/pypi/v/planpoint-sdk)](https://pypi.python.org/pypi/planpoint-sdk)
31
+
32
+ The Planpoint Python library provides convenient access to the Planpoint APIs from Python.
33
+
34
+ ## Table of Contents
35
+
36
+ - [Installation](#installation)
37
+ - [Usage](#usage)
38
+ - [Async Client](#async-client)
39
+ - [Exception Handling](#exception-handling)
40
+ - [Advanced](#advanced)
41
+ - [Retries](#retries)
42
+ - [Timeouts](#timeouts)
43
+ - [Custom Client](#custom-client)
44
+ - [Contributing](#contributing)
45
+
46
+ ## Installation
47
+
48
+ ```sh
49
+ pip install planpoint-sdk
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ Instantiate and use the client with the following:
55
+
56
+ ```python
57
+ from planpoint import PlanpointApi
58
+
59
+ client = PlanpointApi(
60
+ token="YOUR_TOKEN",
61
+ )
62
+ client.authentication.login(
63
+ username="user@example.com",
64
+ )
65
+ ```
66
+
67
+ ## Async Client
68
+
69
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API.
70
+
71
+ ```python
72
+ import asyncio
73
+
74
+ from planpoint import AsyncPlanpointApi
75
+
76
+ client = AsyncPlanpointApi(
77
+ token="YOUR_TOKEN",
78
+ )
79
+
80
+
81
+ async def main() -> None:
82
+ await client.authentication.login(
83
+ username="user@example.com",
84
+ )
85
+
86
+
87
+ asyncio.run(main())
88
+ ```
89
+
90
+ ## Exception Handling
91
+
92
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
93
+ will be thrown.
94
+
95
+ ```python
96
+ from planpoint.core.api_error import ApiError
97
+
98
+ try:
99
+ client.authentication.login(...)
100
+ except ApiError as e:
101
+ print(e.status_code)
102
+ print(e.body)
103
+ ```
104
+
105
+ ## Advanced
106
+
107
+ ### Retries
108
+
109
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
110
+ as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
111
+ retry limit (default: 2).
112
+
113
+ A request is deemed retriable when any of the following HTTP status codes is returned:
114
+
115
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
116
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
117
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
118
+
119
+ Use the `max_retries` request option to configure this behavior.
120
+
121
+ ```python
122
+ client.authentication.login(..., {
123
+ "max_retries": 1
124
+ })
125
+ ```
126
+
127
+ ### Timeouts
128
+
129
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
130
+
131
+ ```python
132
+
133
+ from planpoint import PlanpointApi
134
+
135
+ client = PlanpointApi(
136
+ ...,
137
+ timeout=20.0,
138
+ )
139
+
140
+
141
+ # Override timeout for a specific method
142
+ client.authentication.login(..., {
143
+ "timeout_in_seconds": 1
144
+ })
145
+ ```
146
+
147
+ ### Custom Client
148
+
149
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
150
+ and transports.
151
+ ```python
152
+ import httpx
153
+ from planpoint import PlanpointApi
154
+
155
+ client = PlanpointApi(
156
+ ...,
157
+ httpx_client=httpx.Client(
158
+ proxies="http://my.test.proxy.example.com",
159
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
160
+ ),
161
+ )
162
+ ```
163
+
164
+ ## Contributing
165
+
166
+ While we value open-source contributions to this SDK, this library is generated programmatically.
167
+ Additions made directly to this library would have to be moved over to our generation code,
168
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
169
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
170
+ an issue first to discuss with us!
171
+
172
+ On the other hand, contributions to the README are always very welcome!
173
+
@@ -0,0 +1,146 @@
1
+ # Planpoint Python Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Planpoint%2FPython)
4
+ [![pypi](https://img.shields.io/pypi/v/planpoint-sdk)](https://pypi.python.org/pypi/planpoint-sdk)
5
+
6
+ The Planpoint Python library provides convenient access to the Planpoint APIs from Python.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [Usage](#usage)
12
+ - [Async Client](#async-client)
13
+ - [Exception Handling](#exception-handling)
14
+ - [Advanced](#advanced)
15
+ - [Retries](#retries)
16
+ - [Timeouts](#timeouts)
17
+ - [Custom Client](#custom-client)
18
+ - [Contributing](#contributing)
19
+
20
+ ## Installation
21
+
22
+ ```sh
23
+ pip install planpoint-sdk
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ Instantiate and use the client with the following:
29
+
30
+ ```python
31
+ from planpoint import PlanpointApi
32
+
33
+ client = PlanpointApi(
34
+ token="YOUR_TOKEN",
35
+ )
36
+ client.authentication.login(
37
+ username="user@example.com",
38
+ )
39
+ ```
40
+
41
+ ## Async Client
42
+
43
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API.
44
+
45
+ ```python
46
+ import asyncio
47
+
48
+ from planpoint import AsyncPlanpointApi
49
+
50
+ client = AsyncPlanpointApi(
51
+ token="YOUR_TOKEN",
52
+ )
53
+
54
+
55
+ async def main() -> None:
56
+ await client.authentication.login(
57
+ username="user@example.com",
58
+ )
59
+
60
+
61
+ asyncio.run(main())
62
+ ```
63
+
64
+ ## Exception Handling
65
+
66
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
67
+ will be thrown.
68
+
69
+ ```python
70
+ from planpoint.core.api_error import ApiError
71
+
72
+ try:
73
+ client.authentication.login(...)
74
+ except ApiError as e:
75
+ print(e.status_code)
76
+ print(e.body)
77
+ ```
78
+
79
+ ## Advanced
80
+
81
+ ### Retries
82
+
83
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
84
+ as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
85
+ retry limit (default: 2).
86
+
87
+ A request is deemed retriable when any of the following HTTP status codes is returned:
88
+
89
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
90
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
91
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
92
+
93
+ Use the `max_retries` request option to configure this behavior.
94
+
95
+ ```python
96
+ client.authentication.login(..., {
97
+ "max_retries": 1
98
+ })
99
+ ```
100
+
101
+ ### Timeouts
102
+
103
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
104
+
105
+ ```python
106
+
107
+ from planpoint import PlanpointApi
108
+
109
+ client = PlanpointApi(
110
+ ...,
111
+ timeout=20.0,
112
+ )
113
+
114
+
115
+ # Override timeout for a specific method
116
+ client.authentication.login(..., {
117
+ "timeout_in_seconds": 1
118
+ })
119
+ ```
120
+
121
+ ### Custom Client
122
+
123
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
124
+ and transports.
125
+ ```python
126
+ import httpx
127
+ from planpoint import PlanpointApi
128
+
129
+ client = PlanpointApi(
130
+ ...,
131
+ httpx_client=httpx.Client(
132
+ proxies="http://my.test.proxy.example.com",
133
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
134
+ ),
135
+ )
136
+ ```
137
+
138
+ ## Contributing
139
+
140
+ While we value open-source contributions to this SDK, this library is generated programmatically.
141
+ Additions made directly to this library would have to be moved over to our generation code,
142
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
143
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
144
+ an issue first to discuss with us!
145
+
146
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,58 @@
1
+ [tool.poetry]
2
+ name = "planpoint-sdk"
3
+ version = "0.0.2"
4
+ description = ""
5
+ readme = "README.md"
6
+ authors = []
7
+ keywords = []
8
+
9
+ classifiers = [
10
+ "Intended Audience :: Developers",
11
+ "Programming Language :: Python",
12
+ "Programming Language :: Python :: 3",
13
+ "Programming Language :: Python :: 3.8",
14
+ "Programming Language :: Python :: 3.9",
15
+ "Programming Language :: Python :: 3.10",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "Operating System :: OS Independent",
19
+ "Operating System :: POSIX",
20
+ "Operating System :: MacOS",
21
+ "Operating System :: POSIX :: Linux",
22
+ "Operating System :: Microsoft :: Windows",
23
+ "Topic :: Software Development :: Libraries :: Python Modules",
24
+ "Typing :: Typed"
25
+ ]
26
+ packages = [
27
+ { include = "planpoint", from = "src"}
28
+ ]
29
+
30
+ [tool.poetry.dependencies]
31
+ python = "^3.8"
32
+ httpx = ">=0.21.2"
33
+ pydantic = ">= 1.9.2"
34
+ pydantic-core = "^2.18.2"
35
+ typing_extensions = ">= 4.0.0"
36
+
37
+ [tool.poetry.dev-dependencies]
38
+ mypy = "1.0.1"
39
+ pytest = "^7.4.0"
40
+ pytest-asyncio = "^0.23.5"
41
+ python-dateutil = "^2.9.0"
42
+ types-python-dateutil = "^2.9.0.20240316"
43
+ ruff = "^0.5.6"
44
+
45
+ [tool.pytest.ini_options]
46
+ testpaths = [ "tests" ]
47
+ asyncio_mode = "auto"
48
+
49
+ [tool.mypy]
50
+ plugins = ["pydantic.mypy"]
51
+
52
+ [tool.ruff]
53
+ line-length = 120
54
+
55
+
56
+ [build-system]
57
+ requires = ["poetry-core"]
58
+ build-backend = "poetry.core.masonry.api"
@@ -0,0 +1,89 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import (
4
+ Collection,
5
+ CommercialSpace,
6
+ CommercialSpaceStatus,
7
+ ErrorResponse,
8
+ Floor,
9
+ FloorFull,
10
+ Group,
11
+ GroupProject,
12
+ GroupsListResponse,
13
+ Lead,
14
+ LoginResponse,
15
+ Project,
16
+ ProjectCustomButtonTxt,
17
+ ProjectInternalUrLs,
18
+ ProjectSummary,
19
+ Unit,
20
+ UnitFull,
21
+ UnitFullStatus,
22
+ UnitModel,
23
+ UnitStatus,
24
+ UnitsListResponse,
25
+ UpdateFloorBody,
26
+ UpdateGroupBody,
27
+ UpdateProjectBody,
28
+ UpdateUnitBody,
29
+ )
30
+ from .errors import (
31
+ BadRequestError,
32
+ ForbiddenError,
33
+ InternalServerError,
34
+ MethodNotAllowedError,
35
+ NotFoundError,
36
+ UnauthorizedError,
37
+ )
38
+ from . import authentication, floors, groups, leads, projects, units
39
+ from .client import AsyncPlanpointApi, PlanpointApi
40
+ from .environment import PlanpointApiEnvironment
41
+ from .floors import CreateFloorBodyProject
42
+ from .units import CreateUnitBodyFloor
43
+ from .version import __version__
44
+
45
+ __all__ = [
46
+ "AsyncPlanpointApi",
47
+ "BadRequestError",
48
+ "Collection",
49
+ "CommercialSpace",
50
+ "CommercialSpaceStatus",
51
+ "CreateFloorBodyProject",
52
+ "CreateUnitBodyFloor",
53
+ "ErrorResponse",
54
+ "Floor",
55
+ "FloorFull",
56
+ "ForbiddenError",
57
+ "Group",
58
+ "GroupProject",
59
+ "GroupsListResponse",
60
+ "InternalServerError",
61
+ "Lead",
62
+ "LoginResponse",
63
+ "MethodNotAllowedError",
64
+ "NotFoundError",
65
+ "PlanpointApi",
66
+ "PlanpointApiEnvironment",
67
+ "Project",
68
+ "ProjectCustomButtonTxt",
69
+ "ProjectInternalUrLs",
70
+ "ProjectSummary",
71
+ "UnauthorizedError",
72
+ "Unit",
73
+ "UnitFull",
74
+ "UnitFullStatus",
75
+ "UnitModel",
76
+ "UnitStatus",
77
+ "UnitsListResponse",
78
+ "UpdateFloorBody",
79
+ "UpdateGroupBody",
80
+ "UpdateProjectBody",
81
+ "UpdateUnitBody",
82
+ "__version__",
83
+ "authentication",
84
+ "floors",
85
+ "groups",
86
+ "leads",
87
+ "projects",
88
+ "units",
89
+ ]
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+