Using the CLI

How to use Flower on the command-line.

Flower is designed to provide a friendly user experience from the command line. The CLI has commands for both viewing and building documentation from a Data Package’s metadata. The general pattern for how to use Flower from the CLI is:

Terminal
seedcase-flower COMMAND [ARGS] [OPTIONS]

To get started, try calling the program without any commands, arguments, or options by typing seedcase-flower and pressing enter. This is the same as invoking the --help flag and will show the following text:

Terminal
seedcase-flower
Usage: seedcase-flower COMMAND



Flower generates human-readable documentation from Data Packages.



╭─ Commands ───────────────────────────────────────────────────────────────────╮

│ <build>               Build human-readable documentation from a              │

│                       datapackage.json file.                                 │

│ <view>                Display the contents of a datapackage.json in a        │

│                       human-friendly way.                                    │

│ --help                Display this message and exit.                         │

│ --install-completion  Install shell completion for this application.         │

│ --version             Display application version.                           │

╰──────────────────────────────────────────────────────────────────────────────╯

Viewing Data Package metadata

To view the metadata of a Data Package directly in the terminal, you can use the view command like so:

Terminal
seedcase-flower view

This is what the above code chunk will output, assuming there is a file called datapackage.json in the working directory. Since it is designed for the terminal, it doesn’t look so nice when rendered on the website. We show this so you have an idea of what it will look like.


         flora: Observations of flora species and seasonal development          



Licenses:                                                                       



]8;id=383235;https://creativecommons.org/publicdomain/zero/1.0/legalcode\CCO 1.0 UNIVERSAL]8;;\                                                            

]8;id=699898;https://opensource.org/licenses/AFL-3.0\Academic Free License 3.0]8;;\                                                    



Version: 1.2.3                                                                  



A dataset containing flora species records and their observed growth stages     

across different environments.                                                  



Contributors                                                                    



Jane Dölitz (]8;id=136728;mailto:jane-doelitz@example.com\jane-doelitz@example.com]8;;\): creator                              

John Smith (]8;id=16880;mailto:john-smith@example.com\john-smith@example.com]8;;\): author, data collector                  



Resources                                                                       



species_catalog: Flora Species                                                  



This resource contains a catalog of flora species.                              



Path: resources/species_catalog/data.parquet                                 

Primary key: (species_id)                                                    

Foreign keys:                                                                

   From fields (parent_species_id) to fields (species_id) in resource        

      species_catalog                                                           



┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓

Title           Name              Type    Description                      

┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩

Species ID      species_id        integer The unique identifier for each   

                                          species.                         

Scientific name scientific_name   string  The Latin name of the species.   

Common name     common_name       string  The common name of the species.  

Family          family            string  The Latin family to which the    

                                          species belongs.                 

Parent Species  parent_species_id integer The parent species of this       

                                          species.                         

└────────────────┴──────────────────┴────────┴─────────────────────────────────┘



: Fields in the species_catalog resource.                                       



location_catalog: Flora Species Locations                                       



This resource contains a catalog of flora species locations.                    



Path: resources/location_catalog/data.parquet                                

Primary key: (region, country)                                               



┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓

Title      Name       Type   Description                                   

┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩

Region     region     string The region the location is in.                

Country    country    string The country the location is in.               

Local Name local_name string The name of the location in the local         

                             language.                                     

└───────────┴───────────┴───────┴──────────────────────────────────────────────┘



: Fields in the location_catalog resource.                                      



growth_records: Growth Stage Records                                            



This resource contains records of observed growth stages for various flora      

species.                                                                        



Path: resources/growth_records/data.parquet                                  

Primary key: (record_id)                                                     

Foreign keys:                                                                

   From fields (species_id) to fields (species_id) in resource               

      species_catalog                                                           

   From fields (location_region, location_country) to fields (region,        

      country) in resource location_catalog                                     



┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓

Title            Name             Type    Description                      

┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩

Record ID        record_id        integer The unique identifier for each   

                                          growth record.                   

Species          species_id       integer The species the observation was  

                                          made for.                        

Observation date observation_date date    The date when the observation was

                                          made.                            

Growth Stage     growth_stage     string  The observed growth stage of the 

                                          species.                         

Location Region  location_region  string  The region of the location.      

Location Country location_country string  The country of the location.     

└─────────────────┴─────────────────┴────────┴─────────────────────────────────┘



: Fields in the growth_records resource.                                        

