Add a setup.py file and __init__.py for module and submodules

Esse commit está contido em:
Lucas Verney 2016-01-25 17:56:34 +01:00
commit f5183a1d11
9 arquivos alterados com 84 adições e 0 exclusões

3
.gitignore externo
Ver arquivo

@ -2,3 +2,6 @@ __pycache__
docs/build
.cache
libbmc/external/cermine.jar
build/
dist/
*.egg-info/

9
LICENSE Normal file
Ver arquivo

@ -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.

Ver arquivo

@ -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

Ver arquivo

@ -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"
]

Ver arquivo

@ -0,0 +1,5 @@
from . import bbl, bibtex, pdf, plaintext
__all__ = [
"bbl", "bibtex", "pdf", "plaintext"
]

Ver arquivo

@ -0,0 +1,7 @@
from . import identifiers
# TODO: Include tearpages
__all__ = [
"identifiers"
]

Ver arquivo

@ -0,0 +1,5 @@
from . import arxiv, hal
__all__ = [
"arxiv", "hal"
]

Ver arquivo

@ -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

41
setup.py Normal file
Ver arquivo

@ -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
)