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

このコミットが含まれているのは:
Lucas Verney 2016-01-25 17:56:34 +01:00
コミット f5183a1d11
9個のファイルの変更84行の追加0行の削除

3
.gitignore vendored
ファイルの表示

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

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

ファイルの表示

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

ファイルの表示

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

5
libbmc/citations/__init__.py ノーマルファイル
ファイルの表示

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

7
libbmc/papers/__init__.py ノーマルファイル
ファイルの表示

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

5
libbmc/repositories/__init__.py ノーマルファイル
ファイルの表示

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

ファイルの表示

@ -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 ノーマルファイル
ファイルの表示

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