Rest Client für ebay mit dem Fokus auf die Verwendung in einer Middleware
Find a file
2026-04-07 10:53:30 +02:00
.venv_codegen Refactor code structure for improved readability and maintainability 2026-04-07 09:10:53 +02:00
ebay_client Add CRUD operations for schedules and tasks in FeedClient; enhance tests for schedule and task management 2026-04-07 10:53:30 +02:00
examples Add structured workflow result models for video and document uploads; update client methods and examples 2026-04-07 10:36:41 +02:00
scripts Add media client and models for eBay media API; implement image and video handling methods 2026-04-07 10:12:50 +02:00
tests Add CRUD operations for schedules and tasks in FeedClient; enhance tests for schedule and task management 2026-04-07 10:53:30 +02:00
.gitignore Add tests for OAuth client and webhook notification handling 2026-04-07 08:40:50 +02:00
.tmp_notification_models.py Refactor API client scope handling to support multiple scope options across account, feed, fulfillment, and inventory clients; add tests for scope validation 2026-04-07 09:57:34 +02:00
commerce_media_v1_beta_oas3.yaml added media api yaml for future enhancement 2026-04-07 09:50:59 +02:00
commerce_notification_v1_oas3.yaml Add tests for OAuth client and webhook notification handling 2026-04-07 08:40:50 +02:00
pyproject.toml Refactor code structure for improved readability and maintainability 2026-04-07 09:10:53 +02:00
README.md Add structured workflow result models for video and document uploads; update client methods and examples 2026-04-07 10:36:41 +02:00
sell_account_v1_oas3.yaml Add tests for OAuth client and webhook notification handling 2026-04-07 08:40:50 +02:00
sell_feed_v1_oas3.yaml Add tests for OAuth client and webhook notification handling 2026-04-07 08:40:50 +02:00
sell_fulfillment_v1_oas3.yaml Add tests for OAuth client and webhook notification handling 2026-04-07 08:40:50 +02:00
sell_inventory_v1_oas3.yaml Add tests for OAuth client and webhook notification handling 2026-04-07 08:40:50 +02:00

eBay REST Client

This workspace contains a Python-first eBay REST client foundation with:

  • a shared OAuth 2.0 core
  • a shared HTTP transport layer
  • public API wrappers per eBay REST domain
  • an isolated Pydantic model generation script for each contract in this folder

Currently wired API domains include Notification, Inventory, Fulfillment, Account, Feed, and Media.

Media Helpers

The Media wrapper includes workflow helpers on top of the raw endpoints:

  • VideoWorkflowResult and DocumentWorkflowResult to return structured data from the higher-level workflows
  • extract_resource_id() to pull a media resource ID from a Location header
  • guess_media_content_type() to infer a content type from a file name when possible
  • wait_for_video() to poll until a video reaches LIVE or a terminal failure state
  • wait_for_document() to poll until a document reaches ACCEPTED or a terminal failure state
  • create_upload_and_wait_video() to stage, upload, and poll a video in one call
  • create_upload_and_wait_video_from_path() to do the same directly from a local file path
  • create_upload_and_wait_document() to stage, upload, and poll a document in one call
  • create_upload_and_wait_document_from_path() to do the same directly from a local file path
  • create_document_from_url_and_wait() to create a document from a URL and poll until it is accepted
  • create_image_from_path() and upload_document_from_path() for path-based local file uploads

A concrete workflow example is available in examples/media_workflows.py for:

  • uploading an image from a file
  • creating an image from a URL
  • staging, uploading, and polling a document
  • staging, uploading, and polling a video

Generate Low-Level Clients

The project uses a dedicated code generation environment because the main runtime is currently on Python 3.14 while the model generator still targets earlier Python versions.

Run the generator script from the project root:

& .\.venv\Scripts\python.exe .\scripts\generate_clients.py

To generate only one API package:

& .\.venv\Scripts\python.exe .\scripts\generate_clients.py --api notification

This regenerates Pydantic v2 models into ebay_client/generated/<api>/models.py.

Webhook Helpers

The Notification package also includes framework-agnostic webhook utilities for:

  • responding to eBay challenge requests
  • parsing and validating the X-EBAY-SIGNATURE header
  • verifying signed notification payloads against the cached public key
  • turning a verified notification body into a normalized WebhookEventEnvelope

A concrete FastAPI integration example is available in examples/fastapi_notification_webhook.py.