Skip to content

Commit

Permalink
Merge pull request #83 from OnroerendErfgoed/develop
Browse files Browse the repository at this point in the history
prepare 1.0.0
  • Loading branch information
goessebr authored Dec 21, 2021
2 parents 2289525 + 92c0cab commit f77eef6
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 174 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python
sudo: false
python:
- "2.7"
- "3.6"
- "3.7"
- "3.8"
Expand Down
24 changes: 24 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cff-version: 1.2.0
title: Skosprovider_sqlalchemy
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Koen
family-names: Van Daele
email: [email protected]
affiliation: Flanders Heritage Agency
orcid: 'https://orcid.org/0000-0002-8153-2978'
abstract: >-
A SQLAlchemy implementation of the Skosprovider interface. It allows
storing and querying a SKOS vocabulary in a SQL database.
keywords:
- SKOS
- thesaurus
- vocabulary
- python
- sqlalchemy
license: MIT
version: 1.0.0
date-released: "2021-12-12"
43 changes: 20 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Skosprovider_sqlalchemy documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 24 08:21:49 2013.
Expand All @@ -11,8 +10,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os

# 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.
Expand All @@ -34,23 +31,23 @@
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Skosprovider_sqlalchemy'
copyright = u'2013-2020, Koen Van Daele'
project = 'Skosprovider_sqlalchemy'
copyright = '2013-2021, Koen Van Daele'

# 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 = '0.6'
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '0.6.0'
release = '1.0.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -183,8 +180,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Skosprovider_sqlalchemy.tex', u'Skosprovider\\_sqlalchemy Documentation',
u'Koen Van Daele', 'manual'),
('index', 'Skosprovider_sqlalchemy.tex', 'Skosprovider\\_sqlalchemy Documentation',
'Koen Van Daele', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -213,8 +210,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'skosprovider_sqlalchemy', u'Skosprovider_sqlalchemy Documentation',
[u'Koen Van Daele'], 1)
('index', 'skosprovider_sqlalchemy', 'Skosprovider_sqlalchemy Documentation',
['Koen Van Daele'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -227,35 +224,35 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Skosprovider_sqlalchemy', u'Skosprovider_sqlalchemy Documentation',
u'Koen Van Daele', 'Skosprovider_sqlalchemy', 'One line description of project.',
'Miscellaneous'),
('index', 'Skosprovider_sqlalchemy', 'Skosprovider_sqlalchemy Documentation',
'Koen Van Daele', 'Skosprovider_sqlalchemy', 'One line description of project.',
'Miscellaneous'),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True
# texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# texinfo_show_urls = 'footnote'


# -- Options for Epub output ---------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = u'Skosprovider_sqlalchemy'
epub_author = u'Koen Van Daele'
epub_publisher = u'Koen Van Daele'
epub_copyright = u'2013, Koen Van Daele'
epub_title = 'Skosprovider_sqlalchemy'
epub_author = 'Koen Van Daele'
epub_publisher = 'Koen Van Daele'
epub_copyright = '2013, Koen Van Daele'

# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# epub_language = ''

# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
Expand Down
16 changes: 7 additions & 9 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
--requirement requirements.txt

# Postgresql database access
psycopg2==2.8.4
psycopg2==2.9.2

# Documentation
Sphinx==1.8.5 ; python_version < '3.5'
Sphinx==3.1.2 ; python_version >= '3.5'
Sphinx==4.3.1

# Testing
pytest==4.6.11 ; python_version < '3.0'
pytest==5.4.3 ; python_version >= '3.0'
pytest-cov==2.10.0
coveralls==1.11.1
pytest==6.2.5
pytest-cov==3.0.0
coveralls==3.3.1

# Linting
flake8==3.7.9
flake8==4.0.1
mccabe==0.6.1
pep8==1.7.1
pyflakes==2.1.1
pyflakes==2.4.0
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
SQLAlchemy==1.3.18
skosprovider==0.7.1
#-e git+https://github.com/koenedaele/skosprovider.git@DEV_0.7.0#egg=skosprovider
SQLAlchemy==1.4.28
skosprovider==1.1.0
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
]

