py-canada-post 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_canada_post-1.0.0/.github/FUNDING.yml +1 -0
- py_canada_post-1.0.0/.github/workflows/release.yml +63 -0
- py_canada_post-1.0.0/.github/workflows/tests.yml +38 -0
- py_canada_post-1.0.0/.gitignore +131 -0
- py_canada_post-1.0.0/.readthedocs.yaml +15 -0
- py_canada_post-1.0.0/LICENSE +21 -0
- py_canada_post-1.0.0/PKG-INFO +261 -0
- py_canada_post-1.0.0/README.md +240 -0
- py_canada_post-1.0.0/docs/assets/logo.ico +0 -0
- py_canada_post-1.0.0/docs/assets/logo.png +0 -0
- py_canada_post-1.0.0/docs/cli.md +152 -0
- py_canada_post-1.0.0/docs/how-to-use.md +123 -0
- py_canada_post-1.0.0/docs/index.md +47 -0
- py_canada_post-1.0.0/docs/roadmap.md +81 -0
- py_canada_post-1.0.0/docs/usage.md +19 -0
- py_canada_post-1.0.0/mkdocs.yml +61 -0
- py_canada_post-1.0.0/py_canada_post/__init__.py +6 -0
- py_canada_post-1.0.0/py_canada_post/__main__.py +4 -0
- py_canada_post-1.0.0/py_canada_post/cli/__init__.py +0 -0
- py_canada_post-1.0.0/py_canada_post/cli/app.py +32 -0
- py_canada_post-1.0.0/py_canada_post/cli/rating/__init__.py +1 -0
- py_canada_post-1.0.0/py_canada_post/cli/rating/commands/__init__.py +0 -0
- py_canada_post-1.0.0/py_canada_post/cli/rating/commands/discover_services.py +54 -0
- py_canada_post-1.0.0/py_canada_post/cli/rating/commands/get_rates.py +154 -0
- py_canada_post-1.0.0/py_canada_post/cli/rating/rating_app.py +12 -0
- py_canada_post-1.0.0/py_canada_post/client.py +113 -0
- py_canada_post-1.0.0/py_canada_post/exceptions/__init__.py +37 -0
- py_canada_post-1.0.0/py_canada_post/exceptions/exception_map.py +138 -0
- py_canada_post-1.0.0/py_canada_post/exceptions/exceptions.py +150 -0
- py_canada_post-1.0.0/py_canada_post/services/__init__.py +0 -0
- py_canada_post-1.0.0/py_canada_post/services/rating/__init__.py +31 -0
- py_canada_post-1.0.0/py_canada_post/services/rating/operations/__init__.py +0 -0
- py_canada_post-1.0.0/py_canada_post/services/rating/operations/discover_services.py +131 -0
- py_canada_post-1.0.0/py_canada_post/services/rating/operations/get_rates.py +259 -0
- py_canada_post-1.0.0/py_canada_post/services/rating/rating.py +51 -0
- py_canada_post-1.0.0/py_canada_post/services/rating/types.py +364 -0
- py_canada_post-1.0.0/py_canada_post/utils/__init__.py +0 -0
- py_canada_post-1.0.0/py_canada_post/utils/construct_xml_element.py +160 -0
- py_canada_post-1.0.0/py_canada_post/utils/error_handler.py +43 -0
- py_canada_post-1.0.0/py_canada_post/utils/response_to_object/__init__.py +0 -0
- py_canada_post-1.0.0/py_canada_post/utils/response_to_object/response_to_object.py +222 -0
- py_canada_post-1.0.0/py_canada_post/utils/response_to_object/serialization/__init__.py +0 -0
- py_canada_post-1.0.0/py_canada_post/utils/response_to_object/serialization/rate_to_object.py +212 -0
- py_canada_post-1.0.0/py_canada_post/utils/response_to_object/serialization/service_to_object.py +58 -0
- py_canada_post-1.0.0/pyproject.toml +50 -0
- py_canada_post-1.0.0/tests/__init__.py +0 -0
- py_canada_post-1.0.0/tests/conftest.py +14 -0
- py_canada_post-1.0.0/tests/test_rates.py +76 -0
- py_canada_post-1.0.0/tests/test_services.py +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: [joludyaster]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [ published ]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
name: Tests
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v6
|
|
15
|
+
|
|
16
|
+
- name: Set up Python 3.11
|
|
17
|
+
uses: actions/setup-python@v6
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.11"
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
23
|
+
with:
|
|
24
|
+
enable-cache: true
|
|
25
|
+
|
|
26
|
+
# - name: Lint
|
|
27
|
+
# run: uv run ruff check .
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: uv sync
|
|
31
|
+
|
|
32
|
+
- name: Run pytest
|
|
33
|
+
env:
|
|
34
|
+
CUSTOMER_NUMBER: ${{ secrets.CUSTOMER_NUMBER }}
|
|
35
|
+
CONTRACT_ID: ${{ secrets.CONTRACT_ID }}
|
|
36
|
+
API_KEY: ${{ secrets.API_KEY }}
|
|
37
|
+
run: uv run pytest --tb=short -v
|
|
38
|
+
|
|
39
|
+
publish:
|
|
40
|
+
needs: [test]
|
|
41
|
+
name: Publish
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
environment: pypi
|
|
44
|
+
permissions:
|
|
45
|
+
id-token: write
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- name: Checkout code
|
|
49
|
+
uses: actions/checkout@v6
|
|
50
|
+
|
|
51
|
+
- name: Set up Python
|
|
52
|
+
uses: actions/setup-python@v6
|
|
53
|
+
with:
|
|
54
|
+
python-version: "3.11"
|
|
55
|
+
|
|
56
|
+
- name: Install uv
|
|
57
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
58
|
+
|
|
59
|
+
- name: Build package
|
|
60
|
+
run: uv build --no-sources
|
|
61
|
+
|
|
62
|
+
- name: Publish to PyPI
|
|
63
|
+
run: uv publish
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Run pytest tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
name: Tests
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout code
|
|
15
|
+
uses: actions/checkout@v6
|
|
16
|
+
|
|
17
|
+
- name: Set up Python 3.11
|
|
18
|
+
uses: actions/setup-python@v6
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.11"
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
24
|
+
with:
|
|
25
|
+
enable-cache: true
|
|
26
|
+
|
|
27
|
+
# - name: Lint
|
|
28
|
+
# run: uv run ruff check .
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync
|
|
32
|
+
|
|
33
|
+
- name: Run pytest
|
|
34
|
+
env:
|
|
35
|
+
CUSTOMER_NUMBER: ${{ secrets.CUSTOMER_NUMBER }}
|
|
36
|
+
CONTRACT_ID: ${{ secrets.CONTRACT_ID }}
|
|
37
|
+
API_KEY: ${{ secrets.API_KEY }}
|
|
38
|
+
run: uv run pytest --tb=short -v
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
.idea/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
pip-wheel-metadata/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
uv.lock
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
.python-version
|
|
88
|
+
|
|
89
|
+
# pipenv
|
|
90
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
91
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
92
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
93
|
+
# install all needed dependencies.
|
|
94
|
+
#Pipfile.lock
|
|
95
|
+
|
|
96
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
97
|
+
__pypackages__/
|
|
98
|
+
|
|
99
|
+
# Celery stuff
|
|
100
|
+
celerybeat-schedule
|
|
101
|
+
celerybeat.pid
|
|
102
|
+
|
|
103
|
+
# SageMath parsed files
|
|
104
|
+
*.sage.py
|
|
105
|
+
|
|
106
|
+
# Environments
|
|
107
|
+
.env
|
|
108
|
+
.venv
|
|
109
|
+
env/
|
|
110
|
+
venv/
|
|
111
|
+
ENV/
|
|
112
|
+
env.bak/
|
|
113
|
+
venv.bak/
|
|
114
|
+
|
|
115
|
+
# Spyder project settings
|
|
116
|
+
.spyderproject
|
|
117
|
+
.spyproject
|
|
118
|
+
|
|
119
|
+
# Rope project settings
|
|
120
|
+
.ropeproject
|
|
121
|
+
|
|
122
|
+
# mkdocs documentation
|
|
123
|
+
/site
|
|
124
|
+
|
|
125
|
+
# mypy
|
|
126
|
+
.mypy_cache/
|
|
127
|
+
.dmypy.json
|
|
128
|
+
dmypy.json
|
|
129
|
+
|
|
130
|
+
# Pyre type checker
|
|
131
|
+
.pyre/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Read the Docs configuration file
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
# Required
|
|
5
|
+
version: 2
|
|
6
|
+
|
|
7
|
+
# Set the OS, Python version, and other tools you might need
|
|
8
|
+
build:
|
|
9
|
+
os: ubuntu-lts-latest
|
|
10
|
+
tools:
|
|
11
|
+
python: "3.11"
|
|
12
|
+
commands:
|
|
13
|
+
- pip install uv
|
|
14
|
+
- uv sync
|
|
15
|
+
- uv run mkdocs build --site-dir $READTHEDOCS_OUTPUT/html
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 joludyaster
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-canada-post
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python wrapper to interact with Canada Post API.
|
|
5
|
+
Author-email: Davyd <contact@davyd-svidnitskyi.me>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: Canada Post API,Python wrapper,cli
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Requires-Dist: cyclopts==4.12.0
|
|
14
|
+
Requires-Dist: mkdocs-material>=9.7.6
|
|
15
|
+
Requires-Dist: mkdocstrings-python>=2.0.3
|
|
16
|
+
Requires-Dist: pytest==9.0.3
|
|
17
|
+
Requires-Dist: python-dotenv>=1.2.2
|
|
18
|
+
Requires-Dist: requests==2.34.0
|
|
19
|
+
Requires-Dist: xmltodict>=1.0.4
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
# Py-canada-post
|
|
25
|
+
Python written wrapper to interact with Canada Post API.
|
|
26
|
+
|
|
27
|
+
## Table of contents
|
|
28
|
+
|
|
29
|
+
- [Why was it created?](#why-was-it-created)
|
|
30
|
+
- [How to use?](#how-to-use)
|
|
31
|
+
- [Essential steps](#essential-steps)
|
|
32
|
+
- [Quick start](#quick-start)
|
|
33
|
+
- [Install from PyPi](#install-from-pypi)
|
|
34
|
+
- [Install from source](#install-from-source)
|
|
35
|
+
- [Getting started](#getting-started)
|
|
36
|
+
- [CLI](#cli)
|
|
37
|
+
- [Roadmap](#roadmap)
|
|
38
|
+
|
|
39
|
+
## Why was it created?
|
|
40
|
+
There is no public Python library/wrapper to interact with Canada Post API, so an idea was born and brought to life.
|
|
41
|
+
|
|
42
|
+
## How to use?
|
|
43
|
+
|
|
44
|
+
### Essential steps:
|
|
45
|
+
Before you start using this wrapper, you should perform these essential steps:
|
|
46
|
+
|
|
47
|
+
1. Create a virtual environment:
|
|
48
|
+
|
|
49
|
+
- Using python:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -m venv .venv
|
|
53
|
+
source .venv/bin/activate
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- Using uv:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
uv python pin 3.11
|
|
60
|
+
uv init
|
|
61
|
+
uv sync
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. Create .env and put your customer number, contract id and api key in there as followed:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
CUSTOMER_NUMBER=12345667
|
|
68
|
+
CONTRACT_ID=12344556
|
|
69
|
+
API_KEY=ewfghui34hto34ghui34g:ewghui234h23oih34uigh423
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
To test this app, you will need some test credentials. You can get
|
|
73
|
+
them [here](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/fundamentals.jsf).
|
|
74
|
+
|
|
75
|
+
If you would like to obtain your own, you can register your [business](https://sso-osu.canadapost-postescanada.ca/pfe-pap/en/registration) and [join the Developer Program](https://www.canadapost-postescanada.ca/information/app/drc/home?execution=e2s1).
|
|
76
|
+
|
|
77
|
+
### Quick start
|
|
78
|
+
|
|
79
|
+
To use this wrapper, you will need 3.11+ python version and pip.
|
|
80
|
+
|
|
81
|
+
#### Install from PyPi
|
|
82
|
+
|
|
83
|
+
```commandline
|
|
84
|
+
pip install py-canada-post
|
|
85
|
+
```
|
|
86
|
+
or
|
|
87
|
+
```commandline
|
|
88
|
+
uv add py-canada-post
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Install from source
|
|
92
|
+
|
|
93
|
+
1. Clone the repository:
|
|
94
|
+
|
|
95
|
+
```commandline
|
|
96
|
+
git clone https://github.com/joludyaster/py-canada-post.git
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
2. Run:
|
|
100
|
+
|
|
101
|
+
```commandline
|
|
102
|
+
pip install .
|
|
103
|
+
```
|
|
104
|
+
or
|
|
105
|
+
```commandline
|
|
106
|
+
uv pip install .
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Getting started
|
|
110
|
+
|
|
111
|
+
You could define the client object yourself:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
import os
|
|
115
|
+
|
|
116
|
+
from py_canada_post.client import PyCanadaPost
|
|
117
|
+
from py_canada_post.services.rating import Destination, DomesticDestination
|
|
118
|
+
from dotenv import load_dotenv
|
|
119
|
+
|
|
120
|
+
load_dotenv()
|
|
121
|
+
|
|
122
|
+
customer_number = os.getenv("CUSTOMER_NUMBER", 0)
|
|
123
|
+
api_key = os.getenv("API_KEY", "")
|
|
124
|
+
contract_id = os.getenv("CONTRACT_ID", 0)
|
|
125
|
+
|
|
126
|
+
def main():
|
|
127
|
+
py_canada_post_client = PyCanadaPost(
|
|
128
|
+
customer_number=customer_number,
|
|
129
|
+
api_key=api_key,
|
|
130
|
+
contract_id=contract_id
|
|
131
|
+
)
|
|
132
|
+
rates = py_canada_post_client.rating.rates.get_rates(
|
|
133
|
+
"E4M8S3",
|
|
134
|
+
Destination(
|
|
135
|
+
domestic=DomesticDestination("T3Z1C8")
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
print(rates)
|
|
139
|
+
|
|
140
|
+
if __name__ == "__main__":
|
|
141
|
+
main()
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Or you could use a shortcut:
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from py_canada_post.client import PyCanadaPost
|
|
148
|
+
from py_canada_post.services.rating import Destination, DomesticDestination
|
|
149
|
+
|
|
150
|
+
def main():
|
|
151
|
+
py_canada_post_client = PyCanadaPost.from_env()
|
|
152
|
+
rates = py_canada_post_client.rating.rates.get_rates(
|
|
153
|
+
"E4M8S3",
|
|
154
|
+
Destination(
|
|
155
|
+
domestic=DomesticDestination("T3Z1C8")
|
|
156
|
+
)
|
|
157
|
+
)
|
|
158
|
+
print(rates)
|
|
159
|
+
|
|
160
|
+
if __name__ == "__main__":
|
|
161
|
+
main()
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
See the [documentation](https://py-canada-post.readthedocs.io/en/latest/) to learn more.
|
|
165
|
+
|
|
166
|
+
## CLI
|
|
167
|
+
|
|
168
|
+
```commandline
|
|
169
|
+
Usage:
|
|
170
|
+
py-canada-post [-v] [-h]
|
|
171
|
+
py-canada-post rating get-rates ORIGIN-POSTAL-CODE [ARGS]
|
|
172
|
+
py-canada-post rating discover-services COUNTRY-CODE [ARGS]
|
|
173
|
+
|
|
174
|
+
more to come...
|
|
175
|
+
|
|
176
|
+
Options:
|
|
177
|
+
rating Command to contain all rating-related commands (e.g. get_rates, discover_services etc.). │
|
|
178
|
+
--help (-h) Display this message and exit. │
|
|
179
|
+
--version (-v) Display application version.
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
See the [CLI documentation](https://py-canada-post.readthedocs.io/en/latest/cli/) to learn more.
|
|
183
|
+
|
|
184
|
+
## Roadmap
|
|
185
|
+
|
|
186
|
+
- [ ] [Rating](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/rating/default.jsf)
|
|
187
|
+
- [x] [Get rates](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/rating/getrates/default.jsf)
|
|
188
|
+
- [x] [Discover services](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/rating/getrates/discoverservices.jsf)
|
|
189
|
+
- [ ] [Get service](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/rating/getrates/getservices.jsf)
|
|
190
|
+
- [ ] [Get option](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/rating/getrates/getoption.jsf)
|
|
191
|
+
|
|
192
|
+
- [ ] [Contract shipping](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/default.jsf)
|
|
193
|
+
|
|
194
|
+
- [ ] Shipping service
|
|
195
|
+
- [ ] [Create shipment](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/createshipment.jsf)
|
|
196
|
+
- [ ] [Get shipment](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipment.jsf)
|
|
197
|
+
- [ ] [Get artifact](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipmentartifact.jsf)
|
|
198
|
+
- [ ] [Get shipment price](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipmentprice.jsf)
|
|
199
|
+
- [ ] [Get shipment receipt](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipmentreceipt.jsf)
|
|
200
|
+
- [ ] [Get shipment details](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipmentdetails.jsf)
|
|
201
|
+
- [ ] [Get shipment public key info](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/publickeyinfo.jsf)
|
|
202
|
+
- [ ] [Get groups](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/groups.jsf)
|
|
203
|
+
- [ ] [Get shipments](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipments.jsf)
|
|
204
|
+
- [ ] [Void shipment](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/voidshipment.jsf)
|
|
205
|
+
- [ ] [Request shipment refund](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipmentrefund.jsf)
|
|
206
|
+
|
|
207
|
+
- [ ] Manifest service
|
|
208
|
+
- [ ] [Transmit shipments](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/transmitshipments.jsf)
|
|
209
|
+
- [ ] [Get manifest](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/manifest.jsf)
|
|
210
|
+
- [ ] [Get artifact](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipmentartifact.jsf)
|
|
211
|
+
- [ ] [Get manifest details](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/manifestdetails.jsf)
|
|
212
|
+
- [ ] [Get manifests](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/manifests.jsf)
|
|
213
|
+
|
|
214
|
+
- [ ] Customer information services
|
|
215
|
+
- [ ] [Get customer information](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/creditstatus.jsf)
|
|
216
|
+
- [ ] [Get MOBO customer information](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/mobocreditstatus.jsf)
|
|
217
|
+
|
|
218
|
+
- [ ] [Non-contract shipping](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/onestepshipping/default.jsf)
|
|
219
|
+
- [ ] [Create non-contract shipping](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/onestepshipping/createshipment.jsf)
|
|
220
|
+
- [ ] [Get artifact](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipmentartifact.jsf)
|
|
221
|
+
- [ ] [Get non-contract shipment receipt](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/onestepshipping/shipmentreceipt.jsf)
|
|
222
|
+
- [ ] [Get non-contract shipment details](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/onestepshipping/shipmentdetails.jsf)
|
|
223
|
+
- [ ] [Get non-contract shipment public key info](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/onestepshipping/publickeyinfo.jsf)
|
|
224
|
+
- [ ] [Get non-contract shipments](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/onestepshipping/onestepshipments.jsf)
|
|
225
|
+
- [ ] [Get non-contract shipment](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/onestepshipping/onestepshipment.jsf)
|
|
226
|
+
- [ ] [Request non-contract shipment refund](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/onestepshipping/shipmentrefund.jsf)
|
|
227
|
+
|
|
228
|
+
- [ ] [Tracking](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/tracking/default.jsf)
|
|
229
|
+
- [ ] [Get tracking summary](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/tracking/trackingsummary.jsf)
|
|
230
|
+
- [ ] [Get tracking details](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/tracking/trackingdetails.jsf)
|
|
231
|
+
- [x] [Get signature image](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/tracking/signatureimage.jsf) no longer available
|
|
232
|
+
- [ ] [Get delivery confirmation certificate](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/tracking/deliveryconfirmation.jsf)
|
|
233
|
+
|
|
234
|
+
- [ ] [Find a post office](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/findpostoffice/default.jsf)
|
|
235
|
+
- [ ] [Get nearest post office](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/findpostoffice/nearestpostoffice.jsf)
|
|
236
|
+
- [ ] [Get post office detail](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/findpostoffice/postofficedetail.jsf)
|
|
237
|
+
|
|
238
|
+
- [ ] [Pickup](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/parcelpickup/default.jsf)
|
|
239
|
+
- [ ] [Get pickup availability](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/parcelpickup/availability.jsf)
|
|
240
|
+
- [ ] [Get pickup price](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/parcelpickup/pickupprice.jsf)
|
|
241
|
+
- [ ] [Create pickup request](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/parcelpickup/createpickup.jsf)
|
|
242
|
+
- [ ] [Get pickup request details](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/parcelpickup/pickupdetails.jsf)
|
|
243
|
+
- [ ] [Update pickup request](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/parcelpickup/updatepickup.jsf)
|
|
244
|
+
- [ ] [Cancel pickup request](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/parcelpickup/cancelpickup.jsf)
|
|
245
|
+
- [ ] [Get pickup requests](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/parcelpickup/getpickup.jsf)
|
|
246
|
+
|
|
247
|
+
- [ ] [Returns](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/default.jsf)
|
|
248
|
+
|
|
249
|
+
- [ ] Authorized returns
|
|
250
|
+
- [ ] [Create authorized return](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/createreturn.jsf)
|
|
251
|
+
- [ ] [Get artifact](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/shippingmanifest/shipmentartifact.jsf)
|
|
252
|
+
|
|
253
|
+
- [ ] Open returns
|
|
254
|
+
- [ ] [Create open return template](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/createopenreturn.jsf)
|
|
255
|
+
- [ ] [Retrieve next open return artifact](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/retopenreturnartifact.jsf)
|
|
256
|
+
- [ ] [Get open return template](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/getopenreturntemplate.jsf)
|
|
257
|
+
- [ ] [Get open return template details](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/getopenreturntempdetails.jsf)
|
|
258
|
+
- [ ] [Get open return template](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/deleteopenreturntemp.jsf)
|
|
259
|
+
- [ ] [Delete open return template](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/deleteopenreturntemp.jsf)
|
|
260
|
+
- [ ] [Get open return templates](https://www.canadapost-postescanada.ca/info/mc/business/productsservices/developers/services/returns/getopenreturntemplates.jsf)
|
|
261
|
+
|