tallyfy 1.0.0__py3-none-any.whl → 1.0.2__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.

Potentially problematic release.


This version of tallyfy might be problematic. Click here for more details.

tallyfy/BUILD.md ADDED
@@ -0,0 +1,5 @@
1
+ ### Build
2
+ python3 -m build
3
+
4
+ ### Publish
5
+ python -m twine upload dist/tallyfy-version*
tallyfy/README.md CHANGED
@@ -32,8 +32,7 @@ from tallyfy import TallyfySDK
32
32
 
33
33
  # Initialize the SDK
34
34
  sdk = TallyfySDK(
35
- api_key="your_api_key_here",
36
- base_url="https://api.tallyfy.com" # Optional, defaults to Tallyfy API
35
+ api_key="your_api_key_here"
37
36
  )
38
37
 
39
38
  # Get organization users
@@ -149,7 +148,6 @@ tallyfy/
149
148
  ```python
150
149
  TallyfySDK(
151
150
  api_key: str,
152
- base_url: str = "https://api.tallyfy.com",
153
151
  timeout: int = 30,
154
152
  max_retries: int = 3,
155
153
  retry_delay: float = 1.0
@@ -632,5 +630,5 @@ For bugs, feature requests, or questions:
632
630
  2. Contact us at: support@tallyfy.com
633
631
  ---
634
632
 
635
- **Version:** 1.0.0
633
+ **Version:** 1.0.2
636
634
  **Last Updated:** 2025
tallyfy/core.py CHANGED
@@ -74,7 +74,6 @@ class BaseSDK:
74
74
  for attempt in range(self.max_retries + 1):
75
75
  try:
76
76
  self.logger.debug(f"Making {method} request to {url} (attempt {attempt + 1})")
77
- print(url)
78
77
  response = self.session.request(method, url, **request_args)
79
78
 
80
79
  # Parse response
@@ -145,7 +144,7 @@ class TallyfySDK(BaseSDK):
145
144
  Provides typed methods for interacting with Tallyfy's REST API
146
145
  """
147
146
 
148
- def __init__(self, api_key: str, base_url: str = "https://staging.api.tallyfy.com", timeout: int = 30, max_retries: int = 3, retry_delay: float = 1.0):
147
+ def __init__(self, api_key: str, base_url: str = "https://api.tallyfy.com", timeout: int = 30, max_retries: int = 3, retry_delay: float = 1.0):
149
148
  super().__init__(api_key, base_url, timeout, max_retries, retry_delay)
150
149
 
151
150
  # Initialize management modules
tallyfy/models.py CHANGED
@@ -1010,4 +1010,67 @@ class SearchResult:
1010
1010
  starter_id=data.get('starter_id'),
1011
1011
  is_oneoff_task=data.get('is_oneoff_task'),
1012
1012
  owners=owners
1013
+ )
1014
+
1015
+
1016
+ @dataclass
1017
+ class PaginationLinks:
1018
+ """Pagination links data model"""
1019
+ next: Optional[str] = None
1020
+ prev: Optional[str] = None
1021
+
1022
+ @classmethod
1023
+ def from_dict(cls, data: Dict[str, Any]) -> 'PaginationLinks':
1024
+ """Create PaginationLinks instance from dictionary"""
1025
+ return cls(
1026
+ next=data.get('next'),
1027
+ prev=data.get('prev')
1028
+ )
1029
+
1030
+
1031
+ @dataclass
1032
+ class PaginationMeta:
1033
+ """Pagination metadata model"""
1034
+ total: int
1035
+ count: int
1036
+ per_page: int
1037
+ current_page: int
1038
+ total_pages: int
1039
+ links: Optional[PaginationLinks] = None
1040
+
1041
+ @classmethod
1042
+ def from_dict(cls, data: Dict[str, Any]) -> 'PaginationMeta':
1043
+ """Create PaginationMeta instance from dictionary"""
1044
+ links_data = data.get('links', {})
1045
+ links = PaginationLinks.from_dict(links_data) if links_data else None
1046
+
1047
+ return cls(
1048
+ total=data.get('total', 0),
1049
+ count=data.get('count', 0),
1050
+ per_page=data.get('per_page', 0),
1051
+ current_page=data.get('current_page', 1),
1052
+ total_pages=data.get('total_pages', 0),
1053
+ links=links
1054
+ )
1055
+
1056
+
1057
+ @dataclass
1058
+ class TemplatesList:
1059
+ """Templates list response with pagination"""
1060
+ data: List[Template]
1061
+ meta: PaginationMeta
1062
+
1063
+ @classmethod
1064
+ def from_dict(cls, data: Dict[str, Any]) -> 'TemplatesList':
1065
+ """Create TemplatesListResponse instance from dictionary"""
1066
+ templates_data = data.get('data', [])
1067
+ templates = [Template.from_dict(template_data) for template_data in templates_data]
1068
+
1069
+ meta_data = data.get('meta', {})
1070
+ pagination_meta = meta_data.get('pagination', {})
1071
+ meta = PaginationMeta.from_dict(pagination_meta)
1072
+
1073
+ return cls(
1074
+ data=templates,
1075
+ meta=meta
1013
1076
  )
@@ -3,7 +3,7 @@ Template management functionality for Tallyfy SDK
3
3
  """
4
4
 
5
5
  from typing import List, Optional, Dict, Any
6
- from .models import Template, Step, AutomatedAction, PrerunField, TallyfyError
6
+ from .models import Template, Step, AutomatedAction, PrerunField, TallyfyError, TemplatesList
7
7
 
8
8
 
9
9
  class TemplateManagement:
@@ -100,6 +100,33 @@ class TemplateManagement:
100
100
  self.sdk.logger.error(f"Failed to get template {template_id} for org {org_id}: {e}")
101
101
  raise
102
102
 
103
+ def get_all_templates(self, org_id: str) -> TemplatesList:
104
+ """
105
+ Get all templates (checklists) for an organization with pagination metadata.
106
+
107
+ Args:
108
+ org_id: Organization ID
109
+
110
+ Returns:
111
+ TemplatesList object containing list of templates and pagination metadata
112
+
113
+ Raises:
114
+ TallyfyError: If the request fails
115
+ """
116
+ try:
117
+ endpoint = f"organizations/{org_id}/checklists"
118
+ response_data = self.sdk._make_request('GET', endpoint)
119
+
120
+ if isinstance(response_data, dict):
121
+ return TemplatesList.from_dict(response_data)
122
+ else:
123
+ self.sdk.logger.warning("Unexpected response format for templates list")
124
+ return TemplatesList(data=[], meta=None)
125
+
126
+ except TallyfyError as e:
127
+ self.sdk.logger.error(f"Failed to get all templates for org {org_id}: {e}")
128
+ raise
129
+
103
130
  def update_template_metadata(self, org_id: str, template_id: str, **kwargs) -> Optional[Template]:
104
131
  """
105
132
  Update template metadata like title, summary, guidance, icons, etc.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tallyfy
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: A comprehensive Python SDK for interacting with the Tallyfy API
5
5
  Home-page: https://github.com/tallyfy/tallyfy-sdk
6
6
  Author: Tallyfy
@@ -34,7 +34,7 @@ Requires-Dist: typing-extensions>=4.0.0; python_version < "3.8"
34
34
  Provides-Extra: dev
35
35
  Requires-Dist: pytest>=6.0.0; extra == "dev"
36
36
  Requires-Dist: pytest-cov>=2.10.0; extra == "dev"
37
- Requires-Dist: black>=21.0.0; extra == "dev"
37
+ Requires-Dist: black>=21.0.1; extra == "dev"
38
38
  Requires-Dist: flake8>=3.8.0; extra == "dev"
39
39
  Requires-Dist: mypy>=0.800; extra == "dev"
40
40
  Dynamic: author
@@ -76,8 +76,7 @@ from tallyfy import TallyfySDK
76
76
 
77
77
  # Initialize the SDK
78
78
  sdk = TallyfySDK(
79
- api_key="your_api_key_here",
80
- base_url="https://api.tallyfy.com" # Optional, defaults to Tallyfy API
79
+ api_key="your_api_key_here"
81
80
  )
82
81
 
83
82
  # Get organization users
@@ -193,7 +192,6 @@ tallyfy/
193
192
  ```python
