Skip to content

Commit 39ef470

Browse files
authored
Merge pull request #100 from rogers-obrien-rad/feature/no-ref/doc-indices
Feature/no ref/doc indices
2 parents 2312ff4 + 2d0c978 commit 39ef470

File tree

5 files changed

+74
-64
lines changed

5 files changed

+74
-64
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [0.6.2] - 2025-05-13
4+
5+
### Added
6+
* `documents.files`: add `view` parameter to `get()` and `search()` methods
7+
38
## [0.6.1] - 2025-05-07
49

510
### Added

ProPyCore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from .exceptions import *
44
from .procore import Procore
55

6-
__version__ = "0.6.1"
6+
__version__ = "0.6.2"

ProPyCore/access/documents/files.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def remove(self, company_id, project_id, doc_id):
225225

226226
return doc_info
227227

228-
def get(self, company_id, project_id, folder_id=None):
228+
def get(self, company_id, project_id, folder_id=None, view="normal"):
229229
"""
230230
Gets all documents in a project.
231231
@@ -235,6 +235,10 @@ def get(self, company_id, project_id, folder_id=None):
235235
Unique identifier for the company.
236236
project_id : int
237237
Unique identifier for the project.
238+
folder_id : int, default None
239+
ID of parent folder.
240+
view : str, default "normal"
241+
View to use for the request: "normal" or "extended"
238242
239243
Returns
240244
-------
@@ -248,7 +252,7 @@ def get(self, company_id, project_id, folder_id=None):
248252
docs = []
249253
while n_docs > 0:
250254
params = {
251-
"view": "normal",
255+
"view": view,
252256
"sort": "name",
253257
"page": page,
254258
"per_page": 10000,
@@ -284,7 +288,7 @@ def get(self, company_id, project_id, folder_id=None):
284288
f"from Parent ID {folder_id if folder_id is not None else 'Root'}",
285289
)
286290

287-
def search(self, company_id, project_id, value, folder_id=None):
291+
def search(self, company_id, project_id, value, folder_id=None, view="normal"):
288292
"""
289293
Searches through all available files to find the closest match to the given value.
290294
@@ -308,6 +312,7 @@ def search(self, company_id, project_id, value, folder_id=None):
308312
company_id=company_id,
309313
project_id=project_id,
310314
folder_id=folder_id,
315+
view=view,
311316
)
312317

313318
doc_type = self.endpoint.split("/")[-1][:-1]
@@ -331,4 +336,4 @@ def search(self, company_id, project_id, value, folder_id=None):
331336
raise NotFoundItemError(f"Could not find document {value}")
332337
else:
333338
result["search_criteria"] = {"value": value, "match": score}
334-
return result
339+
return result

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="ProPyCore",
15-
version="0.6.1",
15+
version="0.6.2",
1616
author="Hagen E. Fritz",
1717
author_email="hfritz@r-o.com",
1818
description="Interact with Procore through Python for data connection applications",

0 commit comments

Comments
 (0)