requires = [
'skosprovider>=0.7.0',
'skosprovider>=1.1.0',
'sqlalchemy',
]

setup(
name='skosprovider_sqlalchemy',
version='0.6.0',
version='1.0.0',
description='A sqlAlchemy implementation of skosprovider.',
long_description=open('README.rst').read(),
long_description_content_type='text/x-rst',
author='Koen Van Daele',
author_email='[email protected]',
url='http://github.com/koenedaele/skosprovider_sqlalchemy',
url='https://github.com/OnroerendErfgoed/skosprovider_sqlalchemy',
packages=packages,
package_data={'': ['LICENSE']},
package_dir={'skosprovider_sqlalchemy': 'skosprovider_sqlalchemy'},
Expand All @@ -39,7 +39,6 @@
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
Expand Down
39 changes: 13 additions & 26 deletions skosprovider_sqlalchemy/models.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import logging

log = logging.getLogger(__name__)

from language_tags import tags
from skosprovider.skos import label as skoslabel

from sqlalchemy import (
Column,
Integer,
Text,
String,
Boolean,
ForeignKey,
UniqueConstraint,
Table,
event
)

from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import Text
from sqlalchemy import UniqueConstraint
from sqlalchemy import event
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import backref
from sqlalchemy.orm import relationship

from sqlalchemy.orm import (
relationship,
backref
)

log = logging.getLogger(__name__)
Base = declarative_base()

concept_label = Table(
Expand Down Expand Up @@ -643,7 +630,7 @@ def label(labels=[], language='any', sortLabel=False):
return skoslabel(labels, language, sortLabel)


class Initialiser(object):
class Initialiser:
'''
Initialises a database.
Expand Down
52 changes: 18 additions & 34 deletions skosprovider_sqlalchemy/providers.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,25 @@
# -*- coding: utf-8 -*-

import logging
log = logging.getLogger(__name__)

from skosprovider.providers import VocabularyProvider
from skosprovider.skos import Collection
from skosprovider.skos import Concept
from skosprovider.skos import ConceptScheme
from skosprovider.skos import Label
from skosprovider.skos import Note
from skosprovider.skos import Source
from skosprovider.uri import DefaultUrnGenerator
from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import NoResultFound

from skosprovider_sqlalchemy.models import Collection as CollectionModel
from skosprovider_sqlalchemy.models import Concept as ConceptModel
from skosprovider_sqlalchemy.models import ConceptScheme as ConceptSchemeModel
from skosprovider_sqlalchemy.models import Label as LabelModel
from skosprovider_sqlalchemy.models import Match as MatchModel
from skosprovider_sqlalchemy.models import Thing
from skosprovider_sqlalchemy.models import Visitation

from skosprovider.skos import (
ConceptScheme,
Concept,
Collection,
Label,
Note,
Source
)

from skosprovider_sqlalchemy.models import (
Thing,
ConceptScheme as ConceptSchemeModel,
Concept as ConceptModel,
Collection as CollectionModel,
Label as LabelModel,
Match as MatchModel,
Visitation
)

from sqlalchemy.orm import (
joinedload,
)

from sqlalchemy.orm.exc import (
NoResultFound
)

from skosprovider.uri import (
DefaultUrnGenerator,
DefaultConceptSchemeUrnGenerator
)
log = logging.getLogger(__name__)


class SQLAlchemyProvider(VocabularyProvider):
Expand Down
12 changes: 3 additions & 9 deletions skosprovider_sqlalchemy/scripts/calc_visitation.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# -*- coding: utf-8 -*-

import os
import sys

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from ..models import (
ConceptScheme,
Visitation
)
from ..models import ConceptScheme
from ..models import Visitation
from ..utils import VisitationCalculator

from ..utils import (
VisitationCalculator
)


def usage(argv):
Expand Down
8 changes: 2 additions & 6 deletions skosprovider_sqlalchemy/scripts/init_skos_db.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# -*- coding: utf-8 -*-

import os
import sys

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from ..models import (
Base,
Initialiser
)
from ..models import Base
from ..models import Initialiser


def usage(argv):
Expand Down
Loading

0 comments on commit f77eef6

Please sign in to comment.