Skip to main content

Python bindings for accessing OSIDB API

Project description

OSIDB Bindings

A Pythonic way to talk to OSIDB without getting lost in HTTP details.

Requirements

  • gcc
  • krb5-devel
  • pip
  • python3
  • python3-devel

Installation

Install the bindings using pip (recommended within a virtual environment):

pip install osidb-bindings

Quick Start

Basic Authentication

import osidb_bindings

# For local OSIDB instances with username/password authentication
session = osidb_bindings.new_session(
    osidb_server_uri="http://localhost:8000/",
    username="your_username",
    password="your_password"
)

Kerberos Authentication

# For production/staging instances with Kerberos authentication (default)
session = osidb_bindings.new_session(osidb_server_uri="https://your-osidb-instance.com/")

Basic Operations

# Check connection status
status = session.status()

# Retrieve a specific flaw
flaw = session.flaws.retrieve(id="CVE-1111-2222")

# Access flaw attributes
print(flaw.title)
print(flaw.impact)

# Convert to dictionary for easier manipulation
flaw_dict = flaw.to_dict()
print(flaw_dict["title"])
print(flaw_dict["impact"])

# Retrieve multiple flaws with filtering
critical_flaws = session.flaws.retrieve_list(impact="CRITICAL")
recent_flaws = session.flaws.retrieve_list(changed_after="2023-01-01")

# Access paginated results
print(f"Total flaws found: {critical_flaws.count}")
for flaw in critical_flaws.results:
    print(f"CVE: {flaw.cve_id}, Impact: {flaw.impact}")

API Version Control

# Use latest API version (default behavior)
flaw = session.flaws.retrieve(id="CVE-1111-2222")

# Specify a particular API version for stability
flaw = session.flaws.retrieve(id="CVE-1111-2222", api_version="v1")

# Discover available API versions
print(session.endpoints)

Documentation

Features

  • Automatic Authentication - Handles JWT token refresh automatically
  • Multiple API Versions - Support for v1, v2, and future API versions
  • Intuitive Interface - Pythonic API that mirrors OSIDB REST endpoints
  • Comprehensive Coverage - Access to flaws, affects, trackers, and more
  • Pagination Support - Built-in handling of paginated responses
  • Error Handling - Clear exceptions for better debugging

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

osidb_bindings-5.8.2.tar.gz (309.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osidb_bindings-5.8.2-py3-none-any.whl (762.1 kB view details)

Uploaded Python 3

File details

Details for the file osidb_bindings-5.8.2.tar.gz.

File metadata

  • Download URL: osidb_bindings-5.8.2.tar.gz
  • Upload date:
  • Size: 309.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for osidb_bindings-5.8.2.tar.gz
Algorithm Hash digest
SHA256 e72150f076ffae6ffd0d92fbf0abccc5bb7f4f0447ad89d808f06c89394fd5b1
MD5 d06d0abff8342c007ffd34424d5414ed
BLAKE2b-256 b644b85cb204d496735187022edb684cdb6da8441bd521fadc9c154f29eb0a0a

See more details on using hashes here.

File details

Details for the file osidb_bindings-5.8.2-py3-none-any.whl.

File metadata

  • Download URL: osidb_bindings-5.8.2-py3-none-any.whl
  • Upload date:
  • Size: 762.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for osidb_bindings-5.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b5dbaaf18c7d1307d13a1db7e9f834d516fb38199f35dd918988611df6e921f
MD5 01efa38f260f3ae1cd1a8ed0a116d8aa
BLAKE2b-256 9fc439d1bea3cd124f52211157888fbc566eddbfddc35507fea4f53fe56cc4df

See more details on using hashes here.

Supported by

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