<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>LaForge's home page (Posts about python)</title><link>https://laforge.gnumonks.org/</link><description></description><atom:link href="https://laforge.gnumonks.org/blog/tags/python.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Thu, 24 Oct 2024 20:08:49 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>python-inema: Python module implementing Deutsche Post 1C4A Internetmarke API</title><link>https://laforge.gnumonks.org/blog/20160724-python_inema/</link><dc:creator>Harald Welte</dc:creator><description>&lt;p&gt;At sysmocom we maintain a &lt;a class="reference external" href="https://shop.sysmocom.de/"&gt;webshop&lt;/a&gt; with various
smaller items and accessories interesting to the Osmocom community as well as the
wider community of people experimenting (aka 'playing') with cellular
communications infrastructure.  As this is primarily a service to the community
and not our main business, I'm always interested in ways to reduce the amount of
time our team has to use in order to operate the webshop.&lt;/p&gt;
&lt;p&gt;In order to make the shipping process more efficient, I discovered that
Deutsche Post is &lt;a class="reference external" href="https://www.deutschepost.de/de/i/internetmarke-porto-drucken/partner-werden.html"&gt;offering a Web API based on SOAP+WSDL which can be used to generate
franking&lt;/a&gt;
for the (registered) letters that we ship around the world with our products.&lt;/p&gt;
&lt;p&gt;The most interesting part of this is that you can generate combined address +
franking labels.  As address labels need to be printed anyway, there is little
impact on the shipping process beyond having to use this API to generate the
right franking for the particular shipment.&lt;/p&gt;
&lt;p&gt;Given the general usefulness of such an online franking process, I would have
assumed that virtually anyone operating some kind of shop that regularly mails
letters/products would use it and hence at least one of those users would have
already written some free / open source software code fro it. To my big
surprise, I could not find any FOSS implementation of this API.&lt;/p&gt;
&lt;p&gt;If you know me, I'm the last person to know anything about &lt;em&gt;web technology&lt;/em&gt;
beyond HTML 4 which was the latest upcoming new thing when I last did anything
web related ;)&lt;/p&gt;
&lt;p&gt;Nevertheless, using the &lt;a class="reference external" href="https://pypi.python.org/pypi/zeep/0.13.0"&gt;python-zeep&lt;/a&gt; module, it was fairly easy to
interface the web service.  The weirdest part is the custom signature algorithm
that they use to generate some custom soap headers.  I'm sure they have their
reasons ;)&lt;/p&gt;
&lt;p&gt;Today I hence present the &lt;a class="reference external" href="http://git.sysmocom.de/python-inema/"&gt;python-inema&lt;/a&gt; project, a python module for accessing
this Internetmarke API.&lt;/p&gt;
&lt;p&gt;Please note while I'm fluent in Pascal, Perl, C and Erlang, programming in Python
doesn't yet come natural to me.  So if you have any
comments/feedback/improvements, they're most welcome by e-mail, including any patches.&lt;/p&gt;</description><category>python</category><category>sysmocom</category><guid>https://laforge.gnumonks.org/blog/20160724-python_inema/</guid><pubDate>Sat, 23 Jul 2016 08:00:00 GMT</pubDate></item></channel></rss>