Skip to main content

A python wrapper of MacAdmins SOFA (sofa.macadmins.io)

Project description

sofapy

A Python client library for the MacAdmins SOFA (Simple Organized Feed for Apple) API.

Query Apple macOS software update information, security releases, and CVE data with both synchronous and asynchronous clients.

Installation

Using uv (recommended):

uv add sofapy

Using pip:

pip install sofapy

Quick Start

Synchronous Client

from sofapy import SofaClient

client = SofaClient()

# Get the full SOFA feed
feed = client.get_feed()
print(f"Feed updated: {feed.update_hash}")

# Get CVEs affecting a specific macOS version
cves = client.get_cves("15.1.0")
print(f"Total CVEs: {cves.total_count}")
print(f"Actively exploited: {cves.exploited_count}")

# Only get actively exploited CVEs
exploited = client.get_cves("15.1.0", exploited_only=True)
for cve in exploited.actively_exploited_cves:
    print(f"  ⚠️  {cve}")

# Check how current a version is
currency = client.get_currency_info("15.0.0")
print(f"Score: {currency.currency_score}/100")
print(f"Recommendation: {currency.recommendation}")

# Get latest versions for all OS families
latest = client.get_latest()
for name, info in latest.items():
    print(f"{name}: {info.latest_version}")

# Filter to specific OS family
sequoia = client.get_latest(os_filter="Sequoia")

Asynchronous Client

import asyncio
from sofapy import AsyncSofaClient

async def main():
    client = AsyncSofaClient()

    # Same API, just await the calls
    feed = await client.get_feed()
    cves = await client.get_cves("15.1.0", exploited_only=True)
    currency = await client.get_currency_info("15.0.0")
    latest = await client.get_latest()

    print(f"Latest Sequoia: {latest.get('Sequoia 15').latest_version}")

asyncio.run(main())

Raw JSON Access

from sofapy import SofaClient

client = SofaClient()

# Get raw JSON dict instead of parsed models
raw_feed = client.get_feed(raw=True)
print(raw_feed["UpdateHash"])

Command Line Interface

sofapy includes a CLI for quick queries:

# Show latest versions for all macOS releases
sofapy latest

# Filter to specific OS family
sofapy latest --os Sequoia

# Output as JSON
sofapy latest --json

# Get CVEs affecting a version
sofapy cves 15.1.0

# Only show actively exploited CVEs
sofapy cves 15.1.0 --exploited-only

# Check version currency
sofapy currency 15.0.0

# Get the full feed (parsed)
sofapy feed

# Get raw JSON feed
sofapy feed --raw

# Enable debug logging
sofapy --debug latest

# Show help
sofapy --help

Models

sofapy returns strongly-typed Pydantic models:

Model Description
SOFAFeed Complete feed with all OS versions
OSVersionInfo Info for a specific OS family
SecurityRelease Individual security release details
CVEResult Result from get_cves()
CurrencyInfo Result from get_currency_info()
LatestInfo Result from get_latest()

Helpful Properties

# CVEResult
cves.has_exploited_cves  # bool - any actively exploited?
cves.is_vulnerable       # bool - any CVEs at all?

# CurrencyInfo
currency.needs_update    # bool - not on latest?
currency.is_critical     # bool - 3+ security updates missed?

# LatestInfo
latest.has_exploited_cves  # bool - any actively exploited?

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub.

To contribute code:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: uv run pytest
  5. Submit a pull request

Acknowledgments

This library is a wrapper for the excellent SOFA project by MacAdmins.

SOFA provides comprehensive, up-to-date information about macOS security releases and CVEs. All data served by sofapy comes from the official SOFA feed.

License

Apache 2.0 License - see LICENSE for details.

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

sofapy-0.1.0.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

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

sofapy-0.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file sofapy-0.1.0.tar.gz.

File metadata

  • Download URL: sofapy-0.1.0.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sofapy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 529d702681bcc6239068f7585ce87a54b5d12bc8ff1237c5573504f84a058084
MD5 565543464fd472971bf056278a78b71a
BLAKE2b-256 ab64779dc98edfcebec27edd9163336364c20e3616462aeb90855c00c89aab2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sofapy-0.1.0.tar.gz:

Publisher: build-release.yml on liquidz00/sofapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sofapy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sofapy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sofapy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 236555884017afd62a2b74a1dbb1709e910446873d3c7423f14e4c941f1af7bf
MD5 ffb39cb8dc2c5130ed1595e15dad9e81
BLAKE2b-256 745b6c3ab7bf310a3892758deb37867713756d54fe66a6bd4c85d467435f09ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for sofapy-0.1.0-py3-none-any.whl:

Publisher: build-release.yml on liquidz00/sofapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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