Socket
Book a DemoInstallSign in
Socket

open-pinball-db

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

open-pinball-db

An open pinball database client for Python

0.1.0
pipPyPI
Maintainers
1

Python Open Pinball Database Client

This is a Python client for the Open Pinball Database API.

Installation

pip install open-pinball-db
import open_pinball_db
opdb_client = open_pinball_db.Client()

# Start using the client

Usage

Public API (no authentication required)

Get changelog

import open_pinball_db
opdb_client = open_pinball_db.Client()
opdb_client.get_changelog()
ParameterTypeDescription
qstrThe search query
include_aliasesboolWhether to include aliases in the search. Default is True
include_groupsboolWhether to include groups in the search. Default is False
import open_pinball_db
opdb_client = open_pinball_db.Client()
opdb_client.typeahead_search('The Addams Family')

Private API (authentication required)

Get your free api key at Open Pinball Database.

Search Machines

ParameterTypeDescription
qstrThe search query
require_opdbboolLimit results to machines with OPDB ids. Defaults to True
include_aliasesboolWhether to include aliases in the search. Default is True
include_groupsboolWhether to include groups in the search. Default is False
include_grouping_entriesboolWhether to include grouping entries in the search. Default is False
import open_pinball_db
opdb_client = open_pinball_db.Client(api_key="your_secret_api_key")
opdb_client.search('The Addams Family')

Get Machine By OPDB ID

ParameterTypeDescription
opdb_idstrThe IPDB ID of the machine
import open_pinball_db
opdb_client = open_pinball_db.Client(api_key="your_secret_api_key")
opdb_client.get_machine("OPDB-ID")

Get Machine By IPDB ID

ParameterTypeDescription
ipdb_idintThe IPDB ID of the machine
import open_pinball_db
opdb_client = open_pinball_db.Client(api_key="your_secret_api_key")
opdb_client.get_machine_by_ipdb_id(1234)

Export Machines and Aliases

Export all machines and aliases into a big json document. According to the OPDB API docs this endpoint is rate limited to once every hour.

import open_pinball_db
opdb_client = open_pinball_db.Client(api_key="your_secret_api_key")
opdb_client.export_machines_and_aliases()

Export Machines Groups

Export all machine groups as a single JSON document.

import open_pinball_db
opdb_client = open_pinball_db.Client(api_key="your_secret_api_key")
opdb_client.export_machine_groups()

Handling Exceptions

The client can raise the following exceptions:

ExceptionDescription
OpdbErrorBase exception class for all exceptions
OpdbMissingApiKeyRaised when trying to access private parts of the OPDB API without an API key
OpdbHttpErrorRaised upon http errors. Contains status code and message.
OpdbTimeoutErrorRaised upon timeout errors.

Keywords

pinball

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.