Skip to main content

No project description provided

Project description

NC DMV Reservation Tools

Automated availability checking and monitoring for DMV offices across the state of North Carolina

https://teddysc.me/blog/ncdmv-reservation

Background

DMVs within reasonable distance of where I live are always completely booked, so I made this tool to help me spot when someone cancelled their appointment so I could snag it.

Since the tool was made for self-use only, currently it's hard-coded to only checks for the appointment type of 1st time Driver License Test (over 18). If you need additional features, you're welcome to contribute a PR. :)

I've used it to spot availability slot twice after running it for a few hours, and secured my reservation. :)

Quick Start

Installation

# install google-chrome / google-chrome-stable, and
# install chromedriver with your favorite package manager and put it in your $PATH
brew install chromedriver
# or sudo pacman -S chromedriver

# python3.12+ required
pipx install ncdmv-reservation

Running

$ ncdmv-driver-license-office-availability | jq | tee ncdmv.json
[
  {
    "is_reservable": true,
    "office_name": "Aberdeen",
    "street_address": "521 S. Sandhills Blvd., Aberdeen, NC",
    "zip_code": "28315"
  },
  {
    "is_reservable": true,
    "office_name": "Ahoskie",
    "street_address": "242 N.C. 42 W., Ahoskie, NC",
    "zip_code": "27910"
  },
  {
    "is_reservable": true,
    "office_name": "Albemarle",
    "street_address": "611 Concord Road, Albemarle, NC",
    "zip_code": "28001"
  },
  {
    "is_reservable": true,
    "office_name": "Andrews",
    "street_address": "1440 Main St., Andrews, NC",
    "zip_code": "28901"
  },
  {
    "is_reservable": true,
    "office_name": "Asheboro",
    "street_address": "2754 U.S. 220 Business South, Asheboro, NC",
    "zip_code": "27205"
  },
  ...
]

Filtering for the DMV office you're interested in with jq:

$ <ncdmv.json jq '.[] | select(.office_name == "Raleigh West") | .is_reservable' -r
false
# so it's completely booked (the `Raleigh West` office)

How it works

ncdmv-driver-license-office-availability spins up a chrome instance to click through the very user friendly DMV site, scrap the page, and convert it to structured JSON.

Use the -H, --no-headless option to see the chrome instance in action.

Continuous Monitoring

On your local machine

I found this approach more convenient for me.

dmv () {
	ncdmv-driver-license-office-availability | jq '.[] | select(.office_name == "Raleigh West") | .is_reservable' -r

}

# replace `say` if you're not on macOS
# you can change the frequency of the check by changing the `sleep` duration
dmv_monitor() {
	(while :; do [[ $(dmv) == true ]] && say 'go to dmv and reserve now'; sleep 60; done)&
}

# start monitoring every 60s, in the background
# don't close your terminal tab :)
dmv_monitor

# to stop it, run
# kill %1
# or just close the terminal tab. :)

GitHub Actions

Email notification via sendgrid if the DMV office of your choice is reservable.

The workflow file

Thoughts

After I wrote this I remembered that I should check GitHub first to see if someone else has already done it.

Fortunately, their solutions are outdated, and I did not reinvent the wheel. :)

Develop

$ git clone https://github.com/tddschn/ncdmv-reservation.git
$ cd ncdmv-reservation
$ poetry install

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

ncdmv_reservation-0.1.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

ncdmv_reservation-0.1.5-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file ncdmv_reservation-0.1.5.tar.gz.

File metadata

  • Download URL: ncdmv_reservation-0.1.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.1.0

File hashes

Hashes for ncdmv_reservation-0.1.5.tar.gz
Algorithm Hash digest
SHA256 171ff6e3acb156638539c35c67e8b1228079627b0c6bd5ce70eb255417c373e2
MD5 03b84f73b31f21b7516a6336e2a3653b
BLAKE2b-256 3200e308209814c8f45b6d10fad38156a1b44a50644afaf988ba621d6f45fb2b

See more details on using hashes here.

File details

Details for the file ncdmv_reservation-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ncdmv_reservation-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4ffe30a08fc8bf76487e71720c3032f4b42519d54789fbd500a1bf2c3a5bed50
MD5 3562033ba70196cecf14adcef309fb0b
BLAKE2b-256 0292ea4a941a78e84a767a3062c854771ba4dff173e169cc46736f3a47888ee4

See more details on using hashes here.

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