Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.0.5 #7

Merged
merged 5 commits into from
Oct 1, 2021
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
6 changes: 4 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ orgs = apiSession.getData('orgs')

|Field|
| -------|
|investments|
|orgs|
|portfolios|
|orgs|
|orgs details|
|investments|
|investments transactions|
|LookupData|
|LookupValues|
</details>
Expand Down
8 changes: 7 additions & 1 deletion burgissApi/burgissApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def responseCodeHandling(response):
"""
if response.status_code == 200:
return response
elif response.status_code == 404:
logger.error(
"Url not found")
raise ApiConnectionError(
'Url not found, check the logs for the specific url!')
else:
logger.error(
f"API Connection Failure: Error Code {response.status_code}")
Expand All @@ -44,7 +49,7 @@ def lowerDictKeys(d):
return newDict


class burgissApiAuth:
class burgissApiAuth(object):
"""
Create and send a signed client token to receive a bearer token from the burgiss api endpoint
"""
Expand Down Expand Up @@ -164,6 +169,7 @@ def request(self, url: str, analyticsApi: bool = False, requestType: str = 'GET'
if self.tokenExpiration < datetime.utcnow():
logger.info('Token has expired, getting new token')
self.token = self.auth.getBurgissApiToken()
self.tokenExpiration = datetime.utcnow() + timedelta(seconds=3600)
else:
logger.info('Token is still valid')

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
README = (HERE / "README.md").read_text()


VERSION = '0.0.3'
DESCRIPTION = 'An api request package for Burgiss'
LONG_DESCRIPTION = 'A package that makes it easy to make requests to the Burgiss API by simplifying the JWT token auth and various endpoints'
VERSION = '0.0.5'
DESCRIPTION = 'An api wrapper package for Burgiss'
LONG_DESCRIPTION = 'A package that makes it easy to make requests to the Burgiss API by simplifying the JWT token auth. Additional functionality includes data transformations.'

setup(
name="burgiss-api",
Expand Down
12 changes: 12 additions & 0 deletions tests/testDataTransformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ def testOrgsTransformation():
assert len(response) > 0


def testInvestmentsTransformation():
response = burgissApiSession.getData('investments')
assert isinstance(response, pd.DataFrame) == True
assert len(response) > 0


def testPortfoliosTransformation():
response = burgissApiSession.getData('portfolios')
assert isinstance(response, pd.DataFrame) == True
assert len(response) > 0


def testLookupValuesTransformation():
response = burgissApiSession.getData(
'LookupValues', profileIdAsHeader=True)
Expand Down