semvec/pypi-packages huggingface dataset:
tavalidate 0.0.6
Utilities to help you validate and save Tavern response.

tavalidate, utilities to help you validate [Tavern](https://tavern.readthedocs.io/en/latest/) response.

Installation
------------

Tavalidate can be installed through pip.

```
pip install tavalidate
```

XML Validate
----

Tavern has great built-in Json support, but things are difficult when it comes to XML.
Use tavalidate.xmlv package to validate XML response.

XML validation example:

```
response:
  status_code: 200
  verify_response_with:
    function: tavalidate:assert_xml
    extra_kwargs:
      expected: |
        <foo attr="!anystr">
          <bar attr2="baz">!anyint</bar>
        </foo>
```

Simply put, pass the expected xml as an argument to the `tavalidate.xmlv.validate` function. The
function will validate the xml structure, node value and attribute value.

### extra_kwargs

Below are the supported extra kwargs of `tavalidate.xmlv.validate` function.

#### expected

This is the expected XML string.

You may use some (not all) of the tavern magic values to match data of your specified type:

- !anything: This matches value of any type.
- !anystr: Matches any string
- !anyint: Matches any integer
- !anyfloat: Matches any float
- !anybool: Matches any boolean

#### strict

Use `strict: True` if you want to make sure there's no extra tag in the response.

#### array

Since XML do not have the concept of array. When validating an array-like element, the same 
number of children of the same tag must exist. Regardless whether strict mode is used or not.
All element in corresponding order must match for the container to match.

XML Save
----

Use tavalidate.xmlv package to save XML response.

It allows you to use [XPath](https://en.wikipedia.org/wiki/XPath) to specify the value to save
inside the xml document. If the XPath somehow selects multiple nodes, tavalidate will print a
warning, but the first value will still be saved.

XML save example:

```
response:
  save:
    $ext:
      function: tavalidate:save_xml
      extra_kwargs:
        variables:
          bar: '/foo/bar/text()'
          at1: '/foo/@at1'
```


Logging
-------

Configure the logger `tavalidate` so you can see the response body and other logs in
DEBUG level.
co-citation 0.7
Create a co-citation graph from a list of papers
Requires Python: >=3.5, <4
Keywords: co-citation research literature-review

<!--
SPDX-License-Identifier: GPL-3.0-only
SPDX-FileCopyrightText: 2020 Vincent Lequertier <vi.le@autistici.org>
-->

# Co-citation graph generator

[![REUSE status](https://api.reuse.software/badge/gitlab.com/vi.le/co-citation)](https://api.reuse.software/info/gitlab.com/vi.le/co-citation)
[![pipeline status](https://gitlab.com/vi.le/co-citation/badges/master/pipeline.svg)](https://gitlab.com/vi.le/co-citation/-/commits/master)
[![PyPI version](https://img.shields.io/pypi/v/co-citation.svg)](https://pypi.python.org/pypi/co-citation)

Generate a co-citation graph from an article list in two steps:

1. Get the references of each article and their corresponding journals
2. Generate the co-citation pairs and add them the graph. The weights are the
   number of times the journals are co-cited.

## Example


```python
from co_citation import CoCitation

cites = CoCitation(
    [
        "arxiv:1602.05112",
        "pubmed:8113053",
        "sciencedirect:S0167923610001703",
        "scopus:10.1016/j.cmet.2020.11.014",
    ],
    data_type="journal", # or "article", "institution"
    wait=None, # None or the time to wait between requests (in seconds)
    retries=None, # None or the number of retries for HTTPS requests
    first_last_author=False, # Set to True to only get the institution of the first and last authors
    node_weights="eigenvector", # Or "betweenness"
)
cites.write_graph_edges("graph")
cites.plot_graph(
    display=False,
    k=10, # The spacing between the nodes
    seed=42, # Use the seed argument for reproducibility
    margin=dict(b=0, l=110, r=150, t=40)
)
```

## Documentation

See [the documentation](http://vi.le.gitlab.io/co-citation/).