Skip to content

Campaigns

Each session belongs to a group of sessions called campaigns. camera trap sessions in a campaign are generally set up in the same way and the same monitoring intention.

Table Set Up

Column Name Content Type Unique Nullable Custom Constraints Linked Table
ID ID for Entry Integer True False
Name Name of the Campaign String(100) True False
Organization Organization the Campaign belongs to Integer False False Organization ("ID")
Info information about the set up and intention of the campaing String(300) False True

Common Campaigns

standard monitoring

Camera Traps are set up all over the park with no specific research goal besides taking an inventory of animal presence.

Functions

Test code for each function of the Campaigns table is shown in Functions_Campaign.ipynb

In order to use the class functions, an instance of the class needs to be created

import T_Tables as tableClasses

#create class instance
Campaigns = tableClasses.T_Campaigns()

add

This function adds a campaign to the database.

Campaigns.add(name: str, organization: str, info=None)

Parameters

  • name: unique name of the campaign
  • organization: organization the campaign belongs to
  • info: information about the set up and intention of the campaing

Returns

The function returns nothing.

delete

This function deletes a a campaign from the database. Note, that a campaign cannot be deleted if it has a session assigned to it.

Campaigns.delete(name: str)

Parameters

  • name: name of the campaign you wish to delete

Returns

The function returns nothing.

update

This function allows you to update information of a given column for one entry

Campaigns.update(name, colName: str, value)

Parameters

  • name: name of the campaign you wish to update
  • colName: name of the column where you wish to update the value
  • value: new value of given column. Make sure that the value matched the data type of the column

Returns

The function returns nothing.

get

This function gets all information for one campaign.

Campaigns.get(name: str)

Parameters

  • name: name of the campaign you wish to get information for

Returns

This function returns a pd.dataframe with one row.

getAll

This function gets all information for a all campaigns.

Campaigns.getAll()

Parameters

This Function has no parameters.

Returns

This function returns a pd.dataframe with one row for each documented campaign.

getOrganizationCampaigns

This functions gets all campaigns that belong to a specified organization

Campaigns.getOrganizationCampaigns(organization: str)

Parameters

  • organization: name of the organization of which you wish to get the campaigns.

Returns

This function returns a pd.dataframe with one row for each documented campaign of the organization.