Skip to content

ALIILAPRO/yun-ir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

کلاینت پایتون برای Yun.ir

یک کلاینت پایتون برای API سرویس کوتاه‌کننده لینک Yun.ir


نصب

نصب با استفاده از pip:

pip install yun-ir

نحوه استفاده

from yun import Yun

login = Yun.Api('YOUR tOKEN')  # توکن API خود را وارد کنید
result = login.short('title', 'url')  # به جای 'title' و 'url' مقادیر دلخواه را وارد کنید

print(result)  # نتیجه را چاپ می‌کند

مستندات API

yun_ir.Yun(token: str)

ساخت یک نمونه از کلاینت Yun.ir

پارامترها:

  • token: توکن API شما در Yun.ir

yun_ir.Yun.short(title: str, url: str) -> dict

کوتاه‌کردن یک لینک با استفاده از API یون

پارامترها:

  • title: عنوان لینک
  • url: لینکی که می‌خواهید کوتاه شود

خروجی:

  • یک دیکشنری شامل لینک کوتاه‌شده یا پیام خطا (در صورت بروز خطا)

حتماً باید یک توکن معتبر از Yun.ir دریافت کرده باشید.


Yun.ir Python Client

A Python client for the Yun.ir URL shortener API.


Installation

Install with pip:

pip install yun-ir

Usage

from yun import Yun

login = Yun.Api('YOUR tOKEN')
result = login.short('title', 'url')

print(result)

API

yun_ir.Yun(token: str)

Create a new Yun.ir client instance.

Parameters:

  • token: Your Yun.ir API token

yun_ir.Yun.short(title: str, url: str) -> dict

Shorten a URL using Yun.ir API.

Parameters:

  • title: Title for the URL
  • url: URL to shorten

Returns:

  • A dictionary containing the shortened URL, or an error message if the request fails.

Make sure you have a valid API token from Yun.ir

About

A Python client for https://Yun.ir URL shortener API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages