Skip to content

Commit

Permalink
Merge pull request #10 from jfallt/release-0.0.6
Browse files Browse the repository at this point in the history
Release 0.0.6
  • Loading branch information
jfallt authored Oct 22, 2021
2 parents 56f7c59 + 467501c commit 9e4484c
Show file tree
Hide file tree
Showing 19 changed files with 597 additions and 282 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os}}
strategy:
matrix:
os: [windows-latest]
python-version: ['3.9']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
echo '${{ secrets.private }}' > private.pem
- name: Test with tox
run: >
tox -- -x --user ${{ secrets.user }}
--pw ${{ secrets.pw }}
--clientId ${{ secrets.client_id }}
--tokenUrl ${{ secrets.token_url }}
--apiUrl ${{ secrets.api_url }}
--apiUrlAnalytics ${{ secrets.api_url_analytics }}
--assertionType '${{ secrets.assertion_type }}'
--scope '${{ secrets.scope }}'
--profileIdType ${{ secrets.profile_id_type }}
50 changes: 31 additions & 19 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Burgiss API

## Description
This package simplifies the connection to the Burgiss API and is built on top of the requests package
This package simplifies the connection to the Burgiss API and flattens API responses to dataframes.

![Tests](https://github.com/jfallt/burgissApi/actions/workflows/tests.yml/badge.svg)

## Authentication Setup
The class burgissApiAuth handles all the JWT token authentication but there are a few prerequesite requirements for the authentication.
Expand All @@ -21,7 +23,8 @@ pip install burgiss-api
```

## Usage
Data can be updated via the api, to enable this you must change the scope in the config file and specify the request type.
### Get requests
Request method defaults to get

```python
from burgissApi import burgissApiSession
Expand All @@ -38,9 +41,24 @@ lookUpValues = burgissSession.request('LookupValues', profileIdAsHeader=True)
# Optional Parameters
investments = burgissSession.request('investments', optionalParameters='&includeInvestmentNotes=false&includeCommitmentHistory=false&includeInvestmentLiquidationNotes=false')
```
### Put requests
Must add optional parameters for requestType and data

```python
from burgissApi import burgissApiSession

# Initiate a session and get profile id for subsequent calls (obtains auth token)
burgissSession = burgissApiSession()

# When creating a put request, all fields must be present
data = {'someJsonObject':'data'}

# Specify the request type
orgs = burgissSession.request('some endpoint', requestType='PUT', data=data)
```

## Transformed Data Requests
Some endpoints are supported for transformation to a flattened dataframe instead of a raw json
Receive a flattened dataframe instead of a raw json from api

```python
from burgissApi import burgissApi
Expand All @@ -50,29 +68,23 @@ apiSession = burgissApi()
orgs = apiSession.getData('orgs')
```

<details>
<summary>Supported Endpoints</summary>

|Field|
| -------|
|portfolios|
|orgs|
|orgs details|
|investments|
|investments transactions|
|LookupData|
|LookupValues|
</details>


## Analytics API
```python
from burgissApi import burgissApiSession

# Initiate a session and get profile id for subsequent calls (obtains auth token)
burgissSession = burgissApiSession()

# Get grouping fields
burgissSession.request('analyticsGroupingFields', analyticsApi=True, profileIdAsHeader=True)

# Specify inputs for point in time analyis
analysisJson = pointInTimeAnalyisInput(analysisParameters, globalMeasureParameters,
measures, measureStartDateReference, measureEndDateReference, dataCriteria, groupBy)

# Send post request to receive data
burgissSession.request('pointinTimeAnalysis', analyticsApi=True,
profileIdAsHeader=True, requestType='POST', data=analysisJson)
```

<details>
Expand Down Expand Up @@ -123,4 +135,4 @@ burgissSession.request('analyticsGroupingFields', analyticsApi=True, profileIdAs
- [Burgiss API Documentation](https://api.burgiss.com/v2/docs/index.html)
- [Burgiss Analytics API Documentation](https://api-analytics.burgiss.com/swagger/index.html)
- [Burgiss API Token Auth Documentation](https://burgiss.docsend.com/view/fcqygcx)
- [Pypi Package](https://pypi.org/project/burgiss-api/)
- [Pypi Package](https://pypi.org/project/burgiss-api/)
1 change: 0 additions & 1 deletion burgissApi/__init__.py

This file was deleted.

23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[build-system]
requires = ["setuptools>=42.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = "--cov=burgissApiWrapper"
testpaths = [
"tests",
]

[tool.mypy]
mypy_path = "src"
check_untyped_defs = true
disallow_any_generics = false
ignore_missing_imports = true
no_implicit_optional = true
show_error_codes = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
no_implicit_reexport = true
Binary file modified requirements.txt
Binary file not shown.
7 changes: 7 additions & 0 deletions requirementsDev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tox==3.24.4
pytest==6.2.5
pytest-cov==3.0.0
pytest-rerunfailures==10.2
mypy==0.910
mypy-extensions==0.4.3
flake8==4.0.1
60 changes: 60 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[metadata]
name = burgiss-api
version = 0.0.6
description = An api wrapper package for financial data provided by 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.
author = Jared Fallt
author_email = [email protected]
license = MIT
classifiers =
Development Status :: 3 - Alpha
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3

[options]
packages =
burgissApiWrapper
install_requires =
atomicwrites>=1.4.0
attrs>=21.2.0
certifi>=2021.5.30
cffi>=1.14.6
charset-normalizer>=2.0.4
colorama>=0.4.4
cryptography>=3.4.8
idna>=3.2
iniconfig>=1.1.1
numpy>=1.21.2
packaging>=21.0
pandas>=1.3.3
pluggy>=1.0.0
py>=1.10.0
pycparser>=2.20
PyJWT>=2.1.0
pyodbc>=4.0.32
pyOpenSSL>=20.0.1
pyparsing>=2.4.7
python-dateutil>=2.8.2
pytz>=2021.1
requests>=2.26.0
six>=1.16.0
toml>=0.10.2
urllib3>=1.26.6
package_dir=
=src
zip_safe = no

[options.extras_require]
testing =
pytest>=6.2.5
pytest-cov>=3.0.0
mypy>=0.910
flake>=4.0.1
tox>=3.24.4

[options.package_data]
burgissApiWrapper = py.typed

[flake8]
max-line-length = 200
34 changes: 2 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,4 @@
from pkg_resources import Requirement, resource_filename
from setuptools import setup, find_packages
import pathlib
from setuptools import setup

# The directory containing this file
HERE = pathlib.Path(__file__).parent

# The text of the README file
README = (HERE / "README.md").read_text()


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",
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author="Jared Fallt",
author_email="[email protected]",
license='MIT',
packages=find_packages(),
install_requires=[],
keywords='burgiss',
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
'License :: OSI Approved :: MIT License',
"Programming Language :: Python :: 3",
]
)
if __name__ == "__main__":
setup()
Empty file.
Loading

0 comments on commit 9e4484c

Please sign in to comment.