Metadata-Version: 2.4
Name: univtil
Version: 1.0.0
Summary: Utility library for academic work — converts RIS and NBIB reference files to BibTeX
Author-email: Linqa Kiriyama <kiriyamalq@gmail.com>
License: MIT License
        
        Copyright (c) 2026 QNiLix
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/qnilix/univtil
Project-URL: Documentation, https://univtil.readthedocs.io/
Project-URL: Repository, https://github.com/qnilix/univtil.git
Project-URL: Bug Tracker, https://github.com/qnilix/univtil/issues
Project-URL: Changelog, https://github.com/qnilix/univtil/blob/main/CHANGELOG.md
Keywords: bibliography,bibtex,ris,nbib,pubmed,academic
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Text Processing
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# univtil

A Python utility library for academic work, focused on processing bibliographic reference files.

## Features

- Parse **RIS** (Research Information Systems) files and convert them to BibTeX
- Parse **NBIB** (PubMed/NLM) files and convert them to BibTeX
- Handles multiple entries per file
- Automatic BibTeX entry-type mapping (article, book, inproceedings, etc.)
- Auto-generated citation keys from author name and year

## Installation

Clone the repository and add it to your Python path:

```bash
python -m pip install univtil
```

## Usage

### RIS → BibTeX

```python
from univtil.bib.ris import RIS, rislist

# Single entry
with open("paper.ris") as f:
    text = f.read()

ref = RIS(text)
print(ref.tobib())

# Multiple entries in one file
refs = rislist(text)
for ref in refs:
    print(ref.tobib())
    print()
```

### NBIB (PubMed) → BibTeX

```python
from univtil.bib.nbib import NBib, nbiblist

with open("results.nbib") as f:
    text = f.read()

# Single entry
ref = NBib(text)
print(ref.tobib())

# Multiple entries
refs = nbiblist(text)
for ref in refs:
    print(ref.tobib())
    print()
```

## Supported entry types

| Source type | BibTeX entry |
| --- | --- |
| Journal article / Review | `@article` |
| Book | `@book` |
| Book chapter | `@inbook` |
| Conference paper | `@inproceedings` |
| Thesis | `@phdthesis` |
| Technical report | `@techreport` |
| Other | `@misc` |

## License

MIT License — see [LICENSE](LICENSE).