The view command displays the metadata in an easy to read format that is optimized for display directly in the Terminal.

Working with a Data Package in a custom location

By default, view looks for a datapackage.json file in the current directory, but you can specify a different path if desired:

Terminal
seedcase-flower view another/directory/datapackage.json

It also is possible to point Flower to a Data Package that is available online. To do this, you can provide the full URL to the remote datapackage.json, e.g.

Terminal
seedcase-flower view https://raw.githubusercontent.com/seedcase-project/example-seed-beetle/refs/heads/main/datapackage.json

This is what the above code chunk will output. Since it is designed for the terminal, it doesn’t look so nice when rendered on the website. We show this so you have an idea of what it will look like.


  example-seed-beetle: Complex mitonuclear interactions and metabolic costs of  

                          mating in male seed beetles                           



Licenses:                                                                       



]8;id=609745;https://creativecommons.org/publicdomain/zero/1.0/legalcode\CCO 1.0 UNIVERSAL]8;;\                                                            



Version: 0.3.0                                                                  



Data from the 2015 on metabolic rate, respiratory quotient, body weight and     

ejaculate weight data from seed beetles with different mitonuclear genotypes.   



This repository shows how to use the Seedcase Sprout tools on a data set of seed

beetle data. The data is from a study by ]8;id=353013;https://onlinelibrary.wiley.com/doi/10.1111/jeb.12789\Immonen et al.]8;;\]8;id=353013;https://onlinelibrary.wiley.com/doi/10.1111/jeb.12789\ ]8;;\]8;id=353013;https://onlinelibrary.wiley.com/doi/10.1111/jeb.12789\(2015)]8;;\ and is available 

on ]8;id=891537;https://zenodo.org/records/4932381\Zenodo]8;;\.                                                                      



Contributors                                                                    



Elina Immonen: creator                                                       

Johanna Liljestrand-Rönn: creator                                            

Christopher Watson: creator                                                  

David Berger: creator                                                        

Göran Arnqvist: creator                                                      



Resources                                                                       



metabolic-rate: Metabolic rate of the seed beetles                              



This dataset contains metabolic rate, respiratory quotient, body weight and     

ejaculate weight data from seed beetles with different mitonuclear genotypes.   



Path: resources/metabolic-rate/data.parquet                                  

Primary key: (id)                                                            



┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓

Title                 Name                   Type    Description           

┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩

Cycle                 cycle                  integer Focal cycle in the    

                                                     respirometry. Note    

                                                     that the number one   

                                                     here corresponds to   

                                                     the real cycle number 

                                                     two, as the first one 

                                                     was removed as a      

                                                     burn-in. Original     

                                                     field name: CYCLE.    

O2 consumed           o2_consumed            number  Original field name:  

                                                     O2.                   

CO2 produced          co2_produced           number  Original field name:  

                                                     CO2.                  

Respiratory quotient  respiratory_quotient   number  Original field name:  

                                                     RQ.                   

Block                 block                  string  Experimental block.   

                                                     Original field name:  

                                                     BLOCK.                

Activity              activity               number  Original field name:  

                                                     ACTIVITY.             

Strain                strain                 string  Line identity.        

                                                     Original field name:  

                                                     STRAIN.               

Mitochondrial DNA     mitochondrial_dna_lin… string  Original field name:  

lineage                                              MT_DNA_HAPLOTYPE.     

Nuclear lineage       nuclear_lineage        string  Original field name:  

                                                     NC_GENOTYPE.          

Mating treatment      mating_treatment       string  Mated or virgin.      

                                                     Original field name:  

                                                     TREATMENT.            

Coadaptation          coadaptation           integer Coadaptation of the   

                                                     mitochondrial and     

                                                     nuclear lineage       

                                                     genomes. Original     

                                                     field name: COEVOL.   

Virgin body weight    virgin_body_weight     number  Unit: g. Original     

                                                     field name: W_V.      

Body weight after     body_weight_after_mat… number  Body weight after     

mating                                               mating, prior to      

                                                     respirometry          

                                                     measurements. Unit: g.

                                                     Original field name:  

                                                     W_M1.                 

Mated body weight     mated_body_weight_aft… number  Mated male body weight

after respirometry                                   after the             

                                                     respirometry, prior to

                                                     second mating. Unit:  

                                                     g. Original field     

                                                     name: W_M1R.          

Ejaculate weight in   ejaculate_weight_firs… number  Unit: g. Original     

the first mating                                     field name: EJAC1.    

Ejaculate weight in   ejaculate_weight_seco… number  Unit: g. Original     

the second mating                                    field name: EJAC2.    

Copulation duration   copulation_duration_f… number  Unit: sec. Original   

of the first mating                                  field name:           

                                                     COPULDUR_1.           

Copulation duration   copulation_duration_s… number  Unit: sec. Original   

of the second mating                                 field name:           

                                                     COPULDUR_2.           

ID                    id                     integer Experimental subject  

                                                     identity. Original    

                                                     field name: ID.       

└──────────────────────┴───────────────────────┴────────┴──────────────────────┘



: Fields in the metabolic-rate resource.                                        

For Data Packages on GitHub (like for the URL used above), you can use the gh: prefix as a shortcut. For example, the long URL above can be shortened to the following:

Terminal
seedcase-flower view gh:seedcase-project/example-seed-beetle

This is what the above code chunk will output. Since it is designed for the terminal, it doesn’t look so nice when rendered on the website. We show this so you have an idea of what it will look like.


  example-seed-beetle: Complex mitonuclear interactions and metabolic costs of  

                          mating in male seed beetles                           



Licenses:                                                                       



]8;id=686736;https://creativecommons.org/publicdomain/zero/1.0/legalcode\CCO 1.0 UNIVERSAL]8;;\                                                            



Version: 0.3.0                                                                  



Data from the 2015 on metabolic rate, respiratory quotient, body weight and     

ejaculate weight data from seed beetles with different mitonuclear genotypes.   



This repository shows how to use the Seedcase Sprout tools on a data set of seed

beetle data. The data is from a study by ]8;id=587740;https://onlinelibrary.wiley.com/doi/10.1111/jeb.12789\Immonen et al.]8;;\]8;id=587740;https://onlinelibrary.wiley.com/doi/10.1111/jeb.12789\ ]8;;\]8;id=587740;https://onlinelibrary.wiley.com/doi/10.1111/jeb.12789\(2015)]8;;\ and is available 

on ]8;id=300754;https://zenodo.org/records/4932381\Zenodo]8;;\.                                                                      



Contributors                                                                    



Elina Immonen: creator                                                       

Johanna Liljestrand-Rönn: creator                                            

Christopher Watson: creator                                                  

David Berger: creator                                                        

Göran Arnqvist: creator                                                      



Resources                                                                       



metabolic-rate: Metabolic rate of the seed beetles                              



This dataset contains metabolic rate, respiratory quotient, body weight and     

ejaculate weight data from seed beetles with different mitonuclear genotypes.   



Path: resources/metabolic-rate/data.parquet                                  

Primary key: (id)                                                            



┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓

Title                 Name                   Type    Description           

┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩

Cycle                 cycle                  integer Focal cycle in the    

                                                     respirometry. Note    

                                                     that the number one   

                                                     here corresponds to   

                                                     the real cycle number 

                                                     two, as the first one 

                                                     was removed as a      

                                                     burn-in. Original     

                                                     field name: CYCLE.    

O2 consumed           o2_consumed            number  Original field name:  

                                                     O2.                   

CO2 produced          co2_produced           number  Original field name:  

                                                     CO2.                  

Respiratory quotient  respiratory_quotient   number  Original field name:  

                                                     RQ.                   

Block                 block                  string  Experimental block.   

                                                     Original field name:  

                                                     BLOCK.                

Activity              activity               number  Original field name:  

                                                     ACTIVITY.             

Strain                strain                 string  Line identity.        

                                                     Original field name:  

                                                     STRAIN.               

Mitochondrial DNA     mitochondrial_dna_lin… string  Original field name:  

lineage                                              MT_DNA_HAPLOTYPE.     

Nuclear lineage       nuclear_lineage        string  Original field name:  

                                                     NC_GENOTYPE.          

Mating treatment      mating_treatment       string  Mated or virgin.      

                                                     Original field name:  

                                                     TREATMENT.            

Coadaptation          coadaptation           integer Coadaptation of the   

                                                     mitochondrial and     

                                                     nuclear lineage       

                                                     genomes. Original     

                                                     field name: COEVOL.   

Virgin body weight    virgin_body_weight     number  Unit: g. Original     

                                                     field name: W_V.      

Body weight after     body_weight_after_mat… number  Body weight after     

mating                                               mating, prior to      

                                                     respirometry          

                                                     measurements. Unit: g.

                                                     Original field name:  

                                                     W_M1.                 

