Skip to main content

A complete library for interacting with nestcode.org

Project description

📦 WixyPy – Python SDK for Nest API

License PyPI Python

WixyPy is a lightweight and modern Python SDK for communicating with the Nest API. It supports both sync and async usage automatically, offers versioned endpoints, and features error-safe JSON decoding with an elegant interface.


🚀 Features

  • 🔁 Auto sync/async mode detection
  • 🔑 Easy API key setup
  • 🔧 Versioned endpoint routing
  • ⚠️ Built-in error handling
  • ⚡ Powered by httpx
  • 🧪 Typed and clean design (Python 3.7+)

📦 Installation

pip install wixy

Requires Python 3.7 or higher


🛠 Usage

🔸 Synchronous Example

from wixy import Api

api = Api("your_api_key_here")

response = api.version(1).get("endpoint-name", {
    "param1": "value1",
    "param2": "value2"
})

print(response)

🔹 Asynchronous Example

import asyncio
from wixy import Api

async def main():
    api = Api("your_api_key_here")
    response = await api.version(1).get("endpoint-name", {
        "param1": "value1",
        "param2": "value2"
    })
    print(response)

asyncio.run(main())

📘 Example

api = Api("your_api_key")
response = api.version(1).get("ChatGPT", {"q": "Hello"})

if response["status_code"] == 200:
    print("Result:", response["body"].get("detail", {}).get("data", "No result"))
else:
    print("Error:", response.get("error", "Unknown error"))

📥 Response Format

✅ On success:

{
    "status_code": 200,
    "body": { ...parsed JSON... }
}

❌ On failure:

If the error response is JSON:

{
    "status_code": 400,
    "body": { ...error details... },
    "error": "Httpx exception message"
}

If the error is plain text:

{
    "status_code": 500,
    "body": "Server Error",
    "error": "Httpx exception message"
}

📚 API Versioning

To target a specific API version:

api.version(1).get("endpoint")
api.version(2).get("another-endpoint")

Internally, the version changes the request path to:

https://open.nestcode.org/apis-{version}/{endpoint}

✅ Requirements

  • Python 3.7
  • httpx 0.27

📄 License

This project is open-sourced under the MIT license.


🔗 Links

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

wixy-1.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

wixy-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file wixy-1.0.0.tar.gz.

File metadata

  • Download URL: wixy-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for wixy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 895c98703b298a94a77d1e2f6675f6ec99913ec4e438b07ff06db2073ec1184b
MD5 bc0ea36df95ea183d9d1d28ba3a833f1
BLAKE2b-256 9d10c41fc31fd06bd359a3be637598e86e82dc23f82d978cb95f5e3a68770628

See more details on using hashes here.

File details

Details for the file wixy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: wixy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for wixy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09343928a34abc3da5e883c46b261d7634114e22402c049e63713d17501f0bba
MD5 ebba197f6c97a761f5ed3d43726336d3
BLAKE2b-256 be734a5510a9fa0c6cc09b15b0521521ae5a53618c9503d59ecf1eb6b84cdc19

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