Browse Source

setup.py: read long description from readme

Fabian Peter Hammerle 5 years ago
parent
commit
83782b5fbc
4 changed files with 62 additions and 4 deletions
  1. 1 0
      MANIFEST.in
  2. 44 0
      README.md
  3. 13 0
      pubmed_bibtex/__init__.py
  4. 4 4
      setup.py

+ 1 - 0
MANIFEST.in

@@ -0,0 +1 @@
+include README.md

+ 44 - 0
README.md

@@ -0,0 +1,44 @@
+# pubmed-bibtex
+
+Python Script & Module to Generate BibTeX Entries for PubMed Publications
+
+Utilizes the API of TeXMed, a BibTeX interface for PubMed.
+
+TeXMed was written by Arne Muller
+https://www.bioinformatics.org/texmed/
+
+## Install
+
+```sh
+pip3 install --user pubmed-bibtex
+```
+
+## Usage
+
+
+```sh
+$ pubmed-bibtex 31025164
+@Article{pmid31025164,
+   Author="...",
+   Title="...",
+   Journal="...",
+   ...
+}
+```
+
+or
+
+```python
+from pubmed_bibtex import bibtex_entry_from_pmid
+print(bibtex_entry_from_pmid(123456789))
+```
+
+## Tests
+
+```sh
+pip3 install --user pipenv
+git clone https://github.com/fphammerle/pubmed-bibtex.git
+cd pubmed-bibtex
+pipenv run pylint freesurfer_surface
+pipenv run pytest --cov=freesurfer_surface
+```

+ 13 - 0
pubmed_bibtex/__init__.py

@@ -6,6 +6,19 @@ a BibTeX interface for PubMed.
 
 TeXMed was written by Arne Muller
 https://www.bioinformatics.org/texmed/
+
+Command Line Example:
+$ pubmed-bibtex 31025164
+@Article{pmid31025164,
+   Author="...",
+   Title="...",
+   Journal="...",
+   ...
+}
+
+Python Example:
+>>> from pubmed_bibtex import bibtex_entry_from_pmid
+>>> print(bibtex_entry_from_pmid(123456789))
 """
 import html.parser
 import re

+ 4 - 4
setup.py

@@ -2,10 +2,9 @@ import os
 
 import setuptools
 
-import pubmed_bibtex
 
-
-LONG_DESCRIPTION = pubmed_bibtex.__doc__.lstrip()
+with open('README.md', 'r') as readme:
+    LONG_DESCRIPTION = readme.read()
 
 setuptools.setup(
     name='pubmed-bibtex',
@@ -14,7 +13,7 @@ setuptools.setup(
         # `version` triggers pylint C0103
         'write_to_template': "__version__ = '{version}'\n",
     },
-    description=LONG_DESCRIPTION.split(sep='\n', maxsplit=1)[0],
+    description='Generate BibTeX Entries for PubMed Publications',
     long_description=LONG_DESCRIPTION,
     author='Fabian Peter Hammerle',
     author_email='fabian@hammerle.me',
@@ -31,6 +30,7 @@ setuptools.setup(
         'reference',
         'research',
         'tex',
+        'texmed',
     ],
     classifiers=[
         'Development Status :: 4 - Beta',