Skip to content

Commit 4382f26

Browse files
committed
initial release
Signed-off-by: Finbarrs Oketunji <f@finbarrs.eu>
0 parents  commit 4382f26

14 files changed

+488
-0
lines changed

.gitignore

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
venv/
48+
.venv
49+
.python-version
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
58+
# Sphinx documentation
59+
docs/_build/
60+
61+
# PyBuilder
62+
target/
63+
64+
#Ipython Notebook
65+
.ipynb_checkpoints
66+
67+
# Others
68+
push.sh

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
## 0.0.1 - 2023-02-17
4+
* Initial release

CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@dvsa
2+
@0xnu

CODE_OF_CONDUCT.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team. All complaints will be reviewed and
59+
investigated and will result in a response that is deemed necessary and appropriate
60+
to the circumstances. The project team is obligated to maintain confidentiality with
61+
regard to the reporter of an incident. Further details of specific enforcement
62+
policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq
77+

CONTRIBUTORS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Finbarrs Oketunji <f@finbarrs.eu>

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2023 Finbarrs Oketunji (https://finbarrs.eu)
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
13+
all 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
21+
THE SOFTWARE.

LONG_DESCRIPTION.rst

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
mot-history-api-py-sdk
2+
======================
3+
4+
.. image:: https://badge.fury.io/py/mot-history-api-py-sdk.svg
5+
:target: https://badge.fury.io/py/mot-history-api-py-sdk
6+
:alt: MOT History API Python SDK
7+
8+
The SDK provides convenient access to the `MOT History API`_ functionality from applications written in the Python programming language.
9+
10+
.. _MOT History API: https://dvsa.github.io/mot-history-api-documentation/
11+
12+
13+
Requirements
14+
------------
15+
16+
Python 2.7 and later.
17+
18+
19+
Setup
20+
------
21+
22+
You can install this package by using the pip tool and installing:
23+
24+
.. code-block:: bash
25+
26+
$ pip install mot-history-api-py-sdk
27+
28+
Or:
29+
30+
.. code-block:: bash
31+
32+
$ easy_install mot-history-api-py-sdk
33+
34+
35+
Usage Example
36+
-------------
37+
38+
.. code-block:: python
39+
40+
from motapi.motdata import *
41+
from dotenv import load_dotenv
42+
import os
43+
44+
api_key = "<your-api-key>" # your api key
45+
registration = "ML58FOU" # example of a vehicle registration
46+
page = 1 # pagination
47+
date = "20230201" # date must be five weeks from the current date
48+
vehicle_id = "<enter your vehicle id here>" # unique vehicle ID for vehicles that have had an MOT test
49+
50+
reg = Registration(api_key)
51+
reg_data = reg.get_data(registration)
52+
print(reg_data)
53+
54+
p = Page(api_key)
55+
page_data = p.get_data(page)
56+
print(page_data)
57+
58+
d = Date(api_key)
59+
date_data = d.get_data(date, page)
60+
print(date_data)
61+
62+
v = VehicleID(api_key)
63+
vehicle_data = v.get_data(vehicle_id)
64+
print(vehicle_data)
65+
66+
67+
Request MOT History API Key
68+
---------------------------
69+
70+
You can use this support form to request an `API Key`_.
71+
72+
.. _API Key: https://www.smartsurvey.co.uk/s/MOT_History_TradeAPI_Access_and_Support?
73+
74+
75+
Using the MOT History API Key
76+
-----------------------------
77+
78+
You can read the `API documentation`_ to understand what's possible with MOT History API Key. If you need further assistance, don't hesitate to `contact the DVSA`_.
79+
80+
.. _API documentation: https://dvsa.github.io/mot-history-api-documentation/
81+
.. _contact the DVSA: https://www.smartsurvey.co.uk/s/MOT_History_TradeAPI_Access_and_Support?
82+
83+
License
84+
--------
85+
86+
This project is licensed under the `MIT License`_.
87+
88+
.. _MIT License: https://gist.github.com/0xnu/d11da49c85eeb7272517a9010bbdf1ab
89+
90+
91+
Copyright
92+
---------
93+
94+
Copyright |copy| 2023 `Finbarrs Oketunji`_.
95+
96+
The MOT History API Python SDK is Licensed under the `Open Government Licence v3.0`_
97+
98+
.. |copy| unicode:: 0xA9 .. copyright sign
99+
.. _Finbarrs Oketunji: https://www.gov.uk/dvsa
100+
.. _Open Government Licence v3.0: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/

README.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# MOT History API Python SDK
2+
3+
The SDK provides convenient access to the [MOT History API](https://dvsa.github.io/mot-history-api-documentation/) for applications written in the Python programming language.
4+
5+
## Requirements
6+
7+
Python 2.7 and later.
8+
9+
## Setup
10+
11+
You can install this package by using the pip tool and installing:
12+
13+
```python
14+
pip install mot-history-api-py-sdk
15+
16+
## OR
17+
18+
easy_install mot-history-api-py-sdk
19+
```
20+
21+
Install from source with:
22+
23+
```python
24+
python setup.py install --user
25+
26+
## or `sudo python setup.py install` to install the package for all users
27+
```
28+
29+
## Usage Example
30+
31+
```python
32+
from motapi.motdata import *
33+
from dotenv import load_dotenv
34+
import os
35+
36+
api_key = "<your-api-key>" # your api key
37+
registration = "ML58FOU" # example of a vehicle registration
38+
page = 1 # pagination
39+
date = "20230201" # date must be five weeks from the current date
40+
vehicle_id = "<enter your vehicle id here>" # unique vehicle ID for vehicles that have had an MOT test
41+
42+
reg = Registration(api_key)
43+
reg_data = reg.get_data(registration)
44+
print(reg_data)
45+
46+
p = Page(api_key)
47+
page_data = p.get_data(page)
48+
print(page_data)
49+
50+
d = Date(api_key)
51+
date_data = d.get_data(date, page)
52+
print(date_data)
53+
54+
v = VehicleID(api_key)
55+
vehicle_data = v.get_data(vehicle_id)
56+
print(vehicle_data)
57+
```
58+
59+
## Setting up a MOT History API
60+
61+
You can use this support form to request an [API Key](https://www.smartsurvey.co.uk/s/MOT_History_TradeAPI_Access_and_Support?).
62+
63+
64+
## Using the MOT History API
65+
66+
You can read the [API documentation](https://dvsa.github.io/mot-history-api-documentation/) to understand what's possible with the MOT History API. If you need further assistance, don't hesitate to [contact the DVSA](https://www.smartsurvey.co.uk/s/MOT_History_TradeAPI_Access_and_Support?).
67+
68+
69+
## License
70+
71+
This project is licensed under the [MIT License](./LICENSE).
72+
73+
74+
## Copyright
75+
76+
(c) 2023 [Finbarrs Oketunji](https://finbarrs.eu).
77+
78+
The MOT History API Python SDK is Licensed under the [Open Government Licence v3.0](
79+
https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)

motapi/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from motapi.motdata import *

0 commit comments

Comments
 (0)