New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

workday

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workday

Python client for Workday tenants

  • 0.4.0
  • PyPI
  • Socket score

Maintainers
1

Python client for Workday

This is a Python client (2.7 or 3.4+) for communicating with one of the Workday XML/SOAP APIs.

PyPI version Build Status Code style: black

Features

This client

  • facilitates the authentication to a Workday SOAP API (Workday Web Services) and the parsing of data.
  • supports Anonymous, Basic HTTP and WS-Security (which is the prefered configuration in Workday)
  • allows the setup of multiple WWS endpoints
  • native paging support for all responses from the API using Python iterators

Configuring WSDLs

The first parameter of the WorkdayClient constructor is a dictionary. This dictinary contains all the APIs you want to access and the endpoints of them.

The key used in the dictionary will then become a property of the client instance with the methods for that API.

import workday

apis = {
    'talent': 'https://workday.com/tenant/434$sd.xml',
    'hcm': 'https://workday.com/tenant/hcm$sd.xml'
}

client = workday.WorkdayClient(
    wsdls=apis, 
    authentication=... 
    )

users = client.hcm.Get_Users()

Any calls to an API method will return an instance of workday.client.WorkdayResponse.

If you want to page results, an instance of WorkdayResponse is iterable, for example:

results = []
for certs in client.talent.Get_Certifications():  # Loops over all available pages
    results.extend(certs.data['Certification'])
print(results)

The data will be in the data property of any API response.

Authentication Examples

All authentication methods are in the workday.auth module and the instance of them should be passed to the WorkdayClient constructor as the authentication argument.

No authentication

from workday.auth import AnonymousAuthentication

anon = AnonymousAuthentication()

client = workday.WorkdayClient(
    authentiation=anon,
    ...
)

WS-Security username/password

from workday.auth import WsSecurityCredentialAuthentication

auth = WsSecurityCredentialAuthentication('my_user@tenant_name', 'mypassword')

client = workday.WorkdayClient(
    authentiation=auth,
    ...
)

WS-Security X509-only authentication

from workday.auth import WsSecurityCertificateAuthentication

auth = WsSecurityCertificateAuthentication('/path/to/private.key', '/path/to/public.key')

client = workday.WorkdayClient(
    authentiation=auth,
    ...
)
from workday.auth import WsSecurityCertificateCredentialAuthentication

auth = WsSecurityCertificateCredentialAuthentication(
    'user@tenant',
    'password',
    '/path/to/private.key',
    '/path/to/public.key')

client = workday.WorkdayClient(
    authentiation=auth,
    ...
)

Example

This simple example returns a list of dictionaries back from the Workday API for each configured language.


import workday
from workday.auth import WsSecurityCredentialAuthentication

client = workday.WorkdayClient(
    wsdls={'talent': 'https://workday.com/tenant/434$sd.xml'}, 
    authentication=WsSecurityCredentialAuthentication(config['user'], config['password']), 
    )

print(client.talent.Get_Languages().data)

Credits

This module was written by Anthony Shaw at Dimension Data

Contributions

Always welcome. See CONTRIBUTING.rst

======= History

0.4.0 (2018-06-27)

  • Implemented paging by making WorkdayResponse objects iterable

0.3.0 (2018-06-23)

  • Added test framework, setup package for distribution

0.2.0 (2018-06-22)

  • WS-Security support
  • Protected WSDL support
  • Paging support

0.1.0 (2018-06-22)

  • First release on PyPI.
  • Template for Talent API (SOAP) method execution

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc