diff --git a/.gitignore b/.gitignore index da616d8..1ffc930 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ __pycache__ docs/build .cache libbmc/external/cermine.jar +build/ +dist/ +*.egg-info/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..188a2c5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2016 Phyks (Lucas Verney) + +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. diff --git a/README.md b/README.md index 1523854..3e85ac6 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,11 @@ install the matching software (`CERMINE`, `Grobid` or `pdf-extract`). See the docstrings of those functions for more infos on this particular point. +## License + +This code is licensed under an MIT license. + + ## Acknowledgements Thanks a lot to the following authors and programs for helping in building diff --git a/libbmc/__init__.py b/libbmc/__init__.py index a4e2017..926387a 100644 --- a/libbmc/__init__.py +++ b/libbmc/__init__.py @@ -1 +1,9 @@ +from . import bibtex, doi, fetcher, isbn +from . import citations, papers, repositories + __version__ = "0.1" + +__all__ = [ + "bibtex", "doi", "fetcher", "isbn", + "citations", "papers", "repositories" +] diff --git a/libbmc/citations/__init__.py b/libbmc/citations/__init__.py new file mode 100644 index 0000000..6f97ed4 --- /dev/null +++ b/libbmc/citations/__init__.py @@ -0,0 +1,5 @@ +from . import bbl, bibtex, pdf, plaintext + +__all__ = [ + "bbl", "bibtex", "pdf", "plaintext" +] diff --git a/libbmc/papers/__init__.py b/libbmc/papers/__init__.py new file mode 100644 index 0000000..7ba1b1f --- /dev/null +++ b/libbmc/papers/__init__.py @@ -0,0 +1,7 @@ +from . import identifiers + +# TODO: Include tearpages + +__all__ = [ + "identifiers" +] diff --git a/libbmc/repositories/__init__.py b/libbmc/repositories/__init__.py new file mode 100644 index 0000000..56cb85a --- /dev/null +++ b/libbmc/repositories/__init__.py @@ -0,0 +1,5 @@ +from . import arxiv, hal + +__all__ = [ + "arxiv", "hal" +] diff --git a/requirements.txt b/requirements.txt index 6faab09..8386216 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ bibtexparser>=0.6.2 isbnlib>=3.5.7 requests>=2.9.1 PySocks>=1.5.6 +#tear-pages>=0.2.2 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..215cd31 --- /dev/null +++ b/setup.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +try: + from setuptools import setup +except ImportError: + print('[libbmc] setuptools not found.') + raise + +with open('libbmc/__init__.py') as fh: + for line in fh: + if line.startswith('__version__'): + version = line.strip().split()[-1][1:-1] + break + +try: + from pip.req import parse_requirements + from pip.download import PipSession +except ImportError: + print('[libbmc] pip not found.') + raise + +# parse_requirements() returns generator of pip.req.InstallRequirement objects +parsed_requirements = parse_requirements("requirements.txt", + session=PipSession()) + +# reqs is a list of requirement +# e.g. ['django==1.5.1', 'mezzanine==1.4.6'] +install_requires = [str(ir.req) for ir in parsed_requirements] + +setup( + name='libbmc', + version=version, + url='https://github.com/Phyks/libbmc/', + author='Phyks (Lucas Verney)', + author_email='phyks@phyks.me', + license='MIT License', + description='A python library to deal with scientific papers.', + packages=['libbmc', + 'libbmc.citations', 'libbmc.papers', 'libbmc.repositories'], + install_requires=install_requires +)