Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add documentation on var functions #5

Open
JoshuaHarris391 opened this issue May 2, 2024 · 0 comments
Open

add documentation on var functions #5

JoshuaHarris391 opened this issue May 2, 2024 · 0 comments
Assignees

Comments

@JoshuaHarris391
Copy link
Collaborator

README for Scripts in var Directory (AI generated)

This README provides guidance on how to use the Python scripts located in the var directory of the Human 'Omics Data Sharing Field Guide repository. These scripts are crucial for data transformation and extraction tasks that support the website's functionality.

Scripts Overview

  1. tools_table_conversion.py - Converts a Google Sheets table to a YAML file used for the tools and resources section of the website.
  2. extract_zotero.py - Extracts references from a Zotero group library and saves them as a BibTeX file.

1. tools_table_conversion.py

This script fetches data from a specified Google Sheet and converts it into a YAML file that is then used to populate the tools and resources section on the website.

Usage

python var/tools_table_conversion.py

Details

  • Fetches data from a Google Sheet using its ID.
  • Filters and transforms the data.
  • Outputs the data to a YAML file located at _data/tool_and_resource_list.yml.

Example:

# Fetching and converting data
resource_table = pd.read_csv(url, dtype={'name': str, 'url': str, 'description': str, 'id': str, 'fairsharing': str,
                                         'biotools': str, 'tess': str, 'europmc': pd.Int64Dtype()})
resource_list = resource_table.to_dict("records")

2. extract_zotero.py

This script extracts references from a Zotero group library and outputs them as a BibTeX file, which is then used to manage citations on the website.

Usage

python var/extract_zotero.py --zot-library-id YOUR_ZOTERO_LIBRARY_ID

Details

  • Uses the Zotero API to fetch references.
  • Outputs the references to a file located at _bibliography/references.bib.

Example:

# Command line argument parsing
parser = argparse.ArgumentParser(prog='Zotero Extractor',
                                 description='Extracts the latest references from a zotero library and saves a '
                                             'bibtex file.')

Common Requirements

Both scripts require Python and several dependencies which can be installed via:

pip install -r requirements.txt

Dependencies include pandas, requests, and PyYAML.

Conclusion

These scripts are essential for maintaining up-to-date and dynamic content on the Human 'Omics Data Sharing Field Guide website. By automating the extraction and transformation of data from external sources like Google Sheets and Zotero, they significantly streamline the process of content updates.

@JoshuaHarris391 JoshuaHarris391 self-assigned this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant