A Python client library for the ShopVirge API
Project description
shopvirge-client
A Python client library for the ShopVirge API, auto-generated from the OpenAPI specification using openapi-python-client.
Installation
pip install shopvirge-client
Quick Start
Unauthenticated requests
from shopvirge_client import Client
# Uses https://api.shopvirge.com by default
client = Client()
# Or point to a different environment
client = Client(base_url="https://staging-api.shopvirge.com")
Authentication
Most endpoints require authentication via an OAuth2 access token. First, obtain a token:
from shopvirge_client import Client, AuthenticatedClient
from shopvirge_client.api.login import login_access_token_login_access_token_post as login
from shopvirge_client.models import BodyLoginAccessTokenLoginAccessTokenPost
# Get an access token
client = Client()
credentials = BodyLoginAccessTokenLoginAccessTokenPost(
username="user@example.com",
password="your-password",
)
response = login.sync(client=client, body=credentials)
token = response["access_token"]
# Create an authenticated client
auth_client = AuthenticatedClient(token=token)
Making API calls
Every API endpoint has four functions:
sync()— make a synchronous request, return the parsed responsesync_detailed()— make a synchronous request, return aResponseobject with status code, headers, and parsed bodyasyncio()— async version ofsync()asyncio_detailed()— async version ofsync_detailed()
List shops
from shopvirge_client.api.shops import get_multi_shops_get
shops = get_multi_shops_get.sync(client=auth_client)
Get a specific shop
from shopvirge_client.api.shops import get_by_id_shops_id_get
shop = get_by_id_shops_id_get.sync(id="shop-uuid", client=auth_client)
Create an order
from shopvirge_client.api.orders import create_orders_post
from shopvirge_client.models import OrderCreate
order = OrderCreate(
shop_id="shop-uuid",
# ... other fields
)
result = create_orders_post.sync(client=auth_client, body=order)
List products for a shop
from shopvirge_client.api.shops import create_shops_shop_id_products_post
# Products, categories, tags, and attributes are all scoped under a shop
Async usage
import asyncio
from shopvirge_client import AuthenticatedClient
from shopvirge_client.api.shops import get_multi_shops_get
async def main():
async with AuthenticatedClient(token="your-token") as client:
shops = await get_multi_shops_get.asyncio(client=client)
print(shops)
asyncio.run(main())
Custom base URL
By default the client points to https://api.shopvirge.com. Override it for local development or staging:
from shopvirge_client import Client, AuthenticatedClient
# Local development
client = Client(base_url="http://localhost:8000")
# Staging
auth_client = AuthenticatedClient(
base_url="https://staging-api.shopvirge.com",
token="your-token",
)
Advanced configuration
import httpx
from shopvirge_client import Client
client = Client(
base_url="https://api.shopvirge.com",
timeout=httpx.Timeout(30.0),
follow_redirects=True,
headers={"X-Custom-Header": "value"},
cookies={"session": "abc123"},
raise_on_unexpected_status=True,
)
Available API modules
| Module | Description |
|---|---|
api.login |
Authentication (login, token test, password recovery) |
api.users |
User management |
api.shops |
Shop CRUD, configuration, products, categories, tags, attributes, prices |
api.orders |
Order management |
api.licenses |
License management |
api.downloads |
File downloads |
api.forms |
Form submissions |
api.faq |
FAQ management |
api.images |
Image uploads (signed URLs) |
api.stripe |
Stripe payment integration |
api.early_access |
Early access signups |
License
MIT
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
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 shopvirge_client-0.2.2.tar.gz.
File metadata
- Download URL: shopvirge_client-0.2.2.tar.gz
- Upload date:
- Size: 61.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e60af15ec469466d0ea380221d462370f8a4edc1032590bd70e7bacf1d6dc89
|
|
| MD5 |
58ea0d63d7f77e0d705b805c0d9ff329
|
|
| BLAKE2b-256 |
396e9a24c22904a9ea272b2dad4cc40389d9a7aeb5b1134d831575c46acc506f
|
Provenance
The following attestation bundles were made for shopvirge_client-0.2.2.tar.gz:
Publisher:
publish.yml on acidjunk/shopvirge-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shopvirge_client-0.2.2.tar.gz -
Subject digest:
7e60af15ec469466d0ea380221d462370f8a4edc1032590bd70e7bacf1d6dc89 - Sigstore transparency entry: 1110037665
- Sigstore integration time:
-
Permalink:
acidjunk/shopvirge-client@77bfc24f6a023b93686116cb57a16af6b4cd2147 -
Branch / Tag:
refs/tags/0.2.2 - Owner: https://github.com/acidjunk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@77bfc24f6a023b93686116cb57a16af6b4cd2147 -
Trigger Event:
release
-
Statement type:
File details
Details for the file shopvirge_client-0.2.2-py3-none-any.whl.
File metadata
- Download URL: shopvirge_client-0.2.2-py3-none-any.whl
- Upload date:
- Size: 259.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ebc9098afb9145e5289d809e52757433d9427c7d2bd7d0a4ad3d93082a53aef
|
|
| MD5 |
313037cb3fb77b5ac850298a1557d2c6
|
|
| BLAKE2b-256 |
432f56de9d6d7c37d31c46c22bed0a0edfb3e62e9612c2f562865ec36c2ba766
|
Provenance
The following attestation bundles were made for shopvirge_client-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on acidjunk/shopvirge-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shopvirge_client-0.2.2-py3-none-any.whl -
Subject digest:
4ebc9098afb9145e5289d809e52757433d9427c7d2bd7d0a4ad3d93082a53aef - Sigstore transparency entry: 1110037668
- Sigstore integration time:
-
Permalink:
acidjunk/shopvirge-client@77bfc24f6a023b93686116cb57a16af6b4cd2147 -
Branch / Tag:
refs/tags/0.2.2 - Owner: https://github.com/acidjunk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@77bfc24f6a023b93686116cb57a16af6b4cd2147 -
Trigger Event:
release
-
Statement type: