semvec/pypi-packages huggingface dataset:
xml-from-seq 0.3.3
Generate XML from Python data structure
License: MIT

# xml_from_seq

Generate XML from a Python data structure.

## Examples

The `XML()` function renders a Python list or tuple to an XML element. The first item is the
element name, the second item – if it's a dict – is the attributes, and the rest of the items
are either text or nested elements.
```py
from xml_from_seq import XML

item = ['item', {'attr1': 123, 'attr2': 'other value'}, 'This is the content of the item.']
assert XML(item) == '<item attr1="123" attr2="other value">This is the content of the item.</item>'

item = [
    'item',
    'This is some content of the item.'
    ['sub', 'This is the content of a subelement.']
]
print(XML(item))
```
```xml
 <item>
    This is some content of the item.
    <sub>
        This is the content of a subelement.
    </sub>
</item>
```

If an element is False or None it will be omitted. If a element's name is `None` its contents will
appear in its place. If an attribute's value is `None` it will be omitted.

If an element's name is a list or tuple, it will be inserted into the XML as-is – so you can
include already-rendered XML by double-bracketing it:
```py
print(XML([['<foo>123</foo>']]))
```
```xml
<foo>123</foo>
```

If an element's tag name is `xml_from_seq.CDATA`, that element's content will be rendered unescaped
in a `<![CDATA[...]]>` section.

### Indentation and line breaks

If the first item in an element (not counting an attribute dict) is `xml_from_seq.INLINE`, that
element's contents won't be indented on separate lines from the element's start and end tags.
```py
from xml_from_seq import INLINE, XML

item = [
    'item',
    'This is some content of the item.'
    ['sub', INLINE, 'This is the content of a subelement.']
]
print(XML(item))
```
```xml
 <item>
    This is some content of the item.
    <sub>This is the content of a subelement.</sub>
</item>
```

You can pass an integer `indent` parameter to the `XML()` function to indent the output XML by
that many tabs.
sparqldataframe 0.1.3
Get a Pandas dataframe from SPARQL queries
License: MIT

# sparqldataframe

[![image](https://img.shields.io/pypi/v/sparqldataframe.svg)](https://pypi.python.org/pypi/sparqldataframe)

A Python library that can send
[SPARQL](https://en.wikipedia.org/wiki/SPARQL) queries to a SPARQL
endpoint and retrieve a [Pandas](http://pandas.pydata.org/) dataframe
from the result.

# Installation

``` bash
pip install sparqldataframe
```

# Usage

Here is an example how to run a SPARQL query on the
[Wikidata](http://wikidata.org/) endpoint:

``` python
import sparqldataframe

sparql_query = """
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>

SELECT ?item ?itemLabel 
WHERE {
  ?item wdt:P31 wd:Q146.
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
  }
}
"""
df = sparqldataframe.query(
  "https://query.wikidata.org/sparql",
  sparql_query)
```

Wikidata and [DBPedia](http://dbpedia.org/) can be both used without
adding the SPARQL endpoint url by using the `wikidata_query()` and
`dbpedia_query()` functions respectively:

``` python
df = sparqldataframe.wikidata_query(sparql_query)
df = sparqldataframe.dbpedia_query(sparql_query)
```

# License

This project is licensed under the MIT license. See the
[LICENSE](LICENSE) for details.
aitrika 0.3.5.4
Enhance your knowledge in medical research.
License: MIT
Requires Python: <4.0,>=3.10

# AItrika

![AItrika](images/logo.png)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Enhance your knowledge in medical research.

AItrika (formerly PubGPT) is a tool that can extract lots of relevant informations inside medical papers in an easy way:

- Abstract
- Full text (when available)
- Genes
- Diseases
- Mutations
- Associations between genes and diseases
- MeSH terms
- Other terms
- Results
- Bibliography

And so on!

## 🚀 Run the demo app

You can try AItrika with the Streamlit app by running:

```
streamlit run app.py
```

Or you can use it a script by running:

```
python main.py
```

## 📦 Install

To install everything, you need `poetry`.

First of all, create a virtual environment with the command `python3 -m venv venv_name` and activate it with `source venv_name\bin\activate`.

After that, you can install poetry with the command `pip install poetry` and then run `poetry install`.

## 🔑 Set API Keys

In order to set API keys, insert your keys into the `env.example` file and rename it to `.env`.

## 🔍 Usage

You can easily get informations of a paper by passing a PubMed ID:

```python
from aitrika.engine.aitrika import OnlineAItrika
aitrika_engine = OnlineAItrika(pubmed_id=pubmed_id)
title = aitrika_engine.get_title()
print(title)
```

Or you can parse a local pdf:

```python
from aitrika.engine.aitrika import LocalAItrika
aitrika_engine = LocalAItrika(pdf_path = pdf_path)
title = aitrika_engine.get_title()
print(title)
```

```
Breast cancer genes: beyond BRCA1 and BRCA2.
```

You can get other informations, like the associations between genes and diseases:

```python
associations = aitrika_engine.associations()
```

```
[
  {
    "gene": "BRIP1",
    "disease": "Breast Neoplasms"
  },
  {
    "gene": "PTEN",
    "disease": "Breast Neoplasms"
  },
  {
    "gene": "CHEK2",
    "disease": "Breast Neoplasms"
  },
]
...
```

Or you can get a nice formatted DataFrame:

```python
associations = aitrika_engine.associations(dataframe = True)
```

```
      gene                          disease
0    BRIP1                 Breast Neoplasms
1     PTEN                 Breast Neoplasms
2    CHEK2                 Breast Neoplasms
...
```

With the power of RAG, you can query your document:

```python
## Prepare the documents
documents = generate_documents(content=abstract)

## Set the LLM
llm = GroqLLM(documents=documents, api_key=os.getenv("GROQ_API_KEY"))

## Query your document
query = "Is BRCA1 associated with breast cancer?"
print(llm.query(query=query))
```

```
The provided text suggests that BRCA1 is associated with breast cancer, as it is listed among the high-penetrance genes identified in family linkage studies as responsible for inherited syndromes of breast cancer.
```

## License

AItrika is licensed under the MIT License. See the LICENSE file for more details.

## TODO

- [ ] Create documentation
- [ ] Add docstrings
- [ ] Create Python package