Skip to content

An unofficial python SDK for the Bob HR platform.

License

Notifications You must be signed in to change notification settings

kurtismassey/pybob

 
 

Repository files navigation

PyBob

Code style: black

PyBob is an unofficial python SDK for the Bob API

Initialise

pip install pybob-sdk
from pybob_sdk import Bob

bob = Bob(
    service_account_id="YOUR_SERVICE_ACCOUNT_ID_HERE"
    service_account_token="YOUR_SERVICE_ACCOUNT_TOKEN_HERE"
)

Examples

Company search

# Search company people
employee = bob.people.search(
    fields=["root.id", "root.fullName", "root.email"],
    filters=[{
        "fieldPath": "root.email",
        "operator": "equals",
        "values": ["[email protected]"]
        }]
)

print(employee)

Output

{ 'employees' : [
    {
    'fullName': 'Anakin Skywalker', 
    '/root/email': {
        'value': '[email protected]'
        }, 
    '/root/fullName': {
        'value': 'Anakin Skywalker'
        }, 
    'email': '[email protected]', 
    '/root/id': {
        'value': '123456789'
        }, 
    'id': '123456789'
        }
    ] 
}

Employment history

# List employment history
results = bob.people.employee.list_employment_history(
    employeeId="123456789"
)

working_pattern = results["values"][0]["workingPattern"]["days"]

for day, hours in working_pattern.items():
    print(f"{day}: {hours}")

Output

monday: 7
tuesday: 7
wednesday: 7
thursday: 7
friday: 7
saturday: 0
sunday: 0

About

An unofficial python SDK for the Bob HR platform.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%