Create Plants from CSV Data

 

CSV>PLNTS

Create Plants from CSV Data

Creates plants with data from a CSV file. Plant data is stored in plant.data. 


INPUTS

  • csv_path : Path to the csv file you wish to import.

  • names : Names of plants you would like to create. If None, plants will be randomly selected.

  • num : Number of random plants to get if no plant names are provided.

  • species_key : Name of the column that defines the species name. Default = Scientific Name

  • random : Whether to pull plants sequentially or randomly from the database. Default = True

  • <Q> : Query Instance defining search constraints

OUTPUTS

  • <P> : plants from csv file with basic attributes applied. All other plant data stored in plant.data

  • data : plant data in a readable string format


Plant Data Formating for CSV>PLNTS

Plant data formatting is largely based off of conventions in the ERA database.

dash or emdash

treats values on either side as a domain:

  • “3-5” = 3 to 5

Jan, Feb, Mar, etc

auto converts 3-letter month abbreviations and ranges to numbers:

  • “Jan”= 1.0

  • “Feb” = 2.0

  • “May, Jun, Aug” = 5.0, 6.0, 8.0

  • “Jan To Jun” = 1.0 to 6.0

  • “Jan-Jun” = 1.0 to 6.0

Parentheses

ignore values in parentheses (a great way of commenting in the data).

Square Brackets

ignores values in brackets as well (good for commenting in the data)

Color names

Many typical color names are translated directly into System color objects. See below. Will now also accept colors as hexidecimals (“#1234AF”) or as a tuple (“255, 200, 100”).

Comma

separates text into values that are treated like a set of possible values.

  • “Sun, Part Shade” = Sun OR Part Shade

Data Fields that automatically become plant attributes

**We hope to continue to update these to be more robust (and forgiving):

  • “Scientific Name” → plant name attribute

  • “Spread” → plant radius_current attribute (half of the spread value)

  • includes “Height” → plant height_current attribute

  • “Flower Color” → plant color attribute

Color names for “Flower Color” Data field

In addition to hexidecimal numbers, these color names will be automatically converted to ARGB System colors (not case dependent):

  • "white" = (255, 255, 255, 255)

  • "rose" or "rose-pink" = (255, 255, 181, 181)

  • "pink" = (255, 255, 255, 156)

  • "cream" = (255, 255, 213, 181)

  • "red" = (255, 255, 0, 0)

  • "orange" = (255, 255, 126, 0)

  • "gold" = (255, 255, 200, 0)

  • "yellow-gold" = (255, 255, 230, 0)

  • "yellow" = (255, 255, 255, 0)

  • "yellow-green" = (255, 200, 240, 15)

  • "green-yellow" = (255, 135, 220, 31)

  • "green" = (255, 70, 200, 44)

  • "palegreen" or "greenish" = (255, 140, 255, 88)

  • "blue" = (255, 89, 175, 255)

  • "bluish" or "lightblue" = (255, 210, 230, 255)

  • "violet" = (255, 64, 70, 255)

  • "purple" = (255, 143, 64, 255)

  • "blue-lavender" = (255, 149, 176, 255)

  • "lavender" = (255, 209, 176, 255)

  • "magenta" = (255, 255, 0, 255)

  • "maroon" = (255, 163, 10, 97)

  • "brown" = (255, 186, 83, 39)

Known tricks/Issues

  • a range of two real numbers like “2-1” is often read by Excel or Sheets() as a date like this: Feb, 1. This can be avoided by adding an empty set of parentheses after any range: “2-1 ()”. Or try emdashes.

  • emdashes can still mess us up sometimes, we are still identifying all cases.

← Back to the Components Reference Page

 

All Plant Data Components:

Previous
Previous

Create Plant List from Prompt BETA

Next
Next

Create Plant