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
- Complete Tutorial - Comprehensive guide with examples
- Developer Guide - Development and contribution guidelines
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
Release history Release notifications | RSS feed
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.9.0.tar.gz
(316.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osidb_bindings-5.9.0.tar.gz.
File metadata
- Download URL: osidb_bindings-5.9.0.tar.gz
- Upload date:
- Size: 316.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1591034bf72d369ccbdbcf23788df97d6790300c29b80c7084a210217e69b05
|
|
| MD5 |
d9fd85ddf6fed40c695c6920d26c51bc
|
|
| BLAKE2b-256 |
ea59892a8ab3811fadc5e2df329edb9bf8f2d2076e87cf2da6d43e65b64be26c
|
File details
Details for the file osidb_bindings-5.9.0-py3-none-any.whl.
File metadata
- Download URL: osidb_bindings-5.9.0-py3-none-any.whl
- Upload date:
- Size: 775.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ff9164a7a24f221e04f85019d9fad420e0e2a67a655092f843870fe6b5b720f
|
|
| MD5 |
b95f45f0212a21a14147eb0e8b43e2ef
|
|
| BLAKE2b-256 |
17ed5bef928774c9ddf6d719bbef2153993c72904795794d14c9e01da73791d5
|