Skip to content

kapt-labs/laposte-python-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

La Poste SDK

https://travis-ci.org/geelweb/laposte-python-sdk.svg?branch=master https://coveralls.io/repos/github/geelweb/laposte-python-sdk/badge.svg?branch=master

LaPosteSDK is a Python client library to work with La Poste API

Installation

pip install lapostesdk

Requirements

  • requests

Dev requirements

  • responses

Configuration

from lapostesdk.laposteapi import LaPosteApi
api = LaPosteApi(api_key='YourApiKey')

Test suite

python -m unittest test

Apis

ControlAdresse

The ControlAdresse Api

Address look up

response = api.controladresse.search('116 avenue du Président Kennedy 75220 Paris Cedex 16')

Address details

adresse = api.controladresse.get('adresses/12280852') print adresse.codePostal

Suivi

The Suivi Api

suivi = api.suivi.get('1111111111111')
print suivi.status

Tarif envoi

The Tarif envoi

Simple call

rates = api.tarifenvoi.get('lettre', 10)

>>> [{'channel': u'bureau',
      'currency': u'\u20ac',
      'price': 0.8,
      'product': u'Lettre verte'},
     {'channel': u'en ligne',
      'currency': u'\u20ac',
      'price': 0.77,
      'product': u'Lettre verte'},
     {'channel': u'bureau',
      'currency': u'\u20ac',
      'price': 0.95,
      'product': u'Lettre prioritaire'},
     {'channel': u'en ligne',
      'currency': u'\u20ac',
      'price': 0.92,
      'product': u'Lettre prioritaire'},
     {'channel': u'bureau',
      'currency': u'\u20ac',
      'price': 0.78,
      'product': u'Ecopli'}]

Filtered call

About

Python client library to work with La Poste API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%