anaplan-sdk 0.4.0a1__py3-none-any.whl → 0.4.0a2__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.
@@ -1,11 +1,7 @@
1
- import warnings
2
-
3
1
  import httpx
4
2
 
5
3
  from anaplan_sdk._base import _AsyncBaseClient
6
- from anaplan_sdk.models import ModelRevision, Revision, SyncTask, User
7
-
8
- warnings.filterwarnings("always", category=DeprecationWarning)
4
+ from anaplan_sdk.models import ModelRevision, Revision, SyncTask
9
5
 
10
6
 
11
7
  class _AsyncAlmClient(_AsyncBaseClient):
@@ -13,22 +9,6 @@ class _AsyncAlmClient(_AsyncBaseClient):
13
9
  self._url = f"https://api.anaplan.com/2/0/models/{model_id}/alm"
14
10
  super().__init__(retry_count, client)
15
11
 
16
- async def list_users(self) -> list[User]:
17
- """
18
- Lists all the Users in the authenticated users default tenant.
19
- :return: The List of Users.
20
- """
21
- warnings.warn(
22
- "`list_users()` on the ALM client is deprecated and will be removed in a "
23
- "future version. Use `list_users()` on the Audit client instead.",
24
- DeprecationWarning,
25
- stacklevel=1,
26
- )
27
- return [
28
- User.model_validate(e)
29
- for e in (await self._get("https://api.anaplan.com/2/0/users")).get("users")
30
- ]
31
-
32
12
  async def get_syncable_revisions(self, source_model_id: str) -> list[Revision]:
33
13
  """
34
14
  Use this call to return the list of revisions from your source model that can be
@@ -14,14 +14,21 @@ class _AsyncAuditClient(_AsyncBaseClient):
14
14
  self._url = "https://audit.anaplan.com/audit/api/1/events"
15
15
  super().__init__(retry_count, client)
16
16
 
17
- async def list_users(self) -> list[User]:
17
+ async def list_users(self, search_pattern: str | None = None) -> list[User]:
18
18
  """
19
19
  Lists all the Users in the authenticated users default tenant.
20
+ :param search_pattern: Optionally filter for specific users. When provided,
21
+ case-insensitive matches users with emails or names containing this string.
22
+ You can use the wildcards `%` for 0-n characters, and `_` for exactly 1 character.
23
+ When None (default), returns all users.
20
24
  :return: The List of Users.
21
25
  """
26
+ params = {"s": search_pattern} if search_pattern else None
22
27
  return [
23
28
  User.model_validate(e)
24
- for e in await self._get_paginated("https://api.anaplan.com/2/0/users", "users")
29
+ for e in await self._get_paginated(
30
+ "https://api.anaplan.com/2/0/users", "users", params=params
31
+ )
25
32
  ]
26
33
 
27
34
  async def get_user(self, user_id: str = "me") -> User:
@@ -219,29 +219,41 @@ class AsyncClient(_AsyncBaseClient):
219
219
  )
220
220
  return self._alm_client
221
221
 
222
- async def list_workspaces(self) -> list[Workspace]:
222
+ async def list_workspaces(self, search_pattern: str | None = None) -> list[Workspace]:
223
223
  """
224
224
  Lists all the Workspaces the authenticated user has access to.
225
+ :param search_pattern: Optionally filter for specific workspaces. When provided,
226
+ case-insensitive matches workspaces with names containing this string.
227
+ You can use the wildcards `%` for 0-n characters, and `_` for exactly 1 character.
228
+ When None (default), returns all users.
225
229
  :return: The List of Workspaces.
226
230
  """
231
+ params = {"tenantDetails": "true"}
232
+ if search_pattern:
233
+ params["s"] = search_pattern
227
234
  return [
228
235
  Workspace.model_validate(e)
229
236
  for e in await self._get_paginated(
230
- "https://api.anaplan.com/2/0/workspaces",
231
- "workspaces",
232
- params={"tenantDetails": "true"},
237
+ "https://api.anaplan.com/2/0/workspaces", "workspaces", params=params
233
238
  )
234
239
  ]
235
240
 
236
- async def list_models(self) -> list[Model]:
241
+ async def list_models(self, search_pattern: str | None = None) -> list[Model]:
237
242
  """
