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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.6.4] - 2025-05-28

### Added
* `directory.ipynb`: add snippets for trades, users, and vendors directory endpoints in snippet

### Changed
* `procore.py`: update refresh token process so that the submodules are reinitialized with the new access token

## [0.6.3] - 2025-05-13

### 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.3"
__version__ = "0.6.4"
6 changes: 4 additions & 2 deletions ProPyCore/access/directory/trades.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ def get(self, company_id, per_page=1000):
"Procore-Company-Id": f"{company_id}"
}

url = f"{self.endpoint}/{company_id}/trades"
trades_per_page = self.get_request(
api_url=f"{self.endpoint}/{company_id}/trades",
api_url=url,
additional_headers=headers,
params=params
)
Expand Down Expand Up @@ -72,7 +73,8 @@ def find(self, company_id, user_id):
else:
key = "name"

for trade in self.get(company_id=company_id):
all_trades = self.get(company_id=company_id)
for trade in all_trades:
if trade[key] == user_id:
return trade

Expand Down
4 changes: 4 additions & 0 deletions ProPyCore/procore.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def __init__(self, client_id, client_secret, redirect_uri, base_url, oauth_url)
self.reset_access_token()

# create instances of procore endpoints
self._init_endpoints()

def _init_endpoints(self):
# General
self.companies = companies.Companies(access_token=self.__access_token, server_url=self.__base_url)
self.projects = projects.Projects(access_token=self.__access_token, server_url=self.__base_url)
Expand Down Expand Up @@ -93,6 +96,7 @@ def reset_access_token(self):
Gets a new access token
"""
self.__access_token = self.get_access_token()
self._init_endpoints()

def print_attributes(self):
"""
Expand Down
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.3",
version="0.6.4",
author="Hagen E. Fritz",
author_email="hfritz@r-o.com",
description="Interact with Procore through Python for data connection applications",
Expand Down
900 changes: 889 additions & 11 deletions snippets/directory.ipynb

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions snippets/find_user.py

This file was deleted.

54 changes: 0 additions & 54 deletions snippets/get_users.py

This file was deleted.

71 changes: 0 additions & 71 deletions snippets/get_vendors.py

This file was deleted.

48 changes: 0 additions & 48 deletions snippets/trades.py

This file was deleted.

Loading