Package to interact with workpath API
Project description
workpathapi
This package allows you to interact with the Workpath API.
Prerequisites
There is only one mandatory Python package that needs to be installed to use workpath i. e. requests. One can install it with the following command.
pip install requests
If you want the API to return a pandas DataFrame you additionally need to install pandas.
pip install pandas
Installation
If all prerequisites are met the installation is as simple as executing the command
pip install workpath
Usage
To get data from the Workpath API you only need three steps.
1. Import module
Import the module, for example like this.
from workpathapi import WorkpathAPI
2. Instanciate WorkpathAPI
Create an instance of the WorkpathAPI.
api = WorkpathAPI(company='dataatelier', api_token='YOUR_WORKPATH_TOKEN')
You need to pass two arguments. Your company and the API token.
Note: If your API token is set as an environment variable as WORKPATH_API_TOKEN = "YOUR_WORKPATH_TOKEN" then you don't have to pass the argument api_token.
3. Get goals from the API
If you want to get all goals, simply execute
goals = api.get_goals()
The output corresponds to the output of API endpoint goals, described here
If you want the result as a pandas DataFrame you can pass the argument output_format='DataFrame'
If you want information about a specific goal, one can execute
goal = api.get_goal(goal_id=1001)
See API documentation for further information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file workpathapi-1.0.0.tar.gz.
File metadata
- Download URL: workpathapi-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63146241153dc5d2de5c9b45e671dc43b47aa018858535dc78374eb6f626ce5e
|
|
| MD5 |
06dc5157d05325e4f71c5018667245e2
|
|
| BLAKE2b-256 |
da6699f7d3d069d9d2fd90e0e7a073c20183b0780fde3ee82227e629e8310d77
|