{"id":22308023,"url":"https://github.com/akretion/laposte_api","last_synced_at":"2025-09-12T03:34:12.970Z","repository":{"id":17657705,"uuid":"20462293","full_name":"akretion/laposte_api","owner":"akretion","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-16T13:53:22.000Z","size":3483,"stargazers_count":4,"open_issues_count":3,"forks_count":4,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-07-29T05:51:37.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"google/material-design-icons","license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akretion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-06-03T22:38:04.000Z","updated_at":"2016-12-20T10:00:05.000Z","dependencies_parsed_at":"2025-07-29T05:36:27.060Z","dependency_job_id":"9f7c197f-ee7e-420a-9868-e32a02437dae","html_url":"https://github.com/akretion/laposte_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akretion/laposte_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akretion%2Flaposte_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akretion%2Flaposte_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akretion%2Flaposte_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akretion%2Flaposte_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akretion","download_url":"https://codeload.github.com/akretion/laposte_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akretion%2Flaposte_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274748342,"owners_count":25341942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T20:12:56.722Z","updated_at":"2025-09-12T03:34:12.934Z","avatar_url":"https://github.com/akretion.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"laposte_api\n===========\n\n'laposte_api' is a library for Python to generate label for Laposte (France), transportation services\n\nThis library allow to produce ZPL files used to print parcel label with Zebra printers\n\nThe available services are:\n- Colissimo\n\n    * Colissimo France\n    * Colissimo International with web service.\n- So Colissimo\n\n\n#Motivation\n\nThe first objective of this code is to provide to applications\nZPL files generation?\nThe first application in which it is used is Odoo / OpenERP.\n\n\n#Installation\n\nThe easiest way to install laposte_api:\n\n    pip install git+https://github.com/akretion/laposte_api.git\n\n#Usage\n\n    #Example for Colissimo transportation service in France\n\n    from laposte_api.colissimo_and_so import (\n        ColiPoste,\n        InvalidDataForMako)\n\n    from laposte_api.exception_helper import (\n        InvalidWeight,\n        InvalidSize,\n        InvalidMissingField,\n        InvalidCode,\n        InvalidZipCode,\n        InvalidCountry,\n        InvalidKeyInTemplate,\n        InvalidType)\n\n    # example datas : update with demo datas in ColiPoste specs\n    product = 'colissimo'\n    label_code = '9V'\n    account = '766666'\n    parcel_weight = 5\n\n\n    def get_sequence(label_code):\n        \"\"\" Sequence must be unique and set only once\n            Range numbers are defined by La Poste\n            Define your OWN method\n        \"\"\"\n        return '9V 00000 00006' #example\n\n    try:\n        service = ColiPoste(account).get_service(product, label_code)\n    except (InvalidSize, InvalidCode, InvalidType, Exception) as e:\n        raise\n\n    tracking_ref = service.get_cab_suivi(get_sequence(label_code))\n    \n    sender = {\n        'city': u'Paris', 'account': account, 'name': u'My Company',\n        'zip': u'75001', 'phone': u'01 99 99 99 99', 'country': u'France',\n        'support_city': u'MOISSY  PFC', 'street': u'1 rue Clignacourt',\n        'email': u'info@mycompany.com'}\n\n    address = {\n        'city': u'Lyon', 'name': u'Jim NHASTIC', 'zip': u'69001',\n        'countryCode': u'FR', 'street': u'150 rue Vauban'}\n\n\n    infos = {\n        'zip': address['zip'],\n        'countryCode': address['countryCode'],\n        'weight': parcel_weight,\n        'carrier_track': tracking_ref,\n    }\n\n    option = {'ftd': False, 'ar': False, 'nm': True, 'insurance': u'03'}\n    infos.update(option)\n\n    try:\n        prise_en_charge_barcode = service.get_cab_prise_en_charge(infos)\n    except (InvalidWeight, Exception) as e:\n        raise\n\n    delivery = {\n        'weight': parcel_weight, 'date': '22/06/2014',\n        'ref_client': u'OUT/00033', 'Instructions': '',\n        'cab_suivi': tracking_ref,\n        'cab_prise_en_charge': prise_en_charge_barcode,\n        }\n\n\n    try:\n        # sender, delivery, address and option are dict contains datas\n        # used to generate label in ZPL format (Zebra Programming Language)\n        label_file = service.get_label(\n            sender, delivery, address, option)\n        # you can send these datas to your zebra printer\n    except (InvalidDataForMako,\n            InvalidKeyInTemplate,\n            InvalidKeyInTemplate,\n            InvalidMissingField) as e:\n        raise\n\n    print \"VOICI L'ETIQUETTE ZPL POUR COLISSIMO France:\\n\"\n    print \"=========================================\\n\\n\\n\", label_file\n\n#Specification\nsee doc folder\n\n\n#Copyright and License\n\nlaposte_api is copyright (c) 2014 David Béal \u003cdavid.beal@akretion.com\u003e\n\nlicence : GNU Affero General Public License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakretion%2Flaposte_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakretion%2Flaposte_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakretion%2Flaposte_api/lists"}