Robocorp-Planhat: A Planhat API SDK integrated with Robocorp's Python Automation Framework
This automation library is designed for use with Robocorp's Python Automation Framework. It includes data modeling for the base Planhat API object types and a customized client and associated session for use in authenticating, retrieving, and updating those objects.
For additional information regarding the Planhat API, please refer to the Planhat API documentation.
Installation
For most users, this project should be installed via your conda.yaml or package.yaml within a Robocorp automation task package or action server package under your pip dependancies. For example:
conda:
channels:
- conda-forge
dependencies:
- python=3.9.16
- pip=22.1.2
- pip:
- robocorp==1.6.2
- robocorp-planhat==1.0.0
Alternatively, you can use your preferred installation method to install the package directly from PyPI.
Getting started
To use the Planhat API, you will need to have a Planhat account and an API key. You can find your API key in the Planhat web application under Settings > Service Accounts. You will need to create a new service account and generate an API key.
Once you have your API key, you can use the Planhat API SDK to authenticate and retrieve data from Planhat. Here is an example of how to use the Planhat API SDK to retrieve a list of companies:
from planhat import Planhat, types as ph_types
# Create a Planhat client
client = Planhat(api_key="your-api-key")
# Retrieve a list of Companies
companies = client.get_objects(ph_types.Company)
# Print the names of the companies
for company in companies:
print(company.name)
Using Control Room Vault
When used in conjunction with the Robocorp Python Automation Framework, you can use Robocorp's Control Room Vault to store your Planhat API key. This is a secure way to store your API key and access it from your Robocorp automation tasks. When creating the secret in the Control Room vault, it maust have the key api_key. Here is an example of how to use the Planhat API SDK with the Control Room Vault:
from robocorp.tasks import task
from planhat import Planhat, types as ph_types
@task
def get_companies():
# Create a Planhat client
client = Planhat(vault_secret_name="your-vault-secret-name")
# Retrieve a list of Companies
companies = client.get_objects(ph_types.Company)
# Print the names of the companies
for company in companies:
print(company.name)
Further documentation on how to use the Robocorp Python Automation Framework can be found on the Robocorp Docs site.
API Reference
Information on specific classes and methods can be found in the API Reference.
Changelog
See the CHANGELOG for a history of notable changes.
Metadata
Release files for robocorp-planhat 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| robocorp_planhat-1.0.0.tar.gz | 27.5 kB | Without provenance | Details for robocorp_planhat-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| robocorp_planhat-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for robocorp_planhat-1.0.0-py3-none-any.whl |
Total release size: 56.1 kB
Release files / robocorp_planhat-1.0.0.tar.gz
| Download URL | robocorp_planhat-1.0.0.tar.gz |
|---|---|
| Size | 27.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca836172d524051a2ca2bb897ee7b2805386b9c3931da58fcaf5d53081080a54
|
|
BLAKE2b-256 checksum How to use checksums |
480790c9d68111a377935b0b7f2f7b2c9718ac5859ba937d46e4d10c153deac3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.9.13 Windows/10
|
Release files / robocorp_planhat-1.0.0-py3-none-any.whl
| Download URL | robocorp_planhat-1.0.0-py3-none-any.whl |
|---|---|
| Size | 28.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d9f0d90faa54d951e2e3e1ada401590e18960825b5d833e736b409ab118f653
|
|
BLAKE2b-256 checksum How to use checksums |
c495693c8e6c691b5c6a90ac83dae113f4f96a137decfda22e44743906847145
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.9.13 Windows/10
|
Security for robocorp-planhat 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.