Mated body weight     mated_body_weight_aft… number  Mated male body weight

after respirometry                                   after the             

                                                     respirometry, prior to

                                                     second mating. Unit:  

                                                     g. Original field     

                                                     name: W_M1R.          

Ejaculate weight in   ejaculate_weight_firs… number  Unit: g. Original     

the first mating                                     field name: EJAC1.    

Ejaculate weight in   ejaculate_weight_seco… number  Unit: g. Original     

the second mating                                    field name: EJAC2.    

Copulation duration   copulation_duration_f… number  Unit: sec. Original   

of the first mating                                  field name:           

                                                     COPULDUR_1.           

Copulation duration   copulation_duration_s… number  Unit: sec. Original   

of the second mating                                 field name:           

                                                     COPULDUR_2.           

ID                    id                     integer Experimental subject  

                                                     identity. Original    

                                                     field name: ID.       

└──────────────────────┴───────────────────────┴────────┴──────────────────────┘



: Fields in the metabolic-rate resource.                                        

Styling the output

If you would like to customize the style of how the metadata is displayed, you can use the --style flag. This option allows you to format the output with any of the built-in styles:

Terminal
seedcase-flower view --style quarto-one-page gh:seedcase-project/example-seed-beetle

The view command can use any of built-in styles that includes all output on a single page. It is not compatible with multi-page styles.

Important

If you have set the style option in a configuration file read by Flower, you might be confused as to why it does not have an effect when calling seedcase-flower view --style .... The reason for this is that the view command by design completely ignores any configuration read from Flower’s configuration file, even those with the same name as the options passed to view. You can only configure view via command line flags.

For more details about what you can do with view, see:

Terminal
seedcase-flower view --help
Usage: seedcase-flower view [ARGS]



Display the contents of a datapackage.json in a human-friendly way.



╭─ Parameters ─────────────────────────────────────────────────────────────────╮

│ --source <SOURCE>  The location of a datapackage.json, defaults to a file or │

│                    folder path. Can also be an https: source to a remote     │

│                    datapackage.json or a github: / gh: pointing to a repo    │

│                    with a datapackage.json in the repo root (in the format   │

│                    gh:org/repo, which can also include reference to a tag or │

│                    branch, such as gh:org/repo@main or gh:org/repo@1.0.1).   │

│                    [default: datapackage.json]                               │

│ --style <STYLE>    The style used to display the output in the terminal.     │

│                    Must be a single-page style.                              │

│                    [choices: quarto-one-page]                                │

│                    [default: quarto-one-page]                                │

╰──────────────────────────────────────────────────────────────────────────────╯

Building documentation from Data Package metadata

In addition to viewing metadata in the terminal, Flower converts Data Package metadata into a set of plain text files that are more human-friendly than the datapackage.json. These files can be used to build a website for the documentation which can make your Data Package’s metadata more easily discoverable and readable. You can generate this set of files with the build command:

Terminal
seedcase-flower build

This is what the above code chunk will output, assuming there is a file called datapackage.json in the working directory and changing the output directory to be _temp/ (for website build purposes).

This command generates one new file: docs/index.qmd. The qmd extension means that this file is a Quarto-flavored Markdown file. While this is the default text format, you can change it by specifying your own custom templates as detailed in the configuration section of this guide. Later in this guide, you will also see how you can generate more than one file by using different styles with build.

Changing input and output directory

By default, build will look for a datapackage.json file in the current directory, but you can use a different source location if you want (just like with view):

Terminal
seedcase-flower build another/directory/datapackage.json

To generate files in a different location, use the --output-dir flag with a folder name. For example:

Terminal
seedcase-flower build --output-dir my-dir

This will generate my-dir/index.qmd instead of docs/index.qmd.

Styling the output

Just like the view command, the build command accepts a --style option. This lets you choose how the metadata are organized according to one of the built-in styles. For example, to split the metadata for each resource in the Data Package into its own file, you can use the quarto-resource-listing style:

Terminal
seedcase-flower build --style quarto-resource-listing

This is what the above code chunk will output, assuming there is a file called datapackage.json in the working directory and changing the output directory to be _temp/ (for website build purposes).

Like the default output style is quarto-one-page, the quarto-resource-listing style creates docs/index.qmd but it also creates a separate file for the data resource in the docs/resources/ folder, for example docs/resources/seed-beetle-metabolic-rate.qmd. You can read more about the available default styles and how to create your own custom style in the configuration section of the documentation.