Browse Source

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

Phyks (Lucas Verney) 3 years ago
parent
commit
f5183a1d11
9 changed files with 84 additions and 0 deletions
  1. 3
    0
      .gitignore
  2. 9
    0
      LICENSE
  3. 5
    0
      README.md
  4. 8
    0
      libbmc/__init__.py
  5. 5
    0
      libbmc/citations/__init__.py
  6. 7
    0
      libbmc/papers/__init__.py
  7. 5
    0
      libbmc/repositories/__init__.py
  8. 1
    0
      requirements.txt
  9. 41
    0
      setup.py

+ 3
- 0
.gitignore View File

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

+ 9
- 0
LICENSE View File

@@ -0,0 +1,9 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2016 Phyks (Lucas Verney)
4
+
5
+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:
6
+
7
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+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.

+ 5
- 0
README.md View File

@@ -52,6 +52,11 @@ install the matching software (`CERMINE`, `Grobid` or `pdf-extract`). See the
52 52
 docstrings of those functions for more infos on this particular point.
53 53
 
54 54
 
55
+## License
56
+
57
+This code is licensed under an MIT license.
58
+
59
+
55 60
 ## Acknowledgements
56 61
 
57 62
 Thanks a lot to the following authors and programs for helping in building

+ 8
- 0
libbmc/__init__.py View File

@@ -1 +1,9 @@
1
+from . import bibtex, doi, fetcher, isbn
2
+from . import citations, papers, repositories
3
+
1 4
 __version__ = "0.1"
5
+
6
+__all__ = [
7
+    "bibtex", "doi", "fetcher", "isbn",
8
+    "citations", "papers", "repositories"
9
+]

+ 5
- 0
libbmc/citations/__init__.py View File

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

+ 7
- 0
libbmc/papers/__init__.py View File

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

+ 5
- 0
libbmc/repositories/__init__.py View File

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

+ 1
- 0
requirements.txt View File

@@ -3,3 +3,4 @@ bibtexparser>=0.6.2
3 3
 isbnlib>=3.5.7
4 4
 requests>=2.9.1
5 5
 PySocks>=1.5.6
6
+#tear-pages>=0.2.2

+ 41
- 0
setup.py View File

@@ -0,0 +1,41 @@
1
+#!/usr/bin/env python
2
+
3
+try:
4
+    from setuptools import setup
5
+except ImportError:
6
+    print('[libbmc] setuptools not found.')
7
+    raise
8
+
9
+with open('libbmc/__init__.py') as fh:
10
+    for line in fh:
11
+        if line.startswith('__version__'):
12
+            version = line.strip().split()[-1][1:-1]
13
+            break
14
+
15
+try:
16
+    from pip.req import parse_requirements
17
+    from pip.download import PipSession
18
+except ImportError:
19
+    print('[libbmc] pip not found.')
20
+    raise
21
+
22
+# parse_requirements() returns generator of pip.req.InstallRequirement objects
23
+parsed_requirements = parse_requirements("requirements.txt",
24
+                                         session=PipSession())
25
+
26
+# reqs is a list of requirement
27
+# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
28
+install_requires = [str(ir.req) for ir in parsed_requirements]
29
+
30
+setup(
31
+    name='libbmc',
32
+    version=version,
33
+    url='https://github.com/Phyks/libbmc/',
34
+    author='Phyks (Lucas Verney)',
35
+    author_email='phyks@phyks.me',
36
+    license='MIT License',
37
+    description='A python library to deal with scientific papers.',
38
+    packages=['libbmc',
39
+              'libbmc.citations', 'libbmc.papers', 'libbmc.repositories'],
40
+    install_requires=install_requires
41
+)