Skip to content
Commits on Source (2)
[run]
branch = True
source = pycsw
[paths]
source =
pycsw
.tox/*/lib/python*/site-packages/pycsw
/usr/local/lib/python*/dist-packages/pycsw
[report]
show_missing = True
\ No newline at end of file
# build artifacts
*.pyc
*.egg-info
build
dist
docs/_build
MANIFEST
# testing artifacts
tests/index.html
tests/results
**.cache
.coverage
.tox
# test configurations
/default.cfg
# git stuff
.git
# pycharm ide
.idea
language: python
sudo: required
cache: pip
dist: trusty
python:
- "2.6"
- "2.7"
- "3.4"
- "3.5"
jobs:
include:
- stage: unit-test
python: "2.7"
env: TOXENV=py27-sqlite
install: pip install codecov tox
script: tox -- --exitfirst -m unit
after_success: codecov --disable search --flags unittests
- stage: unit-test
python: "3.4"
env: TOXENV=py34-sqlite
install: pip install codecov tox
script: tox -- --exitfirst -m unit
after_success: codecov --disable search --flags unittests
- stage: unit-test
python: "3.5"
env: TOXENV=py35-sqlite
install: pip install codecov tox
script: tox -- --exitfirst -m unit
after_success: codecov --disable search --flags unittests
- stage: integration-test
python: "2.7"
env: TOXENV=py27-sqlite
install: pip install codecov tox
script: tox -- --exitfirst -m functional -k 'not harvesting'
after_success: codecov --disable search --flags integrationtests
- stage: integration-test
python: "3.4"
env: TOXENV=py34-sqlite
install: pip install codecov tox
script: tox -- --exitfirst -m functional -k 'not harvesting'
after_success: codecov --disable search --flags integrationtests
- stage: integration-test
python: "3.5"
env: TOXENV=py35-sqlite
install: pip install codecov tox
script: tox -- --exitfirst -m functional -k 'not harvesting'
after_success: codecov --disable search --flags integrationtests
#matrix:
# allow_failures:
# - python: "3.4"
addons:
apt:
packages:
- libgeos-c1
- libgeos-dev
- libpq-dev
- libxml2-dev
- libxslt1-dev
- libz-dev
before_script:
- pycsw-admin.py -c get_sysprof
install:
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pip install -r requirements-standalone.txt
- python setup.py -q install
script:
- paver test
after_script:
- paver stop
notifications:
irc:
......
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at pycsw-devel@lists.osgeo.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
......@@ -3,7 +3,7 @@ Contributing to pycsw
The pycsw project openly welcomes contributions (bug reports, bug fixes, code
enhancements/features, etc.). This document will outline some guidelines on
contributing to pycsw. As well, the pycsw `community </community.html>`_ is a great place to
contributing to pycsw. As well, the pycsw `community <http://pycsw.org/community/>`_ is a great place to
get an idea of how to connect and participate in pycsw community and development.
pycsw has the following modes of contribution:
......@@ -147,4 +147,4 @@ your own repository to ensure your pycsw repository is up to date with pycsw mas
.. _`pylint`: http://www.logilab.org/857
.. _`Sphinx`: http://sphinx-doc.org/
.. _`developer tasks`: https://github.com/geopython/pycsw/wiki/Developer-Tasks
.. _`mailing list`: http://pycsw.org/community.html#mailing_list
.. _`mailing list`: http://pycsw.org/community#mailing-list
# =================================================================
#
# Authors: Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2017 Ricardo Garcia Silva
#
# 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.
#
# =================================================================
FROM alpine:3.4
# There's bug in libxml2 v2.9.4 that prevents using an XMLParser with a schema
# file.
#
# https://bugzilla.gnome.org/show_bug.cgi?id=766834
#
# It seems to have been fixed upstream, but the fix has not been released into
# a new libxml2 version. As a workaround, we are sticking with the previous
# version, which works fine.
# This means that we need to use alpine's archives for version 3.1, which are
# the ones that contain the previous version of libxml2
#
# Also, for some unkwnon reason, alpine 3.1 version of libxml2 depends on
# python2. We'd rather use python3 for pycsw, so we install it too.
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.1/main' >> /etc/apk/repositories \
&& apk add --no-cache \
build-base \
ca-certificates \
postgresql-dev \
python3 \
python3-dev \
libpq \
libxslt-dev \
'libxml2<2.9.4' \
'libxml2-dev<2.9.4' \
wget \
&& apk add --no-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
--allow-untrusted \
geos \
geos-dev
RUN adduser -D -u 1000 pycsw
WORKDIR /tmp/pycsw
COPY \
requirements-standalone.txt \
requirements-pg.txt \
requirements-dev.txt \
requirements.txt \
./
RUN pip3 install --upgrade pip setuptools \
&& pip3 install --requirement requirements.txt \
&& pip3 install --requirement requirements-standalone.txt \
&& pip3 install --requirement requirements-pg.txt \
&& pip3 install gunicorn
COPY pycsw pycsw/
COPY bin bin/
COPY setup.py .
COPY MANIFEST.in .
COPY VERSION.txt .
COPY README.rst .
RUN pip3 install .
COPY tests tests/
COPY docker docker/
ENV PYCSW_CONFIG=/etc/pycsw/pycsw.cfg
RUN mkdir /etc/pycsw \
&& mv docker/pycsw.cfg ${PYCSW_CONFIG} \
&& mkdir /var/lib/pycsw \
&& chown pycsw:pycsw /var/lib/pycsw \
&& cp docker/entrypoint.py /usr/local/bin/entrypoint.py \
&& chmod a+x /usr/local/bin/entrypoint.py \
&& cp -r tests /home/pycsw \
&& cp requirements.txt /home/pycsw \
&& cp requirements-standalone.txt /home/pycsw \
&& cp requirements-pg.txt /home/pycsw \
&& cp requirements-dev.txt /home/pycsw \
&& chown -R pycsw:pycsw /home/pycsw/* \
&& rm -rf *
WORKDIR /home/pycsw
USER pycsw
EXPOSE 8000
ENTRYPOINT [\
"python3", \
"/usr/local/bin/entrypoint.py" \
]
recursive-include pycsw *.xsd
include *.txt
include README.rst
pycsw README
============
.. image:: https://travis-ci.org/geopython/pycsw.svg?branch=master
:target: https://travis-ci.org/geopython/pycsw
pycsw is an OGC CSW server implementation written in Python.
pycsw fully implements the OpenGIS Catalogue Service Implementation Specification (Catalogue Service for the Web). Initial development started in 2010 (more formally announced in 2011). The project is certified OGC Compliant, and is an OGC Reference Implementation. Since 2015, pycsw is an official OSGeo Project.
pycsw fully implements the OpenGIS Catalogue Service Implementation
Specification (Catalogue Service for the Web). Initial development started in
2010 (more formally announced in 2011). The project is certified OGC
Compliant, and is an OGC Reference Implementation. Since 2015, pycsw is an
official OSGeo Project.
pycsw allows for the publishing and discovery of geospatial metadata via numerous APIs (CSW 2/CSW 3, OpenSearch, OAI-PMH, SRU). Existing repositories of geospatial metadata can also be exposed, providing a standards-based metadata and catalogue component of spatial data infrastructures.
pycsw allows for the publishing and discovery of geospatial metadata via
numerous APIs (CSW 2/CSW 3, OpenSearch, OAI-PMH, SRU). Existing repositories
of geospatial metadata can also be exposed, providing a standards-based
metadata and catalogue component of spatial data infrastructures.
pycsw is Open Source, released under an MIT license, and runs on all major platforms (Windows, Linux, Mac OS X).
pycsw is Open Source, released under an MIT license, and runs on all major
platforms (Windows, Linux, Mac OS X).
Please read the docs at http://pycsw.org/docs for more information.
......@@ -33,13 +33,10 @@
from six.moves import configparser
from six.moves import input
import getopt
import logging
import sys
from pycsw.core import admin, config
logging.basicConfig(format='%(message)s', level=logging.DEBUG)
CONTEXT = config.StaticContext()
......
pycsw (2.0.3+dfsg-2) UNRELEASED; urgency=medium
pycsw (2.2.0+dfsg-1) UNRELEASED; urgency=medium
[ Bas Couwenberg ]
* Change priority from extra to optional.
* Bump Standards-Version to 4.1.3, changes: priority.
* Strip trailing whitespace from changelog.
......@@ -9,7 +10,10 @@ pycsw (2.0.3+dfsg-2) UNRELEASED; urgency=medium
* Drop obsolete lintian override.
* Add Disclaimer to copyright file.
-- Bas Couwenberg <sebastic@debian.org> Sun, 24 Sep 2017 13:19:35 +0200
[ Johan Van de Wauw ]
* New upstream version 2.2.0+dfsg
-- Johan Van de Wauw <johan@gisky.be> Thu, 22 Mar 2018 01:36:42 +0100
pycsw (2.0.3+dfsg-1) unstable; urgency=medium
......
......@@ -39,7 +39,7 @@ maxrecords=10
#ogc_schemas_base=http://foo
#federatedcatalogues=http://catalog.data.gov/csw
#pretty_print=true
#gzip_compresslevel=8
gzip_compresslevel=9
#domainquerytype=range
#domaincounts=true
#spatial_ranking=true
......@@ -68,7 +68,7 @@ contact_postalcode=Zip or Postal Code
contact_country=Country
contact_phone=+xx-xxx-xxx-xxxx
contact_fax=+xx-xxx-xxx-xxxx
contact_email=Email Address
contact_email=you@example.org
contact_url=Contact URL
contact_hours=Hours of Service
contact_instructions=During hours of service. Off on weekends.
......@@ -76,7 +76,7 @@ contact_role=pointOfContact
[repository]
# sqlite
database=sqlite:////var/www/pycsw/tests/suites/cite/data/records.db
database=sqlite:////var/www/pycsw/tests/functionaltests/suites/cite/data/cite.db
# postgres
#database=postgresql://username:password@localhost/pycsw
# mysql
......
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
# Copyright (c) 2017 Ricardo Garcia Silva
#
# 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.
#
# =================================================================
[server]
home=/home/pycsw
url=http://localhost/pycsw/csw.py
mimetype=application/xml; charset=UTF-8
encoding=UTF-8
language=en-US
maxrecords=10
loglevel=DEBUG
logfile=
#ogc_schemas_base=http://foo
#federatedcatalogues=http://catalog.data.gov/csw
#pretty_print=true
#gzip_compresslevel=8
#domainquerytype=range
#domaincounts=true
#spatial_ranking=true
profiles=apiso
[manager]
transactions=false
allowed_ips=127.0.0.1
#csw_harvest_pagesize=10
[metadata:main]
identification_title=pycsw Geospatial Catalogue
identification_abstract=pycsw is an OGC CSW server implementation written in Python
identification_keywords=catalogue,discovery,metadata
identification_keywords_type=theme
identification_fees=None
identification_accessconstraints=None
provider_name=Organization Name
provider_url=http://pycsw.org/
contact_name=Lastname, Firstname
contact_position=Position Title
contact_address=Mailing Address
contact_city=City
contact_stateorprovince=Administrative Area
contact_postalcode=Zip or Postal Code
contact_country=Country
contact_phone=+xx-xxx-xxx-xxxx
contact_fax=+xx-xxx-xxx-xxxx
contact_email=Email Address
contact_url=Contact URL
contact_hours=Hours of Service
contact_instructions=During hours of service. Off on weekends.
contact_role=pointOfContact
[repository]
# sqlite
#database=sqlite:////home/pycsw/tests/functionaltests/suites/cite/data/cite.db
# postgres
database=postgresql://postgres:mypass@db/pycsw
# mysql
#database=mysql://username:password@localhost/pycsw?charset=utf8
#mappings=path/to/mappings.py
table=records
#filter=type = 'http://purl.org/dc/dcmitype/Dataset'
[metadata:inspire]
enabled=true
languages_supported=eng,gre
default_language=eng
date=YYYY-MM-DD
gemet_keywords=Utility and governmental services
conformity_service=notEvaluated
contact_name=Organization Name
contact_email=Email Address
temp_extent=YYYY-MM-DD/YYYY-MM-DD
# =================================================================
#
# Authors: Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2017 Ricardo Garcia Silva
#
# 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.
#
# =================================================================
#
#
# This docker-stack file demos how to use the pycsw docker image with a
# postgis database
#
# Use it with docker-compose or in a docker swarm:
#
# docker-compose --file docker-stack.yml --project pycsw up
#
# PYCSW_DOCKER_IMAGE=2.1-dev docker stack deploy --compose-file docker-stack.yml pycsw
#
version: "3"
services:
db:
image: mdillon/postgis:9.6-alpine
environment:
POSTGRES_PASSWORD: mypass
POSTGRES_DB: pycsw
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- db-data:/var/lib/postgresql/data/pgdata
pycsw:
image: geopython/pycsw:${PYCSW_DOCKER_VERSION}
ports:
- "8000:8000"
volumes:
- ./docker-stack-pycsw.cfg:/etc/pycsw/pycsw.cfg
volumes:
db-data:
#!/usr/bin/env python3
# =================================================================
#
# Authors: Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2017 Ricardo Garcia Silva
#
# 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.
#
# =================================================================
"""Entrypoint script for docker containers.
This module serves as the entrypoint for docker containers. Its main
purpose is to set up the pycsw database so that newly generated
containers may be useful soon after being launched, without requiring
additional input.
"""
import argparse
import logging
import os
from six.moves.configparser import SafeConfigParser
from six.moves.configparser import NoOptionError
import sys
from time import sleep
from sqlalchemy import create_engine
from sqlalchemy.exc import OperationalError
from sqlalchemy.exc import ProgrammingError
from pycsw.core import admin
logger = logging.getLogger(__name__)
def launch_pycsw(pycsw_config, workers=2, reload=False):
"""Launch pycsw.
Main function of this entrypoint script. It will read pycsw's config file
and handle the specified repository backend, after which it will yield
control to the gunicorn wsgi server.
The ``os.execlp`` function is used to launch gunicorn. This causes it to
replace the current process - something analogous to bash's `exec`
command, which seems to be a common techinque when writing docker
entrypoint scripts. This means gunicorn will become PID 1 inside the
container and it somehow simplifies the process of interacting with it
(e.g. if the need arises to restart the worker processes). It also allows
for a clean exit. See
http://docs.gunicorn.org/en/latest/signals.html
for more information on how to control gunicorn by sending UNIX signals.
"""
db_url = pycsw_config.get("repository", "database")
db = db_url.partition(":")[0].partition("+")[0]
db_handler = {
"sqlite": handle_sqlite_db,
"postgresql": handle_postgresql_db,
}.get(db)
logger.debug("Setting up pycsw's data repository...")
logger.debug("Repository URL: {}".format(db_url))
db_handler(
db_url,
pycsw_config.get("repository", "table"),
pycsw_config.get("server", "home")
)
sys.stdout.flush()
# we're using --reload-engine=poll because there is a bug with gunicorn
# that prevents using inotify together with python3. For more info:
#
# https://github.com/benoitc/gunicorn/issues/1477
#
args = ["--reload", "--reload-engine=poll"] if reload else []
execution_args = ["gunicorn"] + args + [
"--bind=0.0.0.0:8000",
"--access-logfile=-",
"--error-logfile=-",
"--workers={}".format(workers),
"pycsw.wsgi",
]
logger.debug("Launching pycsw with {} ...".format(" ".join(execution_args)))
os.execlp(
"gunicorn",
*execution_args
)
def handle_sqlite_db(database_url, table_name, pycsw_home):
db_path = database_url.rpartition(":///")[-1]
if not os.path.isfile(db_path):
try:
os.makedirs(os.path.dirname(db_path))
except OSError as exc:
if exc.args[0] == 17: # directory already exists
pass
admin.setup_db(database=database_url, table=table_name,
home=pycsw_home)
def handle_postgresql_db(database_url, table_name, pycsw_home):
_wait_for_postgresql_db(database_url)
try:
admin.setup_db(database=database_url, table=table_name,
home=pycsw_home)
except ProgrammingError:
pass # database tables are already created
def _wait_for_postgresql_db(database_url, max_tries=10, wait_seconds=3):
logger.debug("Waiting for {!r}...".format(database_url))
engine = create_engine(database_url)
current_try = 0
while current_try < max_tries:
try:
engine.execute("SELECT version();")
logger.debug("Database is already up!")
break
except OperationalError:
logger.debug("Database not responding yet ...")
current_try += 1
sleep(wait_seconds)
else:
raise RuntimeError(
"Database not responding at {} after {} tries. "
"Giving up".format(database_url, max_tries)
)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--workers",
default=2,
help="Number of workers to use by the gunicorn server. Defaults to 2."
)
parser.add_argument(
"-r",
"--reload",
action="store_true",
help="Should the gunicorn server automatically restart workers when "
"code changes? This option is only useful for development. "
"Defaults to False."
)
args = parser.parse_args()
config = SafeConfigParser()
config.read(os.getenv("PYCSW_CONFIG"))
try:
level = config.get("server", "loglevel").upper()
except NoOptionError:
level = "WARNING"
logging.basicConfig(level=getattr(logging, level))
launch_pycsw(config, workers=args.workers, reload=args.reload)
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
# Copyright (c) 2017 Ricardo Garcia Silva
#
# 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.
#
# =================================================================
[server]
home=/home/pycsw
url=http://localhost/pycsw/csw.py
mimetype=application/xml; charset=UTF-8
encoding=UTF-8
language=en-US
maxrecords=10
loglevel=DEBUG
logfile=
#ogc_schemas_base=http://foo
#federatedcatalogues=http://catalog.data.gov/csw
#pretty_print=true
#gzip_compresslevel=8
#domainquerytype=range
#domaincounts=true
#spatial_ranking=true
profiles=apiso
[manager]
transactions=false
allowed_ips=127.0.0.1
#csw_harvest_pagesize=10
[metadata:main]
identification_title=pycsw Geospatial Catalogue
identification_abstract=pycsw is an OGC CSW server implementation written in Python
identification_keywords=catalogue,discovery,metadata
identification_keywords_type=theme
identification_fees=None
identification_accessconstraints=None
provider_name=Organization Name
provider_url=http://pycsw.org/
contact_name=Lastname, Firstname
contact_position=Position Title
contact_address=Mailing Address
contact_city=City
contact_stateorprovince=Administrative Area
contact_postalcode=Zip or Postal Code
contact_country=Country
contact_phone=+xx-xxx-xxx-xxxx
contact_fax=+xx-xxx-xxx-xxxx
contact_email=Email Address
contact_url=Contact URL
contact_hours=Hours of Service
contact_instructions=During hours of service. Off on weekends.
contact_role=pointOfContact
[repository]
# sqlite
database=sqlite:////home/pycsw/tests/functionaltests/suites/cite/data/cite.db
# postgres
#database=postgresql://username:password@localhost/pycsw
# mysql
#database=mysql://username:password@localhost/pycsw?charset=utf8
#mappings=path/to/mappings.py
table=records
#filter=type = 'http://purl.org/dc/dcmitype/Dataset'
[metadata:inspire]
enabled=true
languages_supported=eng,gre
default_language=eng
date=YYYY-MM-DD
gemet_keywords=Utility and governmental services
conformity_service=notEvaluated
contact_name=Organization Name
contact_email=Email Address
temp_extent=YYYY-MM-DD/YYYY-MM-DD
......@@ -11,7 +11,7 @@
</p>
<p>
<img alt="OSGeo Project" src="http://svn.osgeo.org/osgeo/marketing/logo/png8/150/OSGeo_project.png" height="64"/>
<img alt="OSGeo Project" src="https://raw.githubusercontent.com/OSGeo/osgeo/master/incubation/project/OSGeo_project.png" height="64"/>
</p>
<p>
......
......@@ -144,7 +144,16 @@ To override the default settings:
...
mappings=path/to/mappings.py
See the :ref:`geonode` and :ref:`odc` for further examples.
Note you can also reference mappings as a Python object as a dotted path:
.. code-block:: none
[repository]
...
mappings='path.to.pycsw_mappings'
See the :ref:`geonode`, :ref:`hhypermap`, and :ref:`odc` for further examples.
Existing Repository Requirements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
......@@ -41,6 +41,11 @@
import sys, os
try:
from unittest.mock import MagicMock
except ImportError:
from mock import Mock as MagicMock
# 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.
......@@ -48,6 +53,9 @@ import sys, os
# -- General configuration -----------------------------------------------------
# locale
locale_dirs = ['locale/']
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
......@@ -322,3 +330,14 @@ epub_copyright = copyright
# Allow duplicate toc entries.
#epub_tocdup = True
# mock out imports with C extensions for building on readthedocs.io
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()
MOCK_MODULES = ['shapely']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)