pysagec is a Python library to use with SAGEC MRW webservices.
It aims to be simple to use but with the ability to use any of the fields of the underlying API:
import pysagec
import datetime as dt
url = '//user:[email protected]/?franchise=12&subscriber=34&department=56'
client = pysagec.create_client(url)
pickup_info = pysagec.PickupInfo(
pickup_address=pysagec.Address(street_name='Plaza de España',
postal_code='36001',
city='Pontevedra'),
recipient_name='Juan Pérez',
recipient_phone_number='555555555',
comments='Por las mañanas.',
)
service_info = pysagec.ServiceInfo(
number_of_packages=1,
date=dt.date.today(),
service_code='0000',
)
response = client.send(pickup_info, service_info)
print(response.shipping_number)
- Use python classes instead of XML.
- Simplify method invocation.
- It has no dependencies, only standard library.
Install pysagec from PyPI:
$ pip install pysagec
- Remove unneeded print statement.
- Add an example.
- Include more models into __init__.
- First production ready release.
MIT.