mirror of
https://github.com/qurator-spk/page2tsv.git
synced 2026-04-30 03:01:56 +02:00
Merge pull request #18 from qurator-spk/pep420
convert to src-layout, pyproject.toml, PEP420 namespace pkg
This commit is contained in:
commit
b31a9f94b9
10 changed files with 44 additions and 55 deletions
|
|
@ -1 +1 @@
|
|||
qurator/tsvtools/ocrd-tool.json
|
||||
src/qurator/tsvtools/ocrd-tool.json
|
||||
41
pyproject.toml
Normal file
41
pyproject.toml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
[build-system]
|
||||
requires = ["setuptools>=61.0.0", "wheel"]
|
||||
|
||||
[project]
|
||||
name = "qurator_tsvtools"
|
||||
authors = [
|
||||
{name = "Kai Labusch", email = "Kai.Labusch@sbb.spk-berlin.de"},
|
||||
]
|
||||
description = "Working with QURATOR TSV, especially for neat"
|
||||
readme = "README.md"
|
||||
license = {text = "Apache License 2.0"}
|
||||
requires-python = ">=3.6"
|
||||
keywords = ["qurator"]
|
||||
|
||||
dynamic = ["version", "dependencies"]
|
||||
|
||||
# https://pypi.org/classifiers/
|
||||
classifiers = [
|
||||
'Intended Audience :: Science/Research',
|
||||
'License :: OSI Approved :: Apache Software License',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Topic :: Scientific/Engineering :: Artificial Intelligence',
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
extract-doc-links = "qurator.tsvtools.cli:extract_document_links"
|
||||
annotate-tsv = "qurator.tsvtools.cli:annotate_tsv"
|
||||
ocrd-neat-export = "qurator.tsvtools.ocrd_cli:export_cli"
|
||||
ocrd-neat-import = "qurator.tsvtools.ocrd_cli:import_cli"
|
||||
page2tsv = "qurator.tsvtools.cli:page2tsv_cli"
|
||||
tsv2page = "qurator.tsvtools.cli:tsv2page_cli"
|
||||
alto2tsv = "qurator.tsvtools.cli:alto2tsv_cli"
|
||||
tsv2tsv = "qurator.tsvtools.cli:tsv2tsv"
|
||||
make-page2tsv-commands = "qurator.tsvtools.cli:make_page2tsv_commands"
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/qurator-spk/page2tsv"
|
||||
Repository = "https://github.com/qurator-spk/page2tsv.git"
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
dependencies = {file = ["requirements.txt"]}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
|
||||
49
setup.py
49
setup.py
|
|
@ -1,49 +0,0 @@
|
|||
from io import open
|
||||
from json import load
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
with open('requirements.txt') as fp:
|
||||
install_requires = fp.read()
|
||||
with open('ocrd-tool.json') as fj:
|
||||
version = load(fj)['version']
|
||||
|
||||
setup(
|
||||
name="qurator_tsvtools",
|
||||
version=version,
|
||||
author="Kai Labusch",
|
||||
author_email="qurator@sbb.spk-berlin.de",
|
||||
description="Working with QURATOR TSV, especially for neat",
|
||||
long_description=open("README.md", "r", encoding='utf-8').read(),
|
||||
long_description_content_type="text/markdown",
|
||||
keywords='qurator',
|
||||
license='Apache License 2.0',
|
||||
url="https://github.com/qurator-spk/neath",
|
||||
packages=find_packages(exclude=["*.tests", "*.tests.*",
|
||||
"tests.*", "tests"]),
|
||||
install_requires=install_requires,
|
||||
namespace_packages=['qurator'],
|
||||
package_data={
|
||||
'': ['*.json']
|
||||
},
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
"extract-doc-links=qurator.tsvtools.cli:extract_document_links",
|
||||
"annotate-tsv=qurator.tsvtools.cli:annotate_tsv",
|
||||
"ocrd-neat-export=qurator.tsvtools.ocrd_cli:export_cli",
|
||||
"ocrd-neat-import=qurator.tsvtools.ocrd_cli:import_cli",
|
||||
"page2tsv=qurator.tsvtools.cli:page2tsv_cli",
|
||||
"tsv2page=qurator.tsvtools.cli:tsv2page_cli",
|
||||
"alto2tsv=qurator.tsvtools.cli:alto2tsv_cli",
|
||||
"tsv2tsv=qurator.tsvtools.cli:tsv2tsv",
|
||||
"make-page2tsv-commands=qurator.tsvtools.cli:make_page2tsv_commands"
|
||||
]
|
||||
},
|
||||
python_requires='>=3.6.0',
|
||||
tests_require=['pytest'],
|
||||
classifiers=[
|
||||
'Intended Audience :: Science/Research',
|
||||
'License :: OSI Approved :: Apache Software License',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Topic :: Scientific/Engineering :: Artificial Intelligence',
|
||||
],
|
||||
)
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
from json import loads
|
||||
from pathlib import Path
|
||||
from pkg_resources import resource_string
|
||||
from re import sub as re_sub
|
||||
|
||||
import pandas as pd
|
||||
from PIL import Image
|
||||
|
||||
from ocrd import Processor
|
||||
from ocrd_utils import getLogger, make_file_id, assert_file_grp_cardinality, MIMETYPE_PAGE
|
||||
from ocrd_utils import getLogger, make_file_id, assert_file_grp_cardinality, MIMETYPE_PAGE, resource_string
|
||||
from ocrd_models import OcrdExif
|
||||
from ocrd_models.constants import NAMESPACES as NS
|
||||
from ocrd_models.ocrd_page import TextEquivType, to_xml
|
||||
|
|
@ -15,7 +14,7 @@ from ocrd_modelfactory import page_from_file
|
|||
|
||||
from .cli import page2tsv
|
||||
|
||||
OCRD_TOOL = loads(resource_string(__name__, 'ocrd-tool.json'))
|
||||
OCRD_TOOL = loads(resource_string('qurator.tsvtools', 'ocrd-tool.json'))
|
||||
|
||||
class OcrdNeatExportProcessor(Processor):
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue