Skip to main content

Pull data directly from the danish vehicle registar with dmr.py

Project description

dmr.py

PyPI - Python Version PyPI PyPI - Downloads
You will no longer need an exspensive API for danish licens plate lookups with dmr.py, this tool scrapes motorregister.skat.dk directly and returns the data for you to use in your application.

Installation:

Install with pip

python -m pip install dmr.py

Install current code from this repo, you will need to have git installed in order to do this.

python -m pip install git+https://github.com/j4asper/dmr.py

Example

synchronously

from dmr import DMR

licens_plate = "cw87553"

# Get DMR object with data
vehicle = DMR().get_by_plate(licens_plate)

print("The vehicle make is:", vehicle.make)

Asynchronously

from dmr import DMR

licens_plate = "cw87553"

# Get DMR object with data
vehicle = await DMR().get_by_plate_async(licens_plate)

print("The vehicle make is:", vehicle.make)

All attributes to the DMR() object can be viewed in the Wiki

Contributing:

I would be more than happy if those who know how to make pull requests, contribute with code!

ToDo

  • Add from_json and to_json functions.
  • Add documentation with all possible values.
  • Scrape more parts of the DMR site to get even more data.
  • Add wider tests with different types of cars or bikes.

Issue we can't do anything about.

If you have used this tool, you might notice that it is slow AF. That is probably due to our government using multiple 80-100 GB XML files as the databse for all vehicles in Denmark. It roughly takes about 3 seconds to do a lookup on the DMR site.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmr.py-0.0.3.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

dmr.py-0.0.3-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page