Skip to main content

publish Downloads

Python Spiget API Wrapper

A modern Python wrapper for the Spiget API, providing easy access to Spigot resources, authors, and categories.

Installation

pip install pyspiget

Quick Start

from spiget import Spiget

# Initialize the client
api = Spiget(user_agent="MyApp/1.0.0")

# Get a resource
resource = api.get_resource(1234)
print(f"Resource name: {resource.name}")

# Search for resources
resources = api.search_resources("worldedit")
for resource in resources:
    print(f"Found: {resource.name}")

API Reference

Main Classes

Spiget

The main class for interacting with the Spiget API.

api = Spiget(user_agent="MyApp/1.0.0")

WebhookHandler

Handles webhook-related operations for the Spiget API.

webhook_handler = WebhookHandler(api.session)

Data Models

All models inherit from BaseModel which provides basic dictionary to object conversion.

Resource

Represents a Spigot resource (plugin, mod, etc.)

Properties:

  • id: Resource ID
  • name: Resource name
  • tag: Resource tag
  • contributors: List of contributors
  • likes: Number of likes
  • file: ResourceFile object
  • tested_versions: List of tested Minecraft versions
  • links: Dictionary of related links
  • rating: ResourceRating object
  • release_date: Release datetime
  • update_date: Last update datetime
  • downloads: Number of downloads
  • external: Whether the resource is external
  • icon: Icon object
  • premium: Whether the resource is premium
  • price: Resource price (if premium)
  • currency: Price currency
  • description: Resource description
  • documentation: Resource documentation
  • source_code_link: Link to source code
  • donation_link: Link to donation page

ResourceFile

Represents a resource's downloadable file.

Properties:

  • type: File type
  • size: File size
  • size_unit: Size unit
  • url: Download URL
  • external_url: External download URL

ResourceVersion

Represents a specific version of a resource.

Properties:

  • id: Version ID
  • uuid: Version UUID
  • name: Version name
  • release_date: Release datetime
  • downloads: Number of downloads
  • rating: ResourceRating object

ResourceUpdate

Represents an update post for a resource.

Properties:

  • id: Update ID
  • resource: Resource ID
  • title: Update title
  • description: Update description
  • date: Update datetime
  • likes: Number of likes

ResourceReview

Represents a review for a resource.

Properties:

  • author: Author object
  • rating: ResourceRating object
  • message: Review message
  • response_message: Author's response
  • version: Version reviewed
  • date: Review datetime

Author

Represents a resource author.

Properties:

  • id: Author ID
  • name: Author name
  • icon: Icon object

Category

Represents a resource category.

Properties:

  • id: Category ID
  • name: Category name

Methods

Resource Methods

# Get multiple resources
resources = api.get_resources(size=10, page=1, sort=None, fields=None)

# Get a single resource
resource = api.get_resource(resource_id=1234)

# Get resource versions
versions = api.get_resource_versions(resource_id=1234, size=10, page=1)

# Get specific version
version = api.get_resource_version(resource_id=1234, version_id="1.0.0")

# Get latest version
latest = api.get_resource_latest_version(resource_id=1234)

# Get resource updates
updates = api.get_resource_updates(resource_id=1234, size=10, page=1)

# Get resource reviews
reviews = api.get_resource_reviews(resource_id=1234, size=10, page=1)

# Get resource author
author = api.get_resource_author(resource_id=1234)

Author Methods

# Get multiple authors
authors = api.get_authors(size=10, page=1)

# Get single author
author = api.get_author(author_id=1234)

# Get author's resources
resources = api.get_author_resources(author_id=1234, size=10, page=1)

Category Methods

# Get all categories
categories = api.get_categories(size=10, page=1)

# Get single category
category = api.get_category(category_id=1234)

# Get category resources
resources = api.get_category_resources(category_id=1234, size=10, page=1)

Search Methods

# Search resources
resources = api.search_resources(query="worldedit", field=None, size=10, page=1)

# Search authors
authors = api.search_authors(query="sk89q", field=None, size=10, page=1)

Webhook Methods

# Get available webhook events
events = webhook_handler.get_webhook_events()

# Register a webhook
webhook = webhook_handler.register_webhook(
    url="https://example.com/webhook",
    events=["resource-update", "new-resource"]
)

# Get webhook status
status = webhook_handler.get_webhook_status(webhook_id="abc123")

# Delete webhook
webhook_handler.delete_webhook(webhook_id="abc123", secret="webhook_secret")

Error Handling

The wrapper includes a custom SpigetError exception that is raised when API requests fail:

from spiget import Spiget, SpigetError

api = Spiget()

try:
    resource = api.get_resource(99999999)
except SpigetError as e:
    print(f"API error: {e}")

Credits

This wrapper is built for the Spiget API created by the SpiGetOrg team.

License

MIT License - see LICENSE file for details

Metadata

Release files for pyspiget 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyspiget 1.0.0
File Size Uploaded Provenance Actions
pyspiget-1.0.0.tar.gz 12.0 kB With provenance Details for pyspiget-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyspiget 1.0.0
File Interpreter ABI Platform Actions
pyspiget-1.0.0-py3-none-any.whl Python 3 none any Details for pyspiget-1.0.0-py3-none-any.whl

Total release size: 18.9 kB

Release files / pyspiget-1.0.0.tar.gz

Download URL pyspiget-1.0.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
333f6543e7060da247305d3ec124dc9205e97bcfde5420e4a08b8eaa33cb44fc
BLAKE2b-256 checksum
How to use checksums
fe97c38c67b96176067eefc96776199625999a3ae09142a014b2ee70ac8747c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2024.

Transparency log

Release files / pyspiget-1.0.0-py3-none-any.whl

Download URL pyspiget-1.0.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
431cd40de212dd038ad0f62f73c1a860ba56f473f9c052697e45a130a6fc9ae5
BLAKE2b-256 checksum
How to use checksums
d0cb65fc48b8e69a13bfef93ca18608321b3adbe6d4ebb05d56b71c47e70dcec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2024.

Transparency log

Security for pyspiget 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyspiget-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2024.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page