View Source IDeviceDb
A database of Apple devices.
This package provides a simple API for querying a database of Apple devices.
The database is generated from The Apple Wiki
and is stored in the priv
directory of the application.
When the application is loaded, the database is read from the priv directory and stored in persistent terms. This means that the database is only read from disk once and is then available in memory for the lifetime of the application.
Examples
iex> IDeviceDb.find_by_model("MWHG2")
%{
finish: "Gold",
identifier: "iPhone12,5",
models: ["MWHG2"],
generation: "iPhone 11 Pro Max",
internal_name: "D431AP",
storage: "64 GB"
}
Generating the data
The priv/devices.json
file may be regenerated by running mix generate_db
.
Installation
If available in Hex, the package can be installed
by adding idevice_db
to your list of dependencies in mix.exs
:
def deps do
[
{:idevice_db, "~> 1.0.0"}
]
end