updated version control and setup scripts

This commit is contained in:
ari committed 2018-10-17 16:32:53 -04:00
1 parent 8383056d38
commit d634527a64
6 files changed
+163 -47

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
# PDF-Major
# PDFMajor
PDF-Major is a fork of `PDFMiner.six`. It is meant to be a more light-weight implementation that makes fewer assumptions on the data. Additionally, this version intends to be more up to date with recent versions of python and make liberal use of the typing capabilities of python for improved future maintainability.
View File
Whitespace-only changes.
+29
View File
@@ -0,0 +1,29 @@
#!/bin/python
import os
import re
current_dir = os.path.dirname(__file__)
INIT_TEMPLATE = '''
#
# DO NOT EDIT THIS PAGE
#
"""
{long_description}
"""
__version__ = ({version_tuple})
if __name__ == '__main__':
print(
"PDFMajor v" + '.'.join(map(str, __version__))
)
print(__doc__)
'''
def update_pdfmajor__init___(version: str, doc: str):
with open('pdfmajor/__init__.py', 'w') as file:
file.write(INIT_TEMPLATE.format(
long_description=doc,
version_tuple=re.sub(r"\.", ", ", version, count=2)
))
+1 -1
View File
@@ -1,4 +1,4 @@
# PDF-Major
# PDFMajor
PDF-Major is a fork of `PDFMiner.six`. It is meant to be a more light-weight implementation that makes fewer assumptions on the data. Additionally, this version intends to be more up to date with recent versions of python and make liberal use of the typing capabilities of python for improved future maintainability.
+82 -8
View File
@@ -1,10 +1,84 @@
"""
Fork of PDFMiner.six using latest python support and a more trim down approach
PDFMajor is a tool for extracting information from PDF documents.
It's main focus is on obtaining as closely related results that reflect the bare-bone structure of the
pdf document.
It includes a PDF converter that can transform PDF files into other text
formats (such as HTML, XML, JSON). It has an extensible PDF parser that can be used for
other purposes instead of text analysis.
#
# DO NOT EDIT THIS PAGE
#
"""
# PDF-Major
PDF-Major is a fork of `PDFMiner.six`. It is meant to be a more light-weight implementation that makes fewer assumptions on the data. Additionally, this version intends to be more up to date with recent versions of python and make liberal use of the typing capabilities of python for improved future maintainability.
## Documentation
See documentation [here](https://asosnovsky.github.io/pdfmajor/).
## Why Another Fork?
`PDFMiner` was designed to run in python 2.7>, `PDFMiner.six` was written to bring cross-version support for python 2 and 3. This versions intends to make use of the latest improvement in the python language while remaining fairly simple to develop with.
## Features
* Written entirely in Python.
* Parse, analyze, and convert PDF documents.
* PDF-1.7 specification support. (well, almost)
* CJK languages and vertical writing scripts support.
* Various font types (Type1, TrueType, Type3, and CID) support.
* Basic encryption (RC4) support.
* Font-Color extraction
* Shape fill and stroke color extraction
**Note**: We took out the layout-analysis process in this version (there is no more LTTextHorizontal or LTTextVertical). While the mathematics behind the grouping process was sound, the coupling of the layout-analysis process with the parsing and interpretation process produced unfriendly-code. This feature could be brought back by extending the `pdfmajor.layouts.PDFLayoutAnalyzer` class, but at the current time is not supported.
## How to Install
### Source
* Install Python 3.6.4 or newer.
* clone this repo
`git clone https://github.com/asosnovsky/pdfmajor`
* install repo
`python setup.py install`
### Pypi
* Install Python 3.6.4 or newer.
* install repo
`pip install pdfmajor`
## Terms and Conditions
(This is so-called MIT/X License)
Copyright (c) 2018-2019 Ariel Sosnovsky <ariel at sosnovsky dot ca>
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.
"""
__version__ = (1, 0, 4)
if __name__ == '__main__':
print(
"PDFMajor v" + '.'.join(map(str, __version__))
)
print(__doc__)
+50 -37
View File
@@ -1,42 +1,55 @@
# ==============
# Dependencies
# ==============
from setuptools import setup, find_namespace_packages
import sys
packages = find_namespace_packages(include=['pdfmajor.*'])
# ==============
# PARAMS
# ==============
with open('README.md') as readme_file:
SETUP = {
"name": "pdfmajor",
"version": "1.0.4",
"packages": find_namespace_packages(include=['pdfmajor.*']),
"install_requires": [
'pycryptodome',
'chardet'
],
"description": 'PDF parser',
"long_description": readme_file.read(),
"license": 'MIT/X',
"author": 'Ariel Sosnovsky + Yusuke Shinyama + Philippe Guglielmetti',
"author_email": 'ariel@sosnovsky.ca',
"url": 'https://github.com/asosnovsky/pdfmajor',
"scripts": [
'tools/pdfconvert.py',
],
"keywords": [
'pdf parser',
'pdf converter',
'text mining',
],
"classifiers": [
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Topic :: Text Processing',
],
}
with open('README.md') as file:
long_description = file.read()
# ==============
# Update __init__.py
# ==============
from bin.recreate_init import update_pdfmajor__init___
update_pdfmajor__init___(SETUP["version"], SETUP["long_description"])
setup(
name='pdfmajor',
version='1.0.2',
packages=packages,
install_requires=[
'pycryptodome',
'chardet'
],
description='PDF parser',
long_description=long_description,
license='MIT/X',
author='Ariel Sosnovsky + Yusuke Shinyama + Philippe Guglielmetti',
author_email='ariel@sosnovsky.ca',
url='https://github.com/asosnovsky/pdfmajor',
scripts=[
'tools/pdfconvert.py',
],
keywords=[
'pdf parser',
'pdf converter',
'text mining',
],
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Topic :: Text Processing',
],
)
# ==============
# Run Setup
# ==============
setup(**SETUP)