Metadata-Version: 2.4
Name: PTG_APIs
Version: 1.0.2
Summary: Official Python SDK for PTG APIs (Cognixx AI, PCB, Infinity AI, Weather, Time)
Home-page: https://github.com/paras-tech/ptg-apis
Author: Paras Tech Industries
Author-email: Parastechindustrieshelp@Gmail.com
License: MIT
Project-URL: Homepage, https://github.com/paras-tech/ptg-apis
Keywords: ptg,cognixx,ai,weather,cloud,api
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: requests>=2.28.0
Dynamic: author-email
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

PTG_APIs

Official Python Client SDK for PTG Services:

Cognixx AI (cognix_ai / CognixxAI) with automatic free model fallback (model="free" → COGNIX/COGNIX-coder)

Cognixx Cloud (CognixxCloud)

PCB (PCBClient - Paras Box Cloud)

Infinity AI (InfinityAI)

PTGWeather (100% Free real-time live weather without API keys)

PTGTime (Real-time network time & timezone sync)

📦 Installation

Install directly via pip:

pip install PTG_APIs


Or install locally in editable mode for development:

pip install -e .


🚀 Quickstart Examples

1. Direct Import of Cognixx AI

Access the default free endpoints, model credentials, and run inference immediately:

from PTG_APIs import cognix_ai

# Check free default credentials & endpoint
print("Free API Key :", cognix_ai.free_api)
print("Free Model   :", cognix_ai.free_model)
print("Free Endpoint:", cognix_ai.free_url)

# Run prompt (model="free" automatically routes to COGNIX/COGNIX-coder)
response = cognix_ai.generate("Write a quick Python script to calculate factorials", model="free")
print(response)


2. Live Weather & Time (No API Key Required)

from PTG_APIs import PTGWeather, PTGTime

# Real-time weather lookup
weather = PTGWeather.get_current("Haridwar")
print("Temperature:", weather.get("temp_c"), "°C")
print("Condition  :", weather.get("condition"))
print("Humidity   :", weather.get("humidity"))

# Real-time network time lookup
current_time = PTGTime.now("Asia/Kolkata")
print("Live Time:", current_time.get("datetime"))


3. Paras Box Cloud (PCB)

from PTG_APIs import PCBClient

pcb = PCBClient()

# Check free endpoint details
print("PCB Key     :", pcb.free_api)
print("PCB Endpoint:", pcb.free_url)

# List remote files
files = pcb.list_files(folder_path="/")
print(files)


4. Master Unified Client

Interact with all services through a single instance:

from PTG_APIs import PTG

ptg = PTG()

# Query weather
print(ptg.weather.get_current("Delhi"))

# Query time
print(ptg.time.now())

# Query Cognixx AI
reply = ptg.cognix_ai.generate("Explain quantum computing in two sentences", model="free")
print(reply)


🛠️ Publishing to PyPI

To build and publish this package:

# 1. Install build & upload tools
pip install --upgrade build twine

# 2. Build the wheel and source distribution
python -m build

# 3. Upload to PyPI
twine upload dist/*


📄 License

This project is licensed under the MIT License.