238
243
  Lists all the Models the authenticated user has access to.
244
+ :param search_pattern: Optionally filter for specific models. When provided,
245
+ case-insensitive matches models names containing this string.
246
+ You can use the wildcards `%` for 0-n characters, and `_` for exactly 1 character.
247
+ When None (default), returns all users.
239
248
  :return: The List of Models.
240
249
  """
250
+ params = {"modelDetails": "true"}
251
+ if search_pattern:
252
+ params["s"] = search_pattern
241
253
  return [
242
254
  Model.model_validate(e)
243
255
  for e in await self._get_paginated(
244
- "https://api.anaplan.com/2/0/models", "models", params={"modelDetails": "true"}
256
+ "https://api.anaplan.com/2/0/models", "models", params=params
245
257
  )
246
258
  ]
247
259
 
@@ -1,4 +1,3 @@
1
- import warnings
2
1
  from asyncio import gather
3
2
  from itertools import chain
4
3
  from typing import Any
@@ -16,8 +15,6 @@ from anaplan_sdk.models import (
16
15
  Module,
17
16
  )
18
17
 
19
- warnings.filterwarnings("always", category=DeprecationWarning)
20
-
21
18
 
22
19
  class _AsyncTransactionalClient(_AsyncBaseClient):
23
20
  def __init__(self, client: httpx.AsyncClient, model_id: str, retry_count: int) -> None:
@@ -169,25 +166,3 @@ class _AsyncTransactionalClient(_AsyncBaseClient):
169
166
  """
170
167
  res = await self._post(f"{self._url}/modules/{module_id}/data", json=data)
171
168
  return res if "failures" in res else res["numberOfCellsChanged"]
172
-
173
- async def write_to_module(
174
- self, module_id: int, data: list[dict[str, Any]]
175
- ) -> int | dict[str, Any]:
176
- warnings.warn(
177
- "`write_to_module()` is deprecated and will be removed in a future version. "
178
- "Use `update_module_data()` instead.",
179
- DeprecationWarning,
180
- stacklevel=1,
181
- )
182
- return await self.update_module_data(module_id, data)
183
-
184
- async def add_items_to_list(
185
- self, list_id: int, items: list[dict[str, str | int | dict]]
186
- ) -> InsertionResult:
187
- warnings.warn(
188
- "`add_items_to_list()` is deprecated and will be removed in a future version. "
189
- "Use `insert_list_items()` instead.",
190
- DeprecationWarning,
191
- stacklevel=1,
192
- )
193
- return await self.insert_list_items(list_id, items)
@@ -1,11 +1,7 @@
1
- import warnings
2
-
3
1
  import httpx
4
2
 
5
3
  from anaplan_sdk._base import _BaseClient
6
- from anaplan_sdk.models import ModelRevision, Revision, SyncTask, User
7
-
8
- warnings.filterwarnings("always", category=DeprecationWarning)
4
+ from anaplan_sdk.models import ModelRevision, Revision, SyncTask
9
5
 
10
6
 
11
7
  class _AlmClient(_BaseClient):
@@ -13,22 +9,6 @@ class _AlmClient(_BaseClient):
13
9
  self._url = f"https://api.anaplan.com/2/0/models/{model_id}/alm"
14
10
  super().__init__(retry_count, client)
15
11
 
16
- def list_users(self) -> list[User]:
17
- """
18
- Lists all the Users in the authenticated users default tenant.
19
- :return: The List of Users.
20
- """
21
- warnings.warn(
22
- "`list_users()` on the ALM client is deprecated and will be removed in a "
23
- "future version. Use `list_users()` on the Audit client instead.",
24
- DeprecationWarning,
25
- stacklevel=1,
26
- )
27
- return [
28
- User.model_validate(e)
29
- for e in self._get("https://api.anaplan.com/2/0/users").get("users")
30
- ]
31
-
32
12
  def get_syncable_revisions(self, source_model_id: str) -> list[Revision]:
33
13
  """
34
14
  Use this call to return the list of revisions from your source model that can be
@@ -15,14 +15,19 @@ class _AuditClient(_BaseClient):
15
15
  self._url = "https://audit.anaplan.com/audit/api/1/events"
16
16
  super().__init__(retry_count, client)
17
17
 
18
- def list_users(self) -> list[User]:
18
+ def list_users(self, search_pattern: str | None = None) -> list[User]:
19
19
  """
