Package: radio-code-calculator
Radio Code Calculator Online & SDK for PythonRadio Code Calculatoris an online service along withWeb API & SDKfor generating car radio unlock codes for popular vehicle brands.Following a breakdown or a disconnection of the car battery, most of the vehicle radio & navigation units will ask for an unlocking code. It's standard anti-theft protection.Our car Radio Code Calculator allows you to generate100% validradio codes to unlock car radios & navigation without the need to use the expensive service of authorized dealers.The service is available through a simple online interface andWeb API, with multipleSDKdevelopment libraries for popular programming languages.Thanks to our solution, you can create, for instance, mobile or web applications that allow for easy generation of radio codes.Supported car models and radiosOur service is being continuously developed and new algorithms are gradually added for new car models and their radios.If a new algorithm is added, you will get automatic and free access to it as part of your current license.Individual calculators are available on our site as a paid service for end customers. You can verify them and see lists of supported radios on the relevant subpages:Renault & DaciaToyota ERCJeep CherokeeFord M SerialFord V SerialFord TravelPilot EX, FX & NXChrysler Panasonic TM9Fiat Stilo & Bravo VisteonFiat DAIICHI MOPARNissan Glove Box Immobiliser PINEclipse ESN Unlock Code CalculatorJaguar AlpineUse of radio code calculatorWhere and who can use the radio code generation service and make money from code generation?App developersThe main audience for our software is clearly developers and programmers, either of mobile or desktop applications.Online storesIf you run an online e-commerce store, you can sell radio codes through it using our software solutions.Auto repair shopsWe also encourage car repair shops whose customers often use car radio unlocking services.Private individualsPrivate individuals will also profit from our solution by generating codes and selling them on car forums or auction sites such as eBay, Craigslist.No limits!You can generate codeswithout limitationwith your purchased one year license.Set your own price for generating a single code and start earning by usingtried and testedalgorithms from a programming language you know.If you are not a programmer - don't worry. Just use ouronline calculator.InstallationThe preferred way of Radio Code Calculator Web API interface installation is viapip.Run:pip install radio-code-calculatororpython3 -m pip install radio-code-calculatorAnd then add this import to your source code:fromradio_code_calculatorimport*The installation package is available athttps://pypi.org/project/radio-code-calculator/Packages for other programming languagesThe installation packages have been uploaded to repositories for several popular programming languages and their source codes have been published on GitHub:RepositoryLanguageInstallationPackageGitHubPHPAdd the following line torequiresection of yourcomposer.jsonfile"pelock/radio-code-calculator": "*"PackagistSourcesPythonRunpip install radio-code-calculatorPyPiSourcesJavaScript, TypeScriptRunnpm i radio-code-calculatoror add the following todependenciessection of yourpackage.jsonfile"dependencies": { "radio-code-calculator": "latest" },NPMSourcesUsage examplesRadio code generationThis example demonstrates code generation for a selected radio model. All input parameter validation is done on the server side and if the radio serial number has an invalid length or pattern - the service will return an error.#!/usr/bin/env python################################################################################# Radio Code Calculator API - WebApi interface usage example## In this example, we will demonstrate how to generate a code for a specific# type of car radio.## Version        : v1.1.4# Language       : Python# Author         : Bartosz Wójcik# Project        : https://www.pelock.com/products/radio-code-calculator# Homepage       : https://www.pelock.com################################################################################## include Radio Code Calculator API module#fromradio_code_calculatorimport*## create Radio Code Calculator API class instance (we are using our activation key)#myRadioCodeCalculator=RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD")## generate radio code (using Web API)#error,result=myRadioCodeCalculator.calc(RadioModels.FORD_M_SERIES,"123456")iferror==RadioErrors.SUCCESS:print(f'Radio code is{result["code"]}')eliferror==RadioErrors.INVALID_RADIO_MODEL:print("Invalid radio model (not supported)")eliferror==RadioErrors.INVALID_SERIAL_LENGTH:print(f'Invalid serial number length (expected{result["serialMaxLen"]}characters)')eliferror==RadioErrors.INVALID_SERIAL_PATTERN:print(f'Invalid serial number regular expression pattern (expected{result["serialRegexPattern"]["python"]}regex pattern)')eliferror==RadioErrors.INVALID_SERIAL_NOT_SUPPORTED:print("This serial number is not supported")eliferror==RadioErrors.INVALID_EXTRA_LENGTH:print(f'Invalid extra data length (expected{result["extraMaxLen"]}characters)')eliferror==RadioErrors.INVALID_EXTRA_PATTERN:print(f'Invalid extra data regular expression pattern (expected{result["extraRegexPattern"]["python"]}regex pattern)')eliferror==RadioErrors.INVALID_INPUT:print("Invalid input data")eliferror==RadioErrors.INVALID_COMMAND:print("Invalid command sent to the Web API interface")eliferror==RadioErrors.INVALID_LICENSE:print("Invalid license key")eliferror==RadioErrors.ERROR_CONNECTION:print("Something unexpected happen while trying to login to the service.")else:print(f'Unknown error{error}')Radio code generation with additional offline validationRadio codes are generated based on input parameters such as theradio's serial number, among others.Radio serial numbers are different for different radios, they have different lengths and different patterns, some may consist of just digits e.g.1234, while others may consist of digits and letters e.g.AB1234XYZ.Validation of this data is done on the server side. However, to make things more efficient, we can use the information about available limits and patterns of particular serial numbers to, for example, set these limits in controls in our own applications without unnecessary calls to theWeb API.#!/usr/bin/env python################################################################################# Radio Code Calculator API - WebApi interface usage example## In this example, we will demonstrate how to generate a code for a specific# type of car radio. This example shows how to use an extended offline# validation.## Version        : v1.1.4# Language       : Python# Author         : Bartosz Wójcik# Project        : https://www.pelock.com/products/radio-code-calculator# Homepage       : https://www.pelock.com################################################################################## include Radio Code Calculator API module#fromradio_code_calculatorimport*## create Radio Code Calculator API class instance (we are using our activation key)#myRadioCodeCalculator=RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD")## generate a single radio unlocking code#serial:str="123456"extra:str=""## select a radio model#radioModel:RadioModel=RadioModels.FORD_M_SERIES## display radio model information, you can use it to set limits in your controls e.g.## textFieldRadioSerial.maxLength = radioModel.serial_max_len# textFieldRadioSerial.regEx = radioModel.serial_regex_pattern## (if allowed by your controls)#print(f'Radio model{radioModel.name}expects a serial number of{radioModel.serial_max_len}'f' length and{radioModel.serial_regex_pattern}regex pattern')# additional informationifradioModel.extra_max_len>0:print(f'Additionally an extra field is required with{radioModel.extra_max_len}and'f' and{radioModel.extra_regex_pattern}regex pattern')## validate the serial number (offline) before sending the Web API request#error=radioModel.validate(serial,extra)iferror!=RadioErrors.SUCCESS:iferror==RadioErrors.INVALID_SERIAL_LENGTH:print(f'Invalid serial number length (expected{radioModel.serial_max_len}characters)')eliferror==RadioErrors.INVALID_SERIAL_PATTERN:print(f'Invalid serial number regular expression pattern (expected{radioModel.serial_regex_pattern}regex pattern)')eliferror==RadioErrors.INVALID_SERIAL_NOT_SUPPORTED:print("This serial number is not supported")eliferror==RadioErrors.INVALID_EXTRA_LENGTH:print(f'Invalid extra data length (expected{radioModel.extra_max_len}characters)')eliferror==RadioErrors.INVALID_EXTRA_PATTERN:print(f'Invalid extra data regular expression pattern (expected{radioModel.extra_regex_pattern}regex pattern)')exit(1)## generate radio code (using Web API)#error,result=myRadioCodeCalculator.calc(radioModel,"123456")iferror==RadioErrors.SUCCESS:print(f'Radio code is{result["code"]}')eliferror==RadioErrors.INVALID_RADIO_MODEL:print("Invalid radio model (not supported)")eliferror==RadioErrors.INVALID_SERIAL_LENGTH:print(f'Invalid serial number length (expected{result["serialMaxLen"]}characters)')eliferror==RadioErrors.INVALID_SERIAL_PATTERN:print(f'Invalid serial number regular expression pattern (expected{result["serialRegexPattern"]["python"]}regex pattern)')eliferror==RadioErrors.INVALID_SERIAL_NOT_SUPPORTED:print("This serial number is not supported")eliferror==RadioErrors.INVALID_EXTRA_LENGTH:print(f'Invalid extra data length (expected{result["extraMaxLen"]}characters)')eliferror==RadioErrors.INVALID_EXTRA_PATTERN:print(f'Invalid extra data regular expression pattern (expected{result["extraRegexPattern"]["python"]}regex pattern)')eliferror==RadioErrors.INVALID_INPUT:print("Invalid input data")eliferror==RadioErrors.INVALID_COMMAND:print("Invalid command sent to the Web API interface")eliferror==RadioErrors.INVALID_LICENSE:print("Invalid license key")eliferror==RadioErrors.ERROR_CONNECTION:print("Something unexpected happen while trying to login to the service.")else:print(f'Unknown error{error}')Download list of supported radio code calculatorsIf you would like to download information about all supported radio models and their parameters such as serial number length and pattern - you can do so.#!/usr/bin/env python################################################################################# Radio Code Calculator API - WebApi interface usage example## In this example we will list all the available calculators and, their# parameters like name, maximum length of the radio serial number and its# regex pattern.## Version        : v1.1.4# Language       : Python# Author         : Bartosz Wójcik# Project        : https://www.pelock.com/products/radio-code-calculator# Homepage       : https://www.pelock.com################################################################################## include Radio Code Calculator API module#fromradio_code_calculatorimport*## create Radio Code Calculator API class instance (we are using our activation key)#myRadioCodeCalculator=RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD")## get the list of the supported radio calculators and their parameters (max. length, regex pattern)#error,radio_models=myRadioCodeCalculator.list()iferror==RadioErrors.SUCCESS:print(f'Supported radio models{len(radio_models)}:\n')forradio_modelinradio_models:print(f'Radio model name -{radio_model.name}')print(f'Max. length of the radio serial number -{radio_model.serial_max_len}')print(f'Regex pattern for the radio serial number -{radio_model.serial_regex_pattern}')# is extra field specified?ifradio_model.extra_max_len>0:print(f'Max. length of the radio extra data -{radio_model.extra_max_len}')print(f'Regex pattern for the radio extra data -{radio_model.extra_regex_pattern}')print()eliferror==RadioErrors.INVALID_LICENSE:print("Invalid activation key!")else:print(f'Something unexpected happen while trying to login to the service (error code{error}).')Downloading the parameters of the selected radio calculatorYou can download the parameters of the selected calculator.#!/usr/bin/env python################################################################################# Radio Code Calculator API - WebApi interface usage example## In this example, we will demonstrate how to get information about the# specific radio calculator and its parameters (max. length & regex pattern).## Version        : v1.1.4# Language       : Python# Author         : Bartosz Wójcik# Project        : https://www.pelock.com/products/radio-code-calculator# Homepage       : https://www.pelock.com################################################################################## include Radio Code Calculator API module#fromradio_code_calculatorimport*## create Radio Code Calculator API class instance (we are using our activation key)#myRadioCodeCalculator=RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD")## query information about the radio model#error,radioModel=myRadioCodeCalculator.info("ford-m-series")iferror==RadioErrors.SUCCESS:print(f'Radio model name -{radioModel.name}')print(f'Max. length of the radio serial number -{radioModel.serial_max_len}')print(f'Regex pattern for the radio serial number -{radioModel.serial_regex_pattern}')# is extra field specified?ifradioModel.extra_max_len>0:print(f'Max. length of the radio extra data -{radioModel.extra_max_len}')print(f'Regex pattern for the radio extra data -{radioModel.extra_regex_pattern}')print()eliferror==RadioErrors.INVALID_LICENSE:print("Invalid license key!")else:print(f'Something unexpected happen while trying to login to the service (error code{error}).')Checking activation keyBy checking the activation key status, we will get information about the license owner, license type and license expiration date.#!/usr/bin/env python################################################################################# Radio Code Calculator API - WebApi interface usage example## In this example we will verify our activation key status.## Version        : v1.1.4# Language       : Python# Author         : Bartosz Wójcik# Project        : https://www.pelock.com/products/radio-code-calculator# Homepage       : https://www.pelock.com################################################################################## include Radio Code Calculator API module#fromradio_code_calculatorimport*## create Radio Code Calculator API class instance (we are using our activation key)#myRadioCodeCalculator=RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD")## login to the service#error,result=myRadioCodeCalculator.login()## result[] array holds the information about the license## result["license"]["activationStatus"] - True if license is active, False on invalid/expired keys# result["license"]["userName"] - user name/company name of the license owner# result["license"]["type"] - license type (0 - Personal License, 1 - Company License)# result["license"]["expirationDate"] - license expiration date (in YYYY-MM-DD format)#iferror==RadioErrors.SUCCESS:print(f'License activation status -{"True"ifresult["license"]["activationStatus"]else"False"}')print(f'License owner -{result["license"]["userName"]}')print(f'License type -{"Personal"ifresult["license"]["type"]==0else"Company"}')print(f'Expiration date -{result["license"]["expirationDate"]}')eliferror==RadioErrors.INVALID_LICENSE:print("Invalid license key!")else:print(f'Something unexpected happen while trying to login to the service (error code{error}).')Got questions?If you are interested in the Radio Code Calculator Web API or have any questions regarding radio code generator SDK packages, technical or legal issues, or if something is not clear,please contact me. I'll be happy to answer all of your questions.Bartosz WójcikVisit my site at —https://www.pelock.comTwitter —https://twitter.com/PELockGitHub —https://github.com/PELock