Interact with AGIV webservices.
Project description
CRABpy
======
This library provides access to the CRAB and CAPAKEY webservices operated by
the AGIV. Because connecting to these SOAP services from python can be somewhat
complicated, this library makes it easier.
.. image:: https://travis-ci.org/OnroerendErfgoed/crabpy.png?branch=master
:target: https://travis-ci.org/OnroerendErfgoed/crabpy
.. image:: https://badge.fury.io/py/crabpy.png
:target: http://badge.fury.io/py/crabpy
Using the CRAB webservice
-------------------------
Recently, the CRAB service has become public. The need to authenticate has been
removed, making it a whole lot easier to connect.
.. code-block:: python
from crabpy.client import crab_factory
crab = crab_factory()
res = crab.service.ListGemeentenByGewestId(1)
print res
Using the CAPAKEY webservice
----------------------------
This service does still require authentication. This requires a valid account
from agiv_. Because the authentication also requires some extra WS-Addressing
headers, a utility function has been provided to make life easier.
.. code-block:: python
from crabpy.client import capakey_factory, capakey_request
capakey = capakey_factory(
user='USER',
password='PASSWORD'
)
res = capakey_request(capakey, 'ListAdmGemeenten', 1)
print res
Using the CAPAKEY gateway
-------------------------
To make life easier and capakey more pythonic, we've also implemented a gateway
that abstracts some more of the service and provides richer objects as responses.
.. code-block:: python
from crabpy.client import capakey_factory
from crabpy.gateway.capakey import CapakeyGateway
capakey = capakey_factory(
user='USER',
password='PASSWORD'
)
g = CapakeyGateway(capakey)
res = g.list_gemeenten()
print res
See the examples folder for some more sample code.
Development
-----------
Crabpy is still in alpha development. Currently we're just happy to have gotten
a SOAP service working in python.
We try to cover as much code as we can with unit tests. You can run them using
tox_ or directly through nose:
.. code-block:: bash
$ tox
# No coverage
$ nosetests
# Coverage
$ nosetests --config nose_cover.cfg
If you have access to the capakey service, you can enter your credentials in
the `nose_development.ini` file and use that as a test config.
.. code-block:: bash
# Integration tests with nose but no coverage
$ nosetests --tc-file nose_development.ini
# Integration tests with nose and coverage
$ nosetests --tc-file nose_development.ini --config nose_cover.cfg
.. _agiv: http://www.agiv.be
.. _tox: http://tox.testrun.org
0.2.0 (03-12-2013)
------------------
- Added a :class:`Gateway <crabpy.gateway.capakey.CapakeyGateway>` for the
Capakey webservice.
- Added caching to the Capakey Gateway using
`Dogpile <https://bitbucket.org/zzzeek/dogpile.cache>`_
- Better test coverage. Ability to skip integration tests.
- Added some documentation.
- Removed a dependency for resolving UsernameDigestTokens. This in term removed
the original suds from the dependency chain.
- Due to removing those dependencies, compatibility with Python 3.2 and 3.3 is
now present.
0.1.0 (25-10-2013)
------------------
- Initial release
- A working client for the `CRAB webservice <http://www.agiv.be/gis/diensten/?catid=156>`_.
- A working client for the `CapaKey webservice <http://www.agiv.be/gis/diensten/?catid=138>`_.
======
This library provides access to the CRAB and CAPAKEY webservices operated by
the AGIV. Because connecting to these SOAP services from python can be somewhat
complicated, this library makes it easier.
.. image:: https://travis-ci.org/OnroerendErfgoed/crabpy.png?branch=master
:target: https://travis-ci.org/OnroerendErfgoed/crabpy
.. image:: https://badge.fury.io/py/crabpy.png
:target: http://badge.fury.io/py/crabpy
Using the CRAB webservice
-------------------------
Recently, the CRAB service has become public. The need to authenticate has been
removed, making it a whole lot easier to connect.
.. code-block:: python
from crabpy.client import crab_factory
crab = crab_factory()
res = crab.service.ListGemeentenByGewestId(1)
print res
Using the CAPAKEY webservice
----------------------------
This service does still require authentication. This requires a valid account
from agiv_. Because the authentication also requires some extra WS-Addressing
headers, a utility function has been provided to make life easier.
.. code-block:: python
from crabpy.client import capakey_factory, capakey_request
capakey = capakey_factory(
user='USER',
password='PASSWORD'
)
res = capakey_request(capakey, 'ListAdmGemeenten', 1)
print res
Using the CAPAKEY gateway
-------------------------
To make life easier and capakey more pythonic, we've also implemented a gateway
that abstracts some more of the service and provides richer objects as responses.
.. code-block:: python
from crabpy.client import capakey_factory
from crabpy.gateway.capakey import CapakeyGateway
capakey = capakey_factory(
user='USER',
password='PASSWORD'
)
g = CapakeyGateway(capakey)
res = g.list_gemeenten()
print res
See the examples folder for some more sample code.
Development
-----------
Crabpy is still in alpha development. Currently we're just happy to have gotten
a SOAP service working in python.
We try to cover as much code as we can with unit tests. You can run them using
tox_ or directly through nose:
.. code-block:: bash
$ tox
# No coverage
$ nosetests
# Coverage
$ nosetests --config nose_cover.cfg
If you have access to the capakey service, you can enter your credentials in
the `nose_development.ini` file and use that as a test config.
.. code-block:: bash
# Integration tests with nose but no coverage
$ nosetests --tc-file nose_development.ini
# Integration tests with nose and coverage
$ nosetests --tc-file nose_development.ini --config nose_cover.cfg
.. _agiv: http://www.agiv.be
.. _tox: http://tox.testrun.org
0.2.0 (03-12-2013)
------------------
- Added a :class:`Gateway <crabpy.gateway.capakey.CapakeyGateway>` for the
Capakey webservice.
- Added caching to the Capakey Gateway using
`Dogpile <https://bitbucket.org/zzzeek/dogpile.cache>`_
- Better test coverage. Ability to skip integration tests.
- Added some documentation.
- Removed a dependency for resolving UsernameDigestTokens. This in term removed
the original suds from the dependency chain.
- Due to removing those dependencies, compatibility with Python 3.2 and 3.3 is
now present.
0.1.0 (25-10-2013)
------------------
- Initial release
- A working client for the `CRAB webservice <http://www.agiv.be/gis/diensten/?catid=156>`_.
- A working client for the `CapaKey webservice <http://www.agiv.be/gis/diensten/?catid=138>`_.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
crabpy-0.2.0.tar.gz
(5.5 kB
view details)
File details
Details for the file crabpy-0.2.0.tar.gz
.
File metadata
- Download URL: crabpy-0.2.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e136d167d0500b279cc4b7a236f18938a9f37b7f487807867aa25a408b74bb6 |
|
MD5 | 6f634970bbf3bb1df0da6d12061aaa4e |
|
BLAKE2b-256 | 7b4d508171124259dd97ae974481cfa1368771335f64ada5baa1c9901951d4b3 |