---
description: >-
  The participants object used for fetching information about individual survey
  user data. It automatically creates a Pandas DataFrame in the background of
  the process.
---

# Participants

## `egytech_api.core.Participants(`[`egytech_api.models.ParticipantsQueryParams`](https://abdulrahman-mustafa.gitbook.io/egytech-fyi-python-wrapper/reference/api-reference/participantsqueryparams)`)`

## Attributes

<table data-full-width="false"><thead><tr><th width="201">Name</th><th width="94">Type</th><th>Description</th><th>Allowed Values</th></tr></thead><tbody><tr><td>title [Optional]</td><td>string</td><td>The job title of requested participants.</td><td><p>['ai_automation',</p><p>'backend',</p><p>'crm',</p><p>'data_analytics',</p><p>'data_engineer',</p><p>'data_scientist',</p><p>'devops_sre_platform',</p><p>'embedded',</p><p>'engineering_manager',</p><p>'executive',</p><p>'frontend',</p><p>'fullstack',</p><p>'hardware',</p><p>'mobile',</p><p>'product_manager',</p><p>'product_owner',</p><p>'research',</p><p>'scrum', 'security',</p><p>'system_arch',</p><p>'technical_support',</p><p>'testing',</p><p>'ui_ux']</p></td></tr><tr><td>level [Optional]</td><td>string</td><td>The career level of requested participants.</td><td><p>['c_level',</p><p>'director',</p><p>'group_product_manager',</p><p>'intern',</p><p>'junior', 'manager',</p><p>'mid_level',</p><p>'principal',</p><p>'senior',</p><p>'senior_manager',</p><p>'senior_principal',</p><p>'senior_staff', </p><p>'staff',</p><p>'team_lead',</p><p>'vp']</p></td></tr><tr><td>min_yoe [Optional]</td><td>integer</td><td>The minimum years of experience for participants to be included in the query results.</td><td>Integer <strong>between 0 and 20</strong></td></tr><tr><td>max_yoe [Optional]</td><td>integer</td><td>The maximum years of experience for participants to be included in the query results.</td><td>Integer <strong>between 1 and 26</strong>.</td></tr><tr><td>gender [Optional]</td><td>string</td><td>The gender of participants included in the query results.</td><td><p>['male',</p><p>'female']</p></td></tr><tr><td>cs_degree [Optional]</td><td>boolean</td><td>Whether the included participants have a computer science degree or not.</td><td>True,<br>False</td></tr><tr><td>business_market [Optional]</td><td>string</td><td>The market scope of the included participants' companies.</td><td><p>['global',</p><p>'regional',</p><p>'local']</p></td></tr><tr><td>business_size [Optional]</td><td>string</td><td>The size of the included participants' companies. </td><td><p>['large',</p><p>'medium',</p><p>'small']</p></td></tr><tr><td>business_focus [Optional]</td><td>string</td><td>The primary business focus of the included participants' companies.</td><td><p>['product',</p><p>'software_house']</p></td></tr><tr><td>business_line [Optional]</td><td>string</td><td>The business line the participants' companies operate in. </td><td><p>['b2b',</p><p>'b2c',</p><p>'both']</p></td></tr><tr><td>include_relocated [Optional]</td><td>boolean</td><td>Include participants who have relocated.</td><td>True,<br>False</td></tr><tr><td>include_remote [Optional]</td><td>boolean</td><td>Include participants who work remotely for companies abroad.</td><td>True,<br>False</td></tr></tbody></table>

{% hint style="info" %}
Note: Attribute ordering on instance creation doesn't matter. Although not recommended, a dictionary can also be used instead of attributes to create a [`Participants`](https://abdulrahman-mustafa.gitbook.io/egytech-fyi-python-wrapper/reference/api-reference/participants) instance.
{% endhint %}

{% hint style="info" %}
**Note:** The supported values for query parameters in the API call differ with `cs_degree` vs `include_relocated` and `include_remote`. Allowed user inputs are boolean, as all of them have 2 possible values. At pydantic model serialization level (the step that produces the dictionary to-be-used for the API call query parameters), this is fixed and only egytech fyi api-supported values are used.
{% endhint %}

## Methods

### `get_df()`

Returns a [`pandas.DataFrame`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) instance of the fetched data.

#### Parameters

No parameters

#### Returns

<table><thead><tr><th width="226">Type</th><th>Description</th></tr></thead><tbody><tr><td><a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html"><code>pandas.DataFrame</code></a></td><td>A <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html"><code>pandas.DataFrame</code></a> instance containing the fetched data as one row per fetched participant survey.</td></tr></tbody></table>

### `save_csv(filename: str)`

#### Parameters

<table><thead><tr><th width="116">Name</th><th width="84">Type</th><th width="311">Description</th><th>Example</th></tr></thead><tbody><tr><td>filename</td><td><code>str</code></td><td>The name of the <code>.csv</code> file to dump the fetched data in <strong>(without extension)</strong>. No extension is needed explicitly as it's added during the file-saving process.</td><td>"my_awesome_data"</td></tr></tbody></table>

#### Returns

`None`

{% hint style="info" %}
This method is simply a placeholder for the [`pandas.DataFrame.to_csv()`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html) method. It simply saves the generated [`pandas.DataFrame`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) instance to a `.csv` file and excludes the index. You can customize your own function parameters for this by simply calling the [`get_df()`](https://abdulrahman-mustafa.gitbook.io/egytech-fyi-python-wrapper/reference/api-reference/participants#get_df) method, and manipulating the resulting [`pandas.DataFrame`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) as you want.
{% endhint %}

### `save_excel(filename: str)`

#### Parameters

<table><thead><tr><th width="116">Name</th><th width="84">Type</th><th width="311">Description</th><th>Example</th></tr></thead><tbody><tr><td>filename</td><td><code>str</code></td><td>The name of the <code>.xlsx</code> file to dump the fetched data in <strong>(without extension)</strong>. No extension is needed explicitly as it's added during the file-saving process.</td><td>"my_awesome_data"</td></tr></tbody></table>

#### Returns

`None`

{% hint style="info" %}
This method is simply a placeholder for the [`pandas.DataFrame.to_excel()`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_excel.html) method. It simply saves the generated [`pandas.DataFrame`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) instance to a `.xlsx` file and excludes the index. You can customize your own function parameters for this by simply calling the [`get_df()`](https://abdulrahman-mustafa.gitbook.io/egytech-fyi-python-wrapper/reference/api-reference/participants#get_df) method, and manipulating the resulting [`pandas.DataFrame`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) as you want.
{% endhint %}

{% hint style="info" %}
This function uses `"xlsxwriter"` as the excel writer engine by default. Customization is available by calling [`to_excel()`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_excel.html) on a [`pandas.DataFrame`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) instead.
{% endhint %}
