Skip to main content

A Python client library for TapNop market

Project description

tapnop

A Python client library for interacting with the backend API of the Game Sound Effects Trading Platform.

Installation

pip install tapnop

Configuration

Configure the API base URL before using the library (optional, has a default):

import tapnop

# Configure the backend API address
# Default: https://uu862979-8359-996463ae.westb.seetacloud.com:8443/api/market/sounds
# tapnop.configure("https://api.example.com/api/market/sounds")

Upload Sound Effects

Single File Upload

import tapnop

jwt_token = "your_jwt_token_here"

result = tapnop.upload(
    file_path="path/to/sound.wav",
    name="Explosion Sound",
    category="FX",
    jwt_token=jwt_token,
    price=100,
    tags=["explosion", "battle", "action"],
    description="A powerful explosion sound effect"
)

print("Upload succeeded:", result)

Batch Upload

import tapnop

jwt_token = "your_jwt_token_here"

# Define file list
files = [
    {"file_path": "sounds/explosion.wav", "name": "Explosion", "category": "FX"},
    {"file_path": "sounds/footstep.wav", "name": "Footstep", "category": "Ambient"},
]

# Batch upload with common metadata
results = tapnop.batch_upload(
    files_with_metadata=files,
    jwt_token=jwt_token,
    common_metadata={
        "price": 50,
        "tags": ["game", "sfx"],
        "description": "Game sound effect"
    }
)

for result in results:
    if result["status"] == "success":
        print(f"{result['file']}: Upload succeeded")
    else:
        print(f"{result['file']}: Upload failed - {result['error']}")

Error Handling

import tapnop
from tapnop import TapnopError, FileError, AuthenticationError, APIError

try:
    result = tapnop.upload(
        file_path="sound.wav",
        name="My Sound",
        category="FX",
        jwt_token="invalid_token"
    )
except FileError as e:
    print(f"File error: {e}")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except APIError as e:
    print(f"API error [{e.status_code}]: {e}")
except TapnopError as e:
    print(f"tapnop error: {e}")

Exception Types

Exception Description
TapnopError Base exception class
APIError API returns error status code or data
AuthenticationError JWT Token is invalid or expired
FileError Local file not found or inaccessible

License

MIT License

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

tapnop-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

tapnop-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tapnop-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for tapnop-0.1.0.tar.gz
Algorithm Hash digest
SHA256 64d2ad70641ef6b2775fe45339776734176b4caec93812e3914160b00f81ccfb
MD5 4d18f611007b573108f27a0133d8aee1
BLAKE2b-256 5b99311225f6de5fd7850ed811e32067f9b028b50b5410007b96b3e68e9341bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tapnop-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for tapnop-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5c9b44ca2330370db952c1c619744e2c4fd068fb1c8a77d06d33ede3fb9646d
MD5 af13ce9eb5ce990c1cf88b12bcd9bac6
BLAKE2b-256 500bc261259283927cd0b49039642f8343b306baf99ca8b24d0e0f7f802e2cf5

See more details on using hashes here.

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