194
193
  TallyfySDK(
195
194
  api_key: str,
196
- base_url: str = "https://api.tallyfy.com",
197
195
  timeout: int = 30,
198
196
  max_retries: int = 3,
199
197
  retry_delay: float = 1.0
@@ -676,5 +674,5 @@ For bugs, feature requests, or questions:
676
674
  2. Contact us at: support@tallyfy.com
677
675
  ---
678
676
 
679
- **Version:** 1.0.0
677
+ **Version:** 1.0.2
680
678
  **Last Updated:** 2025
@@ -0,0 +1,14 @@
1
+ tallyfy/BUILD.md,sha256=38Ley-pN-MPfFAsLT98fV0Sz05JHMmcenXyy7P17tZ0,85
2
+ tallyfy/README.md,sha256=aBmihbXYIgWGUUpSeJzR2FSJWpDK3qMBAdTl8aMbveg,21368
3
+ tallyfy/__init__.py,sha256=E4eHCzUwVOD9r3PQBXHdJv0KYPSNe-2lH7h1yKdUHQ8,492
4
+ tallyfy/core.py,sha256=eFqmK7mO7dOXZeErml5wuaIwd9guXWwzCWnbd03HXgA,16316
5
+ tallyfy/form_fields_management.py,sha256=-ifTFKQuA3pcftKfPAyNCV840DOJPqRvJPsBCDNXbWU,24223
6
+ tallyfy/models.py,sha256=y0QSOcP1pVCQMkbpLXuxBe1hYVgIKAVoLCp0Zr7ayyo,38078
7
+ tallyfy/task_management.py,sha256=DIfhbo8qU3DWzuLKBZtwPlFta_D6Ip9HH3PUltr3T2o,14785
8
+ tallyfy/template_management.py,sha256=peYgh4vkhKT5L_782pPzCpJzE18tFQNnIWQ72lyiovU,121138
9
+ tallyfy/user_management.py,sha256=R7L8Nsszm7htvZDRou7C0zQvgFx0pbNmcjHHyWYbl3g,8581
10
+ tallyfy-1.0.2.dist-info/licenses/LICENSE,sha256=8HUsrXnc3l2sZxhPV9Z1gYinq76Q2Ym7ahYJy57QlLc,1063
11
+ tallyfy-1.0.2.dist-info/METADATA,sha256=DrwoFibvBwdIlPut-JmrlsGp95Zdpmw_UklAy8ihsDo,23252
12
+ tallyfy-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ tallyfy-1.0.2.dist-info/top_level.txt,sha256=yIycWbR61EZJD0MYRPwUQjOS2XZw5B5jCWx1IP73KcM,8
14
+ tallyfy-1.0.2.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- tallyfy/README.md,sha256=5K39EilNZNk5NTEw1Y-qYZlLqhw2rja_I_Hdd6boz90,21493
2
- tallyfy/__init__.py,sha256=E4eHCzUwVOD9r3PQBXHdJv0KYPSNe-2lH7h1yKdUHQ8,492
3
- tallyfy/core.py,sha256=f7T_1XL8hq2l7rv4bQSzJAg6xmgHnjWQxNgFoVnvxxg,16351
4
- tallyfy/form_fields_management.py,sha256=-ifTFKQuA3pcftKfPAyNCV840DOJPqRvJPsBCDNXbWU,24223
5
- tallyfy/models.py,sha256=zIcJdvzB0ms8j8KWIHoMxLPllVILIVH42US2csO9g6U,36240
6
- tallyfy/task_management.py,sha256=DIfhbo8qU3DWzuLKBZtwPlFta_D6Ip9HH3PUltr3T2o,14785
7
- tallyfy/template_management.py,sha256=Eg2zxcSorcXeSnhMltwu2McG0tt7omL9OUF7lzWK85k,120174
8
- tallyfy/user_management.py,sha256=R7L8Nsszm7htvZDRou7C0zQvgFx0pbNmcjHHyWYbl3g,8581
9
- tallyfy-1.0.0.dist-info/licenses/LICENSE,sha256=8HUsrXnc3l2sZxhPV9Z1gYinq76Q2Ym7ahYJy57QlLc,1063
10
- tallyfy-1.0.0.dist-info/METADATA,sha256=kr3jHt4Js9WleXwvHOpTNMBYVgcYEIZRyxraXpI0ISI,23377
11
- tallyfy-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- tallyfy-1.0.0.dist-info/top_level.txt,sha256=yIycWbR61EZJD0MYRPwUQjOS2XZw5B5jCWx1IP73KcM,8
13
- tallyfy-1.0.0.dist-info/RECORD,,