https://github.com/dribia/drifactorial
Python client for the Factorial API.
https://github.com/dribia/drifactorial
api-client hr hr-software human-resources python
Last synced: 2 months ago
JSON representation
Python client for the Factorial API.
- Host: GitHub
- URL: https://github.com/dribia/drifactorial
- Owner: dribia
- License: mit
- Created: 2022-01-05T13:04:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-25T13:56:28.000Z (over 1 year ago)
- Last Synced: 2025-07-27T17:01:44.075Z (2 months ago)
- Topics: api-client, hr, hr-software, human-resources, python
- Language: Python
- Homepage:
- Size: 676 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Python client for the Factorial API.---
**Documentation**: https://dribia.github.io/drifactorial
**Source Code**: https://github.com/dribia/drifactorial
---
[Factorial](https://factorialhr.com/) is a software dedicated to manage everything related to HR.
**Drifactorial** provides a tiny Python interface to the official API.
## Key features
* **Authorize programatic access** to your application.
* Obtain and refresh **access tokens**.
* Implements **generic GET and POST** methods.
* Parses responses to **Pydantic models**.
* Easily implement **additional methods**.## Example
The simplest example.
```python
from drifactorial import Factorial
from datetime import datetimefactorial = Factorial(access_token="abc")
# get list of employees
employees = factorial.get_employees()
# get list of company holidays
holidays = factorial.get_holidays()
# get list of leaves
leaves = factorial.get_leaves()
# get list of days off of an employee
daysoff = factorial.get_daysoff(employee_id=123)
# get list of all shifts in October 2021
shifts = factorial.get_shifts(year=2021, month=10)
# get single employee
single_employee = factorial.get_single_employee(employee_id=123)
# get my account
account = factorial.get_account()# clock in shift
clock_in = datetime(2021, 10, 1, 9, 0)
new_shift = factorial.clock_in(now=clock_in, employee_id=123)
# clock out shift
clock_out = datetime(2021, 10, 1, 13, 0)
updated_shift = factorial.clock_out(now=clock_in, employee_id=123)
```