From a209d8318c6f4f598f55fe00cb3aafd32499da1a Mon Sep 17 00:00:00 2001
From: csae8092
Date: Mon, 28 Oct 2024 09:25:03 +0100
Subject: [PATCH] new tests, docs, ...
---
.github/workflows/docs.yml | 28 +++++++
.github/workflows/lint.yml | 18 +++++
.github/workflows/pypi.yml | 31 ++++++++
.github/workflows/test.yml | 31 ++++++++
.gitignore | 4 +-
docs/Makefile | 20 -----
docs/authors.rst | 1 -
docs/conf.py | 154 -------------------------------------
docs/contributing.rst | 1 -
docs/history.rst | 1 -
docs/index.rst | 20 -----
docs/installation.rst | 51 ------------
docs/make.bat | 36 ---------
docs/modules.rst | 7 --
docs/pylobid.rst | 38 ---------
docs/readme.rst | 1 -
docs/reference.md | 18 +++++
docs/usage.rst | 144 ----------------------------------
mkdocs.yml | 10 +++
pyproject.toml | 5 +-
20 files changed, 143 insertions(+), 476 deletions(-)
create mode 100644 .github/workflows/docs.yml
create mode 100644 .github/workflows/lint.yml
create mode 100644 .github/workflows/pypi.yml
create mode 100644 .github/workflows/test.yml
delete mode 100644 docs/Makefile
delete mode 100644 docs/authors.rst
delete mode 100755 docs/conf.py
delete mode 100644 docs/contributing.rst
delete mode 100644 docs/history.rst
delete mode 100644 docs/index.rst
delete mode 100644 docs/installation.rst
delete mode 100644 docs/make.bat
delete mode 100644 docs/modules.rst
delete mode 100644 docs/pylobid.rst
delete mode 100644 docs/readme.rst
create mode 100644 docs/reference.md
delete mode 100644 docs/usage.rst
create mode 100644 mkdocs.yml
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 0000000..b97d44b
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,28 @@
+name: docs
+
+on:
+ workflow_dispatch:
+ release:
+ types: [created]
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v4
+ with:
+ python-version: '3.11'
+ - name: prepare
+ run: cp ./README.md ./docs/.
+ - name: Install needed packages
+ run: |
+ python -m pip install --upgrade pip
+ pip install mkdocs "mkdocstrings[python]"
+ - name: build the docs
+ run: mkdocs build
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ github_token: ${{secrets.GITHUB_TOKEN}}
+ publish_dir: ./site
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000..fe0db4d
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,18 @@
+name: flake8 Lint
+
+on:
+ push:
+
+jobs:
+ flake8-lint:
+ runs-on: ubuntu-latest
+ name: Lint
+ steps:
+ - name: Check out source repository
+ uses: actions/checkout@v3
+ - name: Set up Python environment
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.11"
+ - name: flake8 Lint
+ uses: py-actions/flake8@v2
\ No newline at end of file
diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml
new file mode 100644
index 0000000..69a4347
--- /dev/null
+++ b/.github/workflows/pypi.yml
@@ -0,0 +1,31 @@
+name: pypi
+
+on:
+ release:
+ types: [created]
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.12'
+ - name: config
+ run: |
+ RELEASE=${GITHUB_REF##*/}
+ sed -i -e "s/version=\".*\"/version=\"$RELEASE\"/" pyproject.toml
+ echo $RELEASE
+ cat setup.py
+ - name: Install pip, setuptools, build, twine
+ run: |
+ python -m pip install --upgrade pip
+ pip install build twine
+ - name: Build and publish
+ env:
+ TWINE_USERNAME: __token__
+ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+ run: |
+ python -m build
+ twine upload dist/*
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..a86c3af
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,31 @@
+name: Test
+on:
+ push:
+
+jobs:
+ test:
+ name: Test Application
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.12'
+ - name: Install dependencies
+ run: |
+ pip install --upgrade --upgrade-strategy eager -r requirements_dev.txt
+ - name: Install actual package
+ run: |
+ pip install -e .
+ - name: Run tests
+ run: coverage run -m pytest -v
+ - name: Create Coverage Report
+ run: coverage xml
+ - name: "Upload coverage to Codecov"
+ uses: codecov/codecov-action@v4
+ with:
+ file: ./coverage.xml
+ token: ${{ secrets.CODECOV_TOKEN }}
+ fail_ci_if_error: false
+ verbose: true
diff --git a/.gitignore b/.gitignore
index 9376503..bcf834e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -106,4 +106,6 @@ env/
# IDE settings
.vscode/
-*.ipynb
\ No newline at end of file
+*.ipynb
+
+docs/README.md
\ No newline at end of file
diff --git a/docs/Makefile b/docs/Makefile
deleted file mode 100644
index 929fddf..0000000
--- a/docs/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# Minimal makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = python -msphinx
-SPHINXPROJ = pylobid
-SOURCEDIR = .
-BUILDDIR = _build
-
-# Put it first so that "make" without argument is like "make help".
-help:
- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-
-.PHONY: help Makefile
-
-# Catch-all target: route all unknown targets to Sphinx using the new
-# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
-%: Makefile
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/authors.rst b/docs/authors.rst
deleted file mode 100644
index e122f91..0000000
--- a/docs/authors.rst
+++ /dev/null
@@ -1 +0,0 @@
-.. include:: ../AUTHORS.rst
diff --git a/docs/conf.py b/docs/conf.py
deleted file mode 100755
index 7ef9c89..0000000
--- a/docs/conf.py
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/usr/bin/env python
-#
-# pylobid documentation build configuration file, created by
-# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-# If extensions (or modules to document with autodoc) are in another
-# directory, add these directories to sys.path here. If the directory is
-# relative to the documentation root, use os.path.abspath to make it
-# absolute, like shown here.
-#
-import os
-import sys
-
-sys.path.insert(0, os.path.abspath(".."))
-
-import pylobid
-
-# -- General configuration ---------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#
-# needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ["_templates"]
-
-# The suffix(es) of source filenames.
-# You can specify multiple suffix as a list of string:
-#
-# source_suffix = ['.rst', '.md']
-source_suffix = ".rst"
-
-# The master toctree document.
-master_doc = "index"
-
-# General information about the project.
-project = "pylobid"
-copyright = "2020, Peter Andorfer"
-author = "Peter Andorfer"
-
-# The version info for the project you're documenting, acts as replacement
-# for |version| and |release|, also used in various other places throughout
-# the built documents.
-#
-# The short X.Y version.
-version = pylobid.__version__
-# The full version, including alpha/beta/rc tags.
-release = pylobid.__version__
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#
-# This is also used if you do content translation via gettext catalogs.
-# Usually you set "language" from the command line for these cases.
-language = None
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-# This patterns also effect to html_static_path and html_extra_path
-exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = "sphinx"
-
-# If true, `todo` and `todoList` produce output, else they produce nothing.
-todo_include_todos = False
-
-
-# -- Options for HTML output -------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-#
-html_theme = "alabaster"
-
-# Theme options are theme-specific and customize the look and feel of a
-# theme further. For a list of options available for each theme, see the
-# documentation.
-#
-# html_theme_options = {}
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ["_static"]
-
-
-# -- Options for HTMLHelp output ---------------------------------------
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = "pylobiddoc"
-
-
-# -- Options for LaTeX output ------------------------------------------
-
-latex_elements = {
- # The paper size ('letterpaper' or 'a4paper').
- #
- # 'papersize': 'letterpaper',
- # The font size ('10pt', '11pt' or '12pt').
- #
- # 'pointsize': '10pt',
- # Additional stuff for the LaTeX preamble.
- #
- # 'preamble': '',
- # Latex figure (float) alignment
- #
- # 'figure_align': 'htbp',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass
-# [howto, manual, or own class]).
-latex_documents = [
- (master_doc, "pylobid.tex", "pylobid Documentation", "Peter Andorfer", "manual"),
-]
-
-
-# -- Options for manual page output ------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [(master_doc, "pylobid", "pylobid Documentation", [author], 1)]
-
-
-# -- Options for Texinfo output ----------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- (
- master_doc,
- "pylobid",
- "pylobid Documentation",
- author,
- "pylobid",
- "One line description of project.",
- "Miscellaneous",
- ),
-]
diff --git a/docs/contributing.rst b/docs/contributing.rst
deleted file mode 100644
index e582053..0000000
--- a/docs/contributing.rst
+++ /dev/null
@@ -1 +0,0 @@
-.. include:: ../CONTRIBUTING.rst
diff --git a/docs/history.rst b/docs/history.rst
deleted file mode 100644
index 2506499..0000000
--- a/docs/history.rst
+++ /dev/null
@@ -1 +0,0 @@
-.. include:: ../HISTORY.rst
diff --git a/docs/index.rst b/docs/index.rst
deleted file mode 100644
index 1210ce0..0000000
--- a/docs/index.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-Welcome to pylobid's documentation!
-======================================
-
-.. toctree::
- :maxdepth: 2
- :caption: Contents:
-
- readme
- installation
- usage
- modules
- contributing
- authors
- history
-
-Indices and tables
-==================
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
diff --git a/docs/installation.rst b/docs/installation.rst
deleted file mode 100644
index 24469e3..0000000
--- a/docs/installation.rst
+++ /dev/null
@@ -1,51 +0,0 @@
-.. highlight:: shell
-
-============
-Installation
-============
-
-
-Stable release
---------------
-
-To install pylobid, run this command in your terminal:
-
-.. code-block:: console
-
- $ pip install pylobid
-
-This is the preferred method to install pylobid, as it will always install the most recent stable release.
-
-If you don't have `pip`_ installed, this `Python installation guide`_ can guide
-you through the process.
-
-.. _pip: https://pip.pypa.io
-.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
-
-
-From sources
-------------
-
-The sources for pylobid can be downloaded from the `Github repo`_.
-
-You can either clone the public repository:
-
-.. code-block:: console
-
- $ git clone git://github.com/csae8092/pylobid
-
-Or download the `tarball`_:
-
-.. code-block:: console
-
- $ curl -OJL https://github.com/csae8092/pylobid/tarball/master
-
-Once you have a copy of the source, you can install it with:
-
-.. code-block:: console
-
- $ python setup.py install
-
-
-.. _Github repo: https://github.com/csae8092/pylobid
-.. _tarball: https://github.com/csae8092/pylobid/tarball/master
diff --git a/docs/make.bat b/docs/make.bat
deleted file mode 100644
index 50ed2d5..0000000
--- a/docs/make.bat
+++ /dev/null
@@ -1,36 +0,0 @@
-@ECHO OFF
-
-pushd %~dp0
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
- set SPHINXBUILD=python -msphinx
-)
-set SOURCEDIR=.
-set BUILDDIR=_build
-set SPHINXPROJ=pylobid
-
-if "%1" == "" goto help
-
-%SPHINXBUILD% >NUL 2>NUL
-if errorlevel 9009 (
- echo.
- echo.The Sphinx module was not found. Make sure you have Sphinx installed,
- echo.then set the SPHINXBUILD environment variable to point to the full
- echo.path of the 'sphinx-build' executable. Alternatively you may add the
- echo.Sphinx directory to PATH.
- echo.
- echo.If you don't have Sphinx installed, grab it from
- echo.http://sphinx-doc.org/
- exit /b 1
-)
-
-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
-goto end
-
-:help
-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
-
-:end
-popd
diff --git a/docs/modules.rst b/docs/modules.rst
deleted file mode 100644
index b16d00b..0000000
--- a/docs/modules.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-pylobid
-=======
-
-.. toctree::
- :maxdepth: 4
-
- pylobid
diff --git a/docs/pylobid.rst b/docs/pylobid.rst
deleted file mode 100644
index 42b88ef..0000000
--- a/docs/pylobid.rst
+++ /dev/null
@@ -1,38 +0,0 @@
-pylobid package
-===============
-
-Submodules
-----------
-
-pylobid.pylobid module
-----------------------
-
-.. automodule:: pylobid.pylobid
- :members:
- :undoc-members:
- :show-inheritance:
-
-pylobid.validators module
--------------------------
-
-.. automodule:: pylobid.validators
- :members:
- :undoc-members:
- :show-inheritance:
-
-pylobid.utils module
---------------------
-
-.. automodule:: pylobid.utils
- :members:
- :undoc-members:
- :show-inheritance:
-
-
-Module contents
----------------
-
-.. automodule:: pylobid
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/docs/readme.rst b/docs/readme.rst
deleted file mode 100644
index 72a3355..0000000
--- a/docs/readme.rst
+++ /dev/null
@@ -1 +0,0 @@
-.. include:: ../README.rst
diff --git a/docs/reference.md b/docs/reference.md
new file mode 100644
index 0000000..c134209
--- /dev/null
+++ b/docs/reference.md
@@ -0,0 +1,18 @@
+# API Documentation
+This part of the project documentation focuses on
+an **information-oriented** approach. Use it as a
+reference for the technical implementation of the
+`pylobid` project code.
+
+## pylobid
+main module
+::: pylobid.pylobid
+
+
+## pylobid.utils
+some (one) utility function
+::: pylobid.utils
+
+## pylobid.validators
+WTForms GND validator module.
+::: pylobid.validators
diff --git a/docs/usage.rst b/docs/usage.rst
deleted file mode 100644
index 1156918..0000000
--- a/docs/usage.rst
+++ /dev/null
@@ -1,144 +0,0 @@
-=====
-Usage
-=====
-
-Getting started
----------------
-
-.. code-block:: python
-
- from pylobid.pylobid import PyLobidClient
- gnd_id = "http://d-nb.info/gnd/119315122"
- py_ent = PyLobidClient(gnd_id, fetch_related=True).factory()
- print(repr(py_ent))
-
-
-`PyLobidClient().factory()` returns the following instances based on the provided entity type:
-
-- Type `PlaceOrGeographicName` returns a `PyLobidPlace` instance.
-- Type `CorporateBody` returns a `PyLobidOrg` instance.
-- Type `Person` returns a `PyLobidPerson` instance.
-- All other types a `PyLobidPerson` instance
-
-`PyLobidClient` and its derivatives can raise the following exceptions:
-
-- `GNDIdError` If the GND-ID cannot be parsed from the provided URL or ID string.
-- `GNDNotFoundError` If the GND cannot be found and the API endpoint responds with `404 Not Found`.
-- `GNDAPIError` If the API endpoint response code is anything other than 200 or 404.
-
-`GNDIdError` is a derivative of `ValueError`. All requests are done with the `requests` module and none of its exceptions are caught by this module.
-
-Persons
--------
-
-To use pylobid in a project::
-
- from pylobid.pylobid import PyLobidPerson
-
- # create a PyLobidPerson object from a gnd_id
- gnd_id = "http://d-nb.info/gnd/119315122"
- py_ent = PyLobidPerson(gnd_id, fetch_related=True)
-
- # preferred name
- print(pl_pers.pref_name)
- 'Adams, John Quincy'
-
- # birth- and death dates:
- print(py_ent.life_span)
- returns {'birth_date_str': '1873-12-23', 'death_date_str': '1933-03-15'}
-
- # fetch data about the person's place of birth
- print(py_ent.birth_place)
- {'person_id': 'http://lobid.org/gnd/119315122', 'name': 'Wien', 'id': 'https://d-nb.info/gnd/4066009-6', 'coords': ['+016.371690', '+048.208199'], 'alt_names': ['Bundesunmittelbare Stadt Wien', 'Bécs', 'Bundesland Wien', 'Wīn', 'Vienna', 'Beč', 'Reichsgau Wien', 'Kaiserlich-Königliche Reichshaupt- und Residenzstadt Wien', 'Vjenë', 'Wienna', 'Vindobona (Wien)', 'Vin', 'Stadt Wien', 'Vienna Pannoniae', 'Wenia', 'Vídeň', 'Viedeň', 'Land Wien', 'Viennē', 'Reichshaupt- und Residenzstadt Wien', 'Wienn', 'Vienna Fluviorum', 'Vienne (Österreich)', 'K.K. Reichshaupt- und Residenzstadt Wien', 'Vinna', 'Bundeshauptstadt Wien', 'Vena', 'Vindobona', 'Wiedeń (Wien)', 'Vienna (Austriae)', 'Biennē', 'Gemeinde Wien', 'Dunaj', 'Vienne', 'Viena']}
-
- # fetch data about the person's place of death (which is again Vienna)
- print(py_ent.birth_death)
- {'person_id': 'http://lobid.org/gnd/119315122', 'name': 'Wien', 'id': 'https://d-nb.info/gnd/4066009-6', 'coords': ['+016.371690', '+048.208199'], 'alt_names': ['Bundesunmittelbare Stadt Wien', 'Bécs', 'Bundesland Wien', 'Wīn', 'Vienna', 'Beč', 'Reichsgau Wien', 'Kaiserlich-Königliche Reichshaupt- und Residenzstadt Wien', 'Vjenë', 'Wienna', 'Vindobona (Wien)', 'Vin', 'Stadt Wien', 'Vienna Pannoniae', 'Wenia', 'Vídeň', 'Viedeň', 'Land Wien', 'Viennē', 'Reichshaupt- und Residenzstadt Wien', 'Wienn', 'Vienna Fluviorum', 'Vienne (Österreich)', 'K.K. Reichshaupt- und Residenzstadt Wien', 'Vinna', 'Bundeshauptstadt Wien', 'Vena', 'Vindobona', 'Wiedeń (Wien)', 'Vienna (Austriae)', 'Biennē', 'Gemeinde Wien', 'Dunaj', 'Vienne', 'Viena']}
-
- # create a PyLobidPerson object without fetching related data
- py_ent = PyLobidPerson(gnd_id, fetch_related=False)
- print(py_ent.death_place)
- {'person_id': 'http://lobid.org/gnd/119315122', 'name': 'Wien', 'id': 'https://d-nb.info/gnd/4066009-6', 'coords': [], 'alt_names': []}
-
- # fetch same_as IDs
- pl_pers = PyLobidPerson('http://d-nb.info/gnd/1069009253', fetch_related=False)
- print(pl_pers.same_as)
- [('VIAF', 'http://viaf.org/viaf/120106865'), ('DNB', 'https://d-nb.info/gnd/1069009253/about')]
-
-
-Places
-------
-
-How to use PyLobidPlace object::
-
- from pylobid.pylobid import PyLobidPlace
-
- pl_place = PyLobidPlace('4004168-2', fetch_related=False)
- print(pl_place.coords)
- ['+016.232500', '+048.005277']
-
- print(pl_place.pref_name)
- Baden (Niederösterreich)
-
- print(pl_place.alt_names)
- ['Baden, Wienerwald', 'Baden bei Wien', 'Stadtgemeinde Baden', 'Stadtgemeinde Baden bei Wien']
-
- print(pl_place.same_as)
- [('DNB', 'http://d-nb.info/gnd/4004168-2/about'), ('GeoNames', 'http://sws.geonames.org/2782067'), ('VIAF', 'http://viaf.org/viaf/234093638'), ('WIKIDATA', 'http://www.wikidata.org/entity/Q486450'), ('DNB', 'https://d-nb.info/gnd/2005587-0'), ('dewiki', 'https://de.wikipedia.org/wiki/Bahnhof_Baden_bei_Wien')]
-
-
-Organisations
--------------
-
-How to use PyLobidOrg object::
-
- from pylobid.pylobid import PyLobidOrg
-
- pl_org = PyLobidOrg('4443305-0', fetch_related=False)
- for x in ['located_in', 'alt_names', 'same_as', 'pref_name']:
- print(f"{x}: {getattr(pl_org, x)}\n")
-
- located_in: [{'id': 'https://d-nb.info/gnd/4076860-0', 'label': 'Rovereto'}]
-
- alt_names: ['Imperial Regia Accademia scientifica e letteraria degli Agiati (Rovereto)', 'Accademia di scienze, lettere ed arti degli Agiati di Rovereto', 'Imperiale Regia Accademia Roveretana', 'Accademia degli Agiati (Rovereto)', 'Accademia Roveretana', 'I. R. Accademia Roveretana degli Agiati', 'I. R. Accademia di lettere e scienze degli Agiati (Rovereto)', 'Regia Accademia Roveretana degli Agiati', 'I. R. Accademia scientifica e letteraria degli Agiati (Rovereto)', 'Imperial Regia Accademia di lettere e scienze degli Agiati (Rovereto)', 'I. R. Accademia degli Agiati (Rovereto)', 'Imperiale Regia Accademia Scientifica e Letteraia degli Agiati', 'Imperiale Regia Accademia di Lettere e Scienze degli Agiati', 'Imperiale Regia Accademia di scienze, lettere ed arti degli Agiati (Rovereto)', 'Imperiale Regia Accademia di Scienze, Lettere ed Arti degli Agiati', 'Accademia degli Agiati (Rovereto, Accademia Roveretana degli Agiati)', 'Imperial Regia Accademia degli Agiati (Rovereto)', 'Imperial Regia Accademia Roveretana', 'Imperiale Regia Accademia di Scienze, Lettere ed Arti degli Agiati (Rovereto)', 'Accademia degli Agiati', 'Imperial Regia Accademia roveretana', 'Imperiale Regia Accademia Roveretana degli Agiati', 'Imperial Regia Accademia di scienze e lettere (Rovereto)', 'I. R. Accademia di scienze e lettere (Rovereto)']
-
- same_as: [('VIAF', 'http://viaf.org/viaf/310513758'), ('WIKIDATA', 'http://www.wikidata.org/entity/Q3603948'), ('DNB', 'https://d-nb.info/gnd/1085251314'), ('DNB', 'https://d-nb.info/gnd/4443305-0/about')]
-
- pref_name: Accademia Roveretana degli Agiati
-
-
-
-WTForms validators
-------------------
-
-The `pylobid` module contains a validator for `WTForms `_. With `pylobid.validators` you can validate the input from forms.
-
-- Check if the provided GND URL or ID exists
-- Check if the entity is a Person, Place or Organization.
-
-.. code-block:: python
-
- import wtforms
- from pylobid import validators
-
- class GNDPersonForm(wtforms.Form):
- gnd_str = wtforms.StringField(
- label='GND ID or URL',
- validators=[validators.GNDPersonEntity()])
-
- form = GNDPersonFrom()
- # ... Do your form thing ...
- if form.validate():
- print('Form validation success')
- else:
- for error in form.errors:
- print(error)
-
-Available validators:
-
-- `validators.GNDPersonEntity()`
-- `validators.GNDPlaceEntity()`
-- `validators.GNDOrgEntity()`
-- `validators.GNDValidator()`
-
-
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 0000000..24e051b
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,10 @@
+site_name: pylobid
+
+theme: readthedocs
+
+plugins:
+ - mkdocstrings
+
+nav:
+- Home: README.md
+- API-Documentation: reference.md
diff --git a/pyproject.toml b/pyproject.toml
index 0075d86..faf92ab 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "pylobid"
-version = "1.3.1"
+version = "2.0.0"
description = "A lobid-REST-API client"
readme = "README.md"
license = { file = "LICENSE" }
@@ -18,3 +18,6 @@ dependencies = ['requests>=2.32.3,<3', "jsonpath-ng>=1.7.0,<2"]
[project.urls]
Repository = "https://github.com/csae8092/pylobid"
+
+[tool.setuptools]
+packages = ["pylobid",]