Skip to main content

Python Wrapper for the Workfront API

Project description

workfront-util

Simple Python library that can be used to retrieve data from the workfront api.


Easily return all data for any objCode from the workfront api.

This library uses asyncio under the hood to batch requests and return a list of dicts.


loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
api = WorkfrontAPI(objCode= 'hour')
hours = api.return_all()

Control the results by configuring a workfront_util_settings.json file.

{
  "workfront" : {
        "environment": "prod", 
        "api_version": "9.0", 
        "filters": {
            "hour" : {
                    "entryDate": "2019-07-01", 
                    "entryDate_Mod": "between", 
                    "entryDate_Range": "$$TODAYb"          
            }
        }, 
        "fields" : {
            "hour" : "*"

        }

}

OR Add your filter options and field selections inline if preferred.

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
settings = ENVSettings()

filter_option = {
                    "entryDate": "2019-07-01", 
                    "entryDate_Mod": "between", 
                    "entryDate_Range": "$$TODAYb"          
            }

api = WorkfrontAPI(
    version = settings.api_version,
    env= settings.env ,
    fields = "*"
    filter_option= filter_option, 
    objCode= 'hour')

hours = api.return_all()

Return a flat pandas dataframe by passing flat=true

hours = api.return_all(flat=True)

Run a CLI

Usage: workfrontutil [OPTIONS]

Options:
  --make_config TEXT  Generate config file
  --config_path TEXT  location of config file
  --objCode TEXT      Target objCode
  --fields TEXT       Target objCode fields to return
  --filter TEXT       Target objCode filter to use
  --edit_config TEXT  Update Config file
  --save_obj TEXT     Save all objCode data to DB
  --help              Show this message and exit.

#Getting Started

Install the package

pip install workforntutil

Run from the cli or import into your script

from workfrontutil import WorkfrontAPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

workfrontutil-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

workfrontutil-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file workfrontutil-0.1.0.tar.gz.

File metadata

  • Download URL: workfrontutil-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for workfrontutil-0.1.0.tar.gz
Algorithm Hash digest
SHA256 075355f155b15a03231b438538cff44de25955981ee8bfb2b0ac8786ba802ee7
MD5 65002760603c0b38777c3a62a8f00194
BLAKE2b-256 3b3860f6036fa700b6ae3e3348f7c15eef646aad85f6319737024d0720c158d2

See more details on using hashes here.

File details

Details for the file workfrontutil-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: workfrontutil-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for workfrontutil-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5ddd71070bf4a0d08d0da24e6e46ceb40e056c35ac6e09db89c62005efef894
MD5 efba96841c8ad1fc08374169342c0ab5
BLAKE2b-256 49c13c0e08b2ee7afca25ae019ee87939efba7de94ea7b3ec62648f996c15b1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page