Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/siddhant-k-code/greenhouse-data-exporter

Python script to export greenhouse data to csv
https://github.com/siddhant-k-code/greenhouse-data-exporter

data-export data-extraction gitpod greenhouse harvest-api python

Last synced: 1 day ago
JSON representation

Python script to export greenhouse data to csv

Awesome Lists containing this project

README

        

# Greenhouse Data Export Script 📊

This project provides a Python script to fetch and export candidate data from Greenhouse.io using their Harvest API. The script collects candidate details, notes, scorecards, attributes, and questions, then saves this data into a CSV file. Finally, the CSV file is converted into an Excel file for easy access and analysis.

## Features ✨

- Fetch candidate applications after a specific date 📅
- Retrieve detailed candidate information including email addresses 📧
- Collect candidate notes and activity feed 📝
- Fetch and combine scorecards, attributes, and questions 📋
- Save the data into a CSV file and convert it to an Excel file 📂

## One-click setup ⚡️

You can run this in [Gitpod](https://www.gitpod.io):

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Siddhant-K-code/greenhouse-data-exporter)

## Manual setup 🐌

### Requirements 📦

- Python 3.6 or higher
- pandas
- requests
- openpyxl

1. **Clone the repository**:

```bash
git clone https://github.com/siddhant-k-code/greenhouse-data-exporter.git
cd greenhouse-data-exporter
```

2. **Install dependencies**:

```bash
pip install pandas requests openpyxl
```

## Usage 🚀

1. **Set your Greenhouse API token**:
Open the script `greenhouse_export.py` and set your API token in the `API_TOKEN` variable: ([docs ref](https://support.greenhouse.io/hc/en-us/articles/202842799-Create-an-API-key-in-Greenhouse-Recruiting))

```python
API_TOKEN = 'your_api_token_here'
```

2. **Run the script**:

```bash
python greenhouse_export.py
```

Then, you can convert the CSV file to an Excel file using the following command:

```bash
python csv_to_excel.py greenhouse_candidates_after_.csv
```

3. **Check the output**:
The script will create two files:

- `greenhouse_candidates_after_.csv`
- `greenhouse_candidates_after_.xlsx`

You can find these files in the project directory.

## Script Details 🔍

The script performs the following steps:

1. **Fetch Applications**:
Retrieves candidate applications created after a specified date from Greenhouse.

2. **Fetch Candidate Details**:
Collects email addresses and other candidate information.

3. **Fetch Notes**:
Gathers notes and activity feed for each candidate.

4. **Fetch Scorecards**:
Retrieves scorecards, attributes, and questions for each application.

5. **Combine Data**:
Merges notes, scorecards, attributes, and questions into a single string.

6. **Save to CSV and Excel**:
Writes the data into a CSV file and converts it to an Excel file.

## Example Output 📁

Here is an example of the output structure:

| Job opening id | Email address | Activity date | Notes |
| -------------- | -------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 12345 | [email protected] | 2024-03-24T00:00:00Z | Note 1 (Date: 2024-03-24T00:00:00Z)

Scorecard 1:
Overall Recommendation: yes Scorecard 2: Good

Attributes:
Communication: strong_yes

Questions:
Why do you want this job?: To make an impact |
| 67890 | [email protected] | 2024-03-25T00:00:00Z | Note 2 (Date: 2024-03-25T00:00:00Z) |

## Acknowledgments 🙌

- Thanks to Greenhouse.io for their [comprehensive API documentation](https://developers.greenhouse.io/harvest.html).