Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.6.2] - 2025-05-13

### Added
* `documents.files`: add `view` parameter to `get()` and `search()` methods

## [0.6.1] - 2025-05-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion ProPyCore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from .exceptions import *
from .procore import Procore

__version__ = "0.6.1"
__version__ = "0.6.2"
13 changes: 9 additions & 4 deletions ProPyCore/access/documents/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def remove(self, company_id, project_id, doc_id):

return doc_info

def get(self, company_id, project_id, folder_id=None):
def get(self, company_id, project_id, folder_id=None, view="normal"):
"""
Gets all documents in a project.

Expand All @@ -235,6 +235,10 @@ def get(self, company_id, project_id, folder_id=None):
Unique identifier for the company.
project_id : int
Unique identifier for the project.
folder_id : int, default None
ID of parent folder.
view : str, default "normal"
View to use for the request: "normal" or "extended"

Returns
-------
Expand All @@ -248,7 +252,7 @@ def get(self, company_id, project_id, folder_id=None):
docs = []
while n_docs > 0:
params = {
"view": "normal",
"view": view,
"sort": "name",
"page": page,
"per_page": 10000,
Expand Down Expand Up @@ -284,7 +288,7 @@ def get(self, company_id, project_id, folder_id=None):
f"from Parent ID {folder_id if folder_id is not None else 'Root'}",
)

def search(self, company_id, project_id, value, folder_id=None):
def search(self, company_id, project_id, value, folder_id=None, view="normal"):
"""
Searches through all available files to find the closest match to the given value.

Expand All @@ -308,6 +312,7 @@ def search(self, company_id, project_id, value, folder_id=None):
company_id=company_id,
project_id=project_id,
folder_id=folder_id,
view=view,
)

doc_type = self.endpoint.split("/")[-1][:-1]
Expand All @@ -331,4 +336,4 @@ def search(self, company_id, project_id, value, folder_id=None):
raise NotFoundItemError(f"Could not find document {value}")
else:
result["search_criteria"] = {"value": value, "match": score}
return result
return result
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name="ProPyCore",
version="0.6.1",
version="0.6.2",
author="Hagen E. Fritz",
author_email="hfritz@r-o.com",
description="Interact with Procore through Python for data connection applications",
Expand Down
Loading