20
20
  Lists all the Users in the authenticated users default tenant.
21
+ :param search_pattern: Optional filter for users. When provided, case-insensitive matches
22
+ users with emails containing this string. When None (default), returns all users.
21
23
  :return: The List of Users.
22
24
  """
25
+ params = {"s": search_pattern} if search_pattern else None
23
26
  return [
24
27
  User.model_validate(e)
25
- for e in self._get_paginated("https://api.anaplan.com/2/0/users", "users")
28
+ for e in self._get_paginated(
29
+ "https://api.anaplan.com/2/0/users", "users", params=params
30
+ )
26
31
  ]
27
32
 
28
33
  def get_user(self, user_id: str = "me") -> User:
@@ -225,29 +225,38 @@ class Client(_BaseClient):
225
225
  )
226
226
  return self._alm_client
227
227
 
228
- def list_workspaces(self) -> list[Workspace]:
228
+ def list_workspaces(self, search_pattern: str | None = None) -> list[Workspace]:
229
229
  """
230
230
  Lists all the Workspaces the authenticated user has access to.
231
+ :param search_pattern: Optional filter for workspaces. When provided, case-insensitive
232
+ matches workspaces with names containing this string. When None (default),
233
+ returns all workspaces.
231
234
  :return: The List of Workspaces.
232
235
  """
236
+ params = {"tenantDetails": "true"}
237
+ if search_pattern:
238
+ params["s"] = search_pattern
233
239
  return [
234
240
  Workspace.model_validate(e)
235
241
  for e in self._get_paginated(
236
- "https://api.anaplan.com/2/0/workspaces",
237
- "workspaces",
238
- params={"tenantDetails": "true"},
242
+ "https://api.anaplan.com/2/0/workspaces", "workspaces", params=params
239
243
  )
240
244
  ]
241
245
 
242
- def list_models(self) -> list[Model]:
246
+ def list_models(self, search_pattern: str | None = None) -> list[Model]:
243
247
  """
244
248
  Lists all the Models the authenticated user has access to.
249
+ :param search_pattern: Optional filter for models. When provided, case-insensitive matches
250
+ models with names containing this string. When None (default), returns all models.
245
251
  :return: The List of Models.
246
252
  """
253
+ params = {"modelDetails": "true"}
254
+ if search_pattern:
255
+ params["s"] = search_pattern
247
256
  return [
248
257
  Model.model_validate(e)
249
258
  for e in self._get_paginated(
250
- "https://api.anaplan.com/2/0/models", "models", params={"modelDetails": "true"}
259
+ "https://api.anaplan.com/2/0/models", "models", params=params
251
260
  )
252
261
  ]
253
262
 
@@ -1,4 +1,3 @@
1
- import warnings
2
1
  from concurrent.futures import ThreadPoolExecutor
3
2
  from itertools import chain
4
3
  from typing import Any
@@ -164,23 +163,3 @@ class _TransactionalClient(_BaseClient):
164
163
  """
165
164
  res = self._post(f"{self._url}/modules/{module_id}/data", json=data)
166
165
  return res if "failures" in res else res["numberOfCellsChanged"]
167
-
168
- def write_to_module(self, module_id: int, data: list[dict[str, Any]]) -> int | dict[str, Any]:
169
- warnings.warn(
170
- "`write_to_module()` is deprecated and will be removed in a future version. "
171
- "Use `update_module_data()` instead.",
172
- DeprecationWarning,
173
- stacklevel=1,
174
- )
175
- return self.update_module_data(module_id, data)
176
-
177
- def add_items_to_list(
178
- self, list_id: int, items: list[dict[str, str | int | dict]]
179
- ) -> InsertionResult:
180
- warnings.warn(
181
- "`add_items_to_list()` is deprecated and will be removed in a future version. "
182
- "Use `insert_list_items()` instead.",
183
- DeprecationWarning,
184
- stacklevel=1,
185
- )
186
- return self.insert_list_items(list_id, items)
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.4
2
+ Name: anaplan-sdk
3
+ Version: 0.4.0a2
4
+ Summary: Provides pythonic access to the Anaplan API
5
+ Project-URL: Homepage, https://vinzenzklass.github.io/anaplan-sdk/
6
+ Project-URL: Repository, https://github.com/VinzenzKlass/anaplan-sdk
7
+ Project-URL: Documentation, https://vinzenzklass.github.io/anaplan-sdk/
8
+ Author-email: Vinzenz Klass <vinzenz.klass@valantic.com>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: anaplan,anaplan alm api,anaplan api,anaplan audit api,anaplan bulk api,anaplan integration
12
+ Requires-Python: >=3.10.4
13
+ Requires-Dist: httpx<1.0.0,>=0.27.0
14
+ Requires-Dist: pydantic<3.0.0,>=2.7.2
15
+ Provides-Extra: cert
16
+ Requires-Dist: cryptography<45.0.0,>=42.0.7; extra == 'cert'
17
+ Provides-Extra: oauth
18
+ Requires-Dist: oauthlib<4.0.0,>=3.0.0; extra == 'oauth'
19
+ Description-Content-Type: text/markdown
20
+
21
+ <p align="center">
22
+ <img width="160" height="160" src="https://vinzenzklass.github.io/anaplan-sdk/img/anaplan-sdk.webp" alt='Python' style="border-radius: 15px">
23
+ </p>
24
+
25
+ <h3 align="center" style="font-size: 3rem; font-weight: 600;">
26
+ Anaplan SDK
27
+ </h3>
28
+
29
+ <p align="center" style="font-size: 1.2rem; font-weight: 300; margin: 15px 0">
30
+ Streamlined Python Interface for Anaplan
31
+ </p>
32
+
33
+ <div align="center">
34
+ <a href="https://pepy.tech/projects/anaplan-sdk">
35
+ <img src="https://static.pepy.tech/badge/anaplan-sdk" alt="">
36
+ </a>
37
+ <a href="https://pypi.org/project/anaplan-sdk/">
38
+ <img src="https://img.shields.io/pypi/v/anaplan-sdk.svg" alt="PyPi Latest Release"/>
39
+ </a>
40
+ <a href="https://pepy.tech/projects/anaplan-sdk">
41
+ <img src="https://static.pepy.tech/badge/anaplan-sdk/month" alt="PyPI Downloads">
42
+ </a>
43
+ </div>
44
+
45
+ ---
46
+
47
+ Anaplan SDK is an independent, unofficial project providing pythonic access to Anaplan. It delivers high-level
48
+ abstractions over all Anaplan APIs, allowing you to focus on business requirements rather than implementation details.
49
+
50
+ ## Key Features
51
+
52
+ - **Pythonic Interface**: Clean, intuitive access to Anaplan functionality
53
+ - **Simplified API Interactions**: Automatic handling of authentication, error handling, and data formatting
54
+ - **Performance Optimizations**: Built-in chunking and compression techniques
55
+ - **Multiple API Support**: Compatible with all major Anaplan API endpoints
56
+ - **Flexible Client Options**: Both synchronous and asynchronous implementations
57
+ - **Developer-Friendly**: Designed to reduce boilerplate code and accelerate development
58
+
59
+ ## Getting Started
60
+
61
+ Head over to the [Quick Start](quickstart.md) for basic usage instructions and examples.
62
+
63
+ ## Contributing
64
+
65
+ Pull Requests are welcome. For major changes,
66
+ please [open an issue](https://github.com/VinzenzKlass/anaplan-sdk/issues/new) first to discuss what you would like to
67
+ change. To submit a pull request, please follow the
68
+ standard [Fork & Pull Request workflow](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
69
+
70
+ Before submitting your pull request, please ensure that all the files pass linting and formatting checks. You can do
71
+ this by running the following command:
72
+
73
+ ```shell
74
+ uv sync --dev
75
+
76
+ ruff check
77
+ ruff format
78
+ ```
79
+
80
+ You can also enable [pre-commit](https://pre-commit.com/) hooks to automatically format and lint your code before
81
+ committing:
82
+
83
+ ```shell
84
+ pre-commit install
85
+ ```
86
+
87
+ If your PR goes beyond a simple bug fix or small changes, please add tests to cover your changes.
@@ -3,19 +3,19 @@ anaplan_sdk/_auth.py,sha256=wqlyrZwaJSEXW5J2-GV4UIw7KxDkfQ-loWdePVy2lWg,10231
3
3
  anaplan_sdk/_base.py,sha256=lKwtDSi1KRGDxd60Vv0prS_XhB7fsJkvtNWxI23njOA,12319
4
4
  anaplan_sdk/exceptions.py,sha256=ALkA9fBF0NQ7dufFxV6AivjmHyuJk9DOQ9jtJV2n7f0,1809
5
5
  anaplan_sdk/_async_clients/__init__.py,sha256=pZXgMMg4S9Aj_pxQCaSiPuNG-sePVGBtNJ0133VjqW4,364
6
- anaplan_sdk/_async_clients/_alm.py,sha256=bfLBJ5xu4hqqoc-QDGPNM7PuIAAIB_aD7yz68cpXfUA,3990
7
- anaplan_sdk/_async_clients/_audit.py,sha256=bD9ILvfyQ1xg73iRtRG-lX9ukwURhiDRVte8HYpkfe0,1830
8
- anaplan_sdk/_async_clients/_bulk.py,sha256=VAsgSXZM4kqcFJly0hvBP5f6rNHywdH3gDK7i7zl3yE,24421
6
+ anaplan_sdk/_async_clients/_alm.py,sha256=O1_r-O1tNDq7vXRwE2UEFE5S2bPmPh4IAQPQ8bmZfQE,3297
7
+ anaplan_sdk/_async_clients/_audit.py,sha256=a92RY0B3bWxp2CCAWjzqKfvBjG1LJGlai0Hn5qmwgF8,2312
8
+ anaplan_sdk/_async_clients/_bulk.py,sha256=pvx0ux5tAAtCsNJrJorC_SDRxvDUSWu5aKPolE1_nuo,25297
9
9
  anaplan_sdk/_async_clients/_cloud_works.py,sha256=KPX9W55SF6h8fJd4Rx-HLq6eaRA-Vo3rFu343UiiaGQ,16642
10
10
  anaplan_sdk/_async_clients/_cw_flow.py,sha256=ZTNAbKDwb59Wg3u68hbtt1kpd-LNz9K0sftT-gvYzJQ,3651
11
- anaplan_sdk/_async_clients/_transactional.py,sha256=KBGH0XrQhbxq9fhhV5-ZflShJvpm8iHk0Jq9K_-lz6Y,7465
11
+ anaplan_sdk/_async_clients/_transactional.py,sha256=zEM-wWxX-mCkk9H_nIl3WDZ6X3bo6LQxWLpfLCG5BDw,6524
12
12
  anaplan_sdk/_clients/__init__.py,sha256=FsbwvZC1FHrxuRXwbPxUzbhz_lO1DpXIxEOjx6-3QuA,219
13
- anaplan_sdk/_clients/_alm.py,sha256=i7S2FuvQEAWAfEd6xn0Hu9eWqlcnxsaXFqQvQCmeYNw,3881
14
- anaplan_sdk/_clients/_audit.py,sha256=rEWn2uBenv308hYSLH5PEEvYbNtP2THJw0Fp7fRJiX0,1834
15
- anaplan_sdk/_clients/_bulk.py,sha256=0s2EmHroWMvzFcIpH6LcVEvVWXLA9CUFMSnuQtLe4ls,24468
13
+ anaplan_sdk/_clients/_alm.py,sha256=UAdQxgHfax-VquC0YtbqrRBku2Rn35tVgwJdxYFScps,3202
14
+ anaplan_sdk/_clients/_audit.py,sha256=xQQiwWIb4QQefolPvxNwBFE-pkRzzi8fYPyewjF63lc,2181
15
+ anaplan_sdk/_clients/_bulk.py,sha256=CaDFD5j5nZtvCPKwyVYBBpf1qr-OWMuPFXojF-fEM1k,25119
16
16
  anaplan_sdk/_clients/_cloud_works.py,sha256=KAMnLoeMJ2iwMXlDSbKynCE57BtkCfOgM5O8wT1kkSs,16291
17
17
  anaplan_sdk/_clients/_cw_flow.py,sha256=5IFWFT-qbyGvaSOOtaFOjHnOlyYbj4Rj3xiavfTlm8c,3527
18
- anaplan_sdk/_clients/_transactional.py,sha256=WlNgpTEvbeAAla9wFaWiv6LB6NhwPPNp3FDI1UgAxHw,7300
18
+ anaplan_sdk/_clients/_transactional.py,sha256=o1wcAgVyIn2EdJL8Ivw6cW7KZ9OEFwv-PpbhvQAqCfo,6465
19
19
  anaplan_sdk/models/__init__.py,sha256=nSplwPG_74CG9CKbv1PzP9bsA9v5-daS4azpTCvCQTI,925
20
20
  anaplan_sdk/models/_alm.py,sha256=IqsTPvkx_ujLpaqZgIrTcr44KHJyKc4dyeRs9rkDjms,2307
21
21
  anaplan_sdk/models/_base.py,sha256=k2hGE0NmnNwLNJsPUuSjSYSUG9W2orZmMiCGYer7Zuk,554
@@ -23,7 +23,7 @@ anaplan_sdk/models/_bulk.py,sha256=dHP3kMvsKONCZS6mHB271-wp2S4P3rM874Ita8TzABU,8
23
23
  anaplan_sdk/models/_transactional.py,sha256=_0UbVR9D5QABI29yloYrJTSgL-K0EU7PzPeJu5LdhnY,4854
24
24
  anaplan_sdk/models/cloud_works.py,sha256=AWSwyVhAqOGYgWTbCTrfVQuqEY0_LW3ct5zxSZ7UKWs,19466
25
25
  anaplan_sdk/models/flows.py,sha256=SuLgNj5-2SeE3U1i8iY8cq2IkjuUgd_3M1n2ENructk,3625
26
- anaplan_sdk-0.4.0a1.dist-info/METADATA,sha256=uB_U8TLOlAGW4qGoDojbO28B9XIME4mglxwrm57SzO8,4751
27
- anaplan_sdk-0.4.0a1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
- anaplan_sdk-0.4.0a1.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
29
- anaplan_sdk-0.4.0a1.dist-info/RECORD,,
26
+ anaplan_sdk-0.4.0a2.dist-info/METADATA,sha256=-hZsuCu5si1jen5pTxo307hfKXMTGYulIxFrsg_tsUw,3463
27
+ anaplan_sdk-0.4.0a2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
+ anaplan_sdk-0.4.0a2.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
29
+ anaplan_sdk-0.4.0a2.dist-info/RECORD,,
@@ -1,140 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: anaplan-sdk
3
- Version: 0.4.0a1
4
- Summary: Provides pythonic access to the Anaplan API
5
- Project-URL: Homepage, https://vinzenzklass.github.io/anaplan-sdk/
6
- Project-URL: Repository, https://github.com/VinzenzKlass/anaplan-sdk
7
- Project-URL: Documentation, https://vinzenzklass.github.io/anaplan-sdk/
8
- Author-email: Vinzenz Klass <vinzenz.klass@valantic.com>
9
- License-Expression: Apache-2.0
10
- License-File: LICENSE
11
- Keywords: anaplan,anaplan alm api,anaplan api,anaplan audit api,anaplan bulk api,anaplan integration
12
- Requires-Python: >=3.10.4
13
- Requires-Dist: httpx<1.0.0,>=0.27.0
14
- Requires-Dist: pydantic<3.0.0,>=2.7.2
15
- Provides-Extra: cert
16
- Requires-Dist: cryptography<45.0.0,>=42.0.7; extra == 'cert'
17
- Provides-Extra: oauth
18
- Requires-Dist: oauthlib<4.0.0,>=3.0.0; extra == 'oauth'
19
- Description-Content-Type: text/markdown
20
-
21
- <p align="center" style="margin: 0 0 10px">
22
- <img width="200" height="200" src="https://vinzenzklass.github.io/anaplan-sdk/img/anaplan-sdk.webp" alt='Python' style="border-radius: 15px">
23
- </p>
24
-
25
- <h1 align="center" style="font-size: 3rem; font-weight: 400; margin: -15px 0">
26
- Anaplan SDK
27
- </h1>
28
-
29
- <p align="center" style="margin-top: 15px">
30
- <a href="https://pepy.tech/project/anaplan-sdk">
31
- <img align="center" src="https://static.pepy.tech/badge/anaplan-sdk/month" alt="Downloads Badge"/>
32
- </a>
33
- </p>
34
-
35
- ---
36
-
37
- Anaplan SDK is an independent, unofficial project providing pythonic access to Anaplan. Anaplan SDK provides high-level
38
- abstractions over the various Anaplan APIs, so you can focus on you requirements rather than spend time on
39
- implementation details like authentication, error handling, chunking, compression and data formatting.
40
-
41
- This Projects supports
42
- the [Bulk APIs](https://help.anaplan.com/use-the-bulk-apis-93218e5e-00e5-406e-8361-09ab861889a7),
43
- the [Transactional APIs](https://help.anaplan.com/use-the-transactional-apis-cc1c1e91-39fc-4272-a4b5-16bc91e9c313) and
44
- the [ALM APIs](https://help.anaplan.com/application-lifecycle-management-api-2565cfa6-e0c2-4e24-884e-d0df957184d6),
45
- the [Audit APIs](https://auditservice.docs.apiary.io/#),
46
- providing both synchronous and asynchronous Clients.
47
-
48
- Visit [Anaplan SDK](https://vinzenzklass.github.io/anaplan-sdk/) for documentation.
49
-
50
- If you find any issues or feel that this SDK is not adequately covering your use case,
51
- please [open an issue](https://github.com/VinzenzKlass/anaplan-sdk/issues/new).
52
-
53
- ---
54
-
55
- ### Install Anaplan SDK using pip
56
-
57
- ```shell
58
- pip install anaplan-sdk
59
- ```
60
-
61
- ### Instantiate a client
62
-
63
- ```python
64
- import anaplan_sdk
65
-
66
- anaplan = anaplan_sdk.Client(
67
- workspace_id="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
68
- model_id="11111111111111111111111111111111",
69
- user_email="admin@company.com",
70
- password="my_super_secret_password",
71
- )
72
- ```
73
-
74
- ### Find workspaces and models
75
-
76
- If you don't know the workspace and model Ids, instantiate client with authentication information only and
77
- call `.list_workspaces()` and list `.list_models()`
78
-
79
- ```python
80
- anaplan = anaplan_sdk.Client(
81
- user_email="admin@company.com",
82
- password="my_super_secret_password",
83
- )
84
-
85
- for workspace in anaplan.list_workspaces():
86
- print(f"{workspace.name}: {workspace.id}")
87
-
88
- for model in anaplan.list_models():
89
- print(f"{model.name}: {model.id}")
90
- ```
91
-
92
- ### Async Support
93
-
94
- This SDK also provides an `AsyncClient` with full async support
95
-
96
- ```python
97
- import asyncio
98
-
99
- anaplan = anaplan_sdk.AsyncClient(
100
- workspace_id="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
101
- model_id="11111111111111111111111111111111",
102
- user_email="admin@company.com",
103
- password="my_super_secret_password",
104
- )
105
- workspaces, models = await asyncio.gather(
106
- anaplan.list_workspaces(), anaplan.list_models()
107
- )
108
- for workspace in workspaces:
109
- print(f"{workspace.name}: {workspace.id}")
110
- for model in models:
111
- print(f"{model.name}: {model.id}")
112
- ```
113
-
114
- For more information, API reference and detailed guides,
115
- visit [Anaplan SDK](https://vinzenzklass.github.io/anaplan-sdk/).
116
-
117
- ### Contributing
118
-
119
- Pull Requests are welcome. For major changes, please open an issue first to discuss what you would like to change. To
120
- submit a pull request, please follow the
121
- standard [Fork & Pull Request workflow](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
122
-
123
- Before submitting your pull request, please ensure that all the files pass linting and formatting checks. You can do
124
- this by running the following command:
125
-
126
- ```shell
127
- uv sync --dev
128
-
129
- ruff check
130
- ruff format
131
- ```
132
-
133
- You can also enable [pre-commit](https://pre-commit.com/) hooks to automatically format and lint your code before
134
- committing:
135
-
136
- ```shell
137
- pre-commit install
138
- ```
139
-
140
- If your PR goes beyond a simple bug fix or small changes, please add tests to cover your changes.