semvec/pypi-packages huggingface dataset:
addbioschemas 1.0.2
A markdown extension to add bioschemas markup to rendered html

# Adding bioschemas to mkdocs

A small markdown extension to add bioschemas to mkdocs. It requires a yaml or json file with bioschemas markup, and adds it to the rendered html. 

## Installation

```bash
pip install addbioschemas
```

To use the plugin simply add `addbioschemas` to the list of plugins in `mkdocs.yml`:

```yml
markdown_extensions:
  - addbioschemas
```

## Usage

### Option 1: add the bioschemas file name to the markdown file

Simply add `[add-bioschemas file='path/to/yaml/metadata.yaml']` to the markdown file where you want to add the bioschemas. This method supports multiple metadata files. 

A markdown snippet of a page where you want to add bioschemas to:

```markdown
# awesome title
[add-bioschemas file='path/to/yaml/metadata.yaml']
I started with some YAML and turned it into JSON-LD
```

**Important**: If you are using [mkdocs-material](https://squidfunk.github.io/mkdocs-material/), make sure there is markdown before the insertion of `[add-bioschemas]`. Otherwise, other plugins will add incorrect tags to the json-LD chunk. 

The contents of `path/to/yaml/metadata.yaml` use the bioschemas properties:

```yaml
"@context": https://schema.org/
"@type": LearningResource
"@id": https://elixir-europe-training.github.io/ELIXIR-TrP-LessonTemplate-MkDocs/
http://purl.org/dc/terms/conformsTo:
  "@type": CreativeWork
  "@id": https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE
description: Template for ELIXIR lessons
keywords: FAIR, OPEN, Bioinformatics, Teaching
name: ELIXIR Training Lesson template
# lookup at https://spdx.org/licenses/
license: CC-BY-4.0
author:
- "@type": Person
  name: Geert van Geest
  email: geert.vangeest@sib.swiss
  github: GeertvanGeest
  orcid: 0000-0002-1561-078X
- "@type": Person
  name: Elin Kronander
  github: elinkronander
  orcid: 0000-0003-0280-6318
```

`addbioschemas` also supports the json format. 

### Option 2: add the bioschemas file name to mkdocs.yml

Specify the path to the yaml file in `mkdocs.yml`. This method only supports one metadata file.

Add to `mkdocs.yml`:

```yaml
markdown_extensions:
  - addbioschemas:
      metadata: 'path/to/yaml/metadata.yaml'
```

A markdown snippet of a page where you want to add bioschemas to:

```markdown
# awesome title
[add-bioschemas]
I started with some YAML and turned it into JSON-LD
```


**Important**: If you are using [mkdocs-material](https://squidfunk.github.io/mkdocs-material/), make sure there is markdown before the insertion of `[add-bioschemas]`. Otherwise, other plugins will add incorrect tags to the json-LD chunk.
impc-api-helper 0.1.0
A package to facilitate making API requests to the IMPC Solr API
Requires Python: >=3.10

# IMPC-API-HELPER
Name is a work in progress, we can think of something nicer

README for draft impc-api python package.

The functions in this package are intended for use on a Jupyter Notebook.

## Installing the package for the first time
1. Clone the repository and navigate into it. Navigate into the package name until you can see `setup.py` and `pyproject.toml`
2. Run `python3 -m build`, this builds the package, a couple of new files/folders will appear.
3. Install the package running `pip install .`
4. Try it out: Go to Jupyter Notebook and some examples below:

### Avaialble functions
The available functions can be imported as:

`from impc_api_helper import solr_request, batch_request, facet_request, iterator_solr_request`

### Solr request
The most basic request to the IMPC solr API
```
num_found, df = solr_request( core='genotype-phenotype', params={
        'q': '*:*'
        'rows': 10
        'fl': 'marker_symbol,allele_symbol,parameter_stable_id'
    }
)
```

### Batch request
For larger requests, use the batch request function to query the API responsibly.
```
df = batch_request(
    core="genotype-phenotype",
    params={
        'q': 'top_level_mp_term_name:"cardiovascular system phenotype" AND effect_size:[* TO *] AND life_stage_name:"Late adult"',
        'fl': 'allele_accession_id,life_stage_name,marker_symbol,mp_term_name,p_value,parameter_name,parameter_stable_id,phenotyping_center,statistical_method,top_level_mp_term_name,effect_size'
    },
    batch_size=100
)
```

### Facet request
To obtain faceted search results for the specified field
```
num_found, df = facet_request(
    core='genotype-phenotype',
    params={
        'q': '*:*',
        'rows': 0,
        'facet': 'on',
        'facet.field': 'zygosity',
        'facet.limit': 15,
        'facet.mincount': 1
    }
)
```

### Iterator solr request
To pass a list of different fields and download a file with the information
```
# Genes example
genes = ["Zfp580","Firrm","Gpld1","Mbip"]

# Initial query parameters
params = {
    'q': "*:*",
    'fl': 'marker_symbol,allele_symbol,parameter_stable_id',
    'field_list': genes,
    'field_type': "marker_symbol"
}
iterator_solr_request(core='genotype-phenotype', params=params, filename='marker_symbol', format ='csv')
```