🏛️ AncientLinesOfTheWorld
تبدیل فارسی و انگلیسی به ۱۵ خط باستانی — بههمراه تصویر، ویدیو، PDF، هوش مصنوعی، ربات و سیستم پلاگین
Convert Persian & English text into 15 ancient writing systems — with image, video, PDF, AI, bots and a plugin system.
📚 مستندات کامل: ancientline.ir · 🐙 سورس: GitHub
⚡ نصب | Installation
pip install --upgrade ancientlinesoftheworld
بررسی نصب:
ancient version
🚀 شروع سریع | Quick Start
from ancient import AncientScripts
converter = AncientScripts()
print(converter.cuneiform("سلام")) # میخی | Cuneiform
print(converter.hieroglyph("خدا")) # هیروگلیف | Hieroglyph
print(converter.runic("hello")) # رونی | Runic
print(converter.avestan("hiسلام")) # اوستایی | Avestan
# لیست همهی خطوط موجود (اصلی + پلاگینها)
print(converter.get_supported_scripts())
🗂️ خطوط پشتیبانیشده | Supported Scripts
| # | متد | خط | Script | تمدن |
|---|---|---|---|---|
| 1 | cuneiform() |
میخی | Cuneiform | هخامنشی، بینالنهرین |
| 2 | pahlavi() |
پهلوی | Pahlavi | ایران ساسانی |
| 3 | manichaean() |
مانوی | Manichaean | آیین مانی |
| 4 | hieroglyph() |
هیروگلیف | Hieroglyph | مصر باستان |
| 5 | akkadian() |
اکدی | Akkadian | بینالنهرین |
| 6 | oracle_bone() |
استخوان پیشگویی | Oracle Bone | چین باستان |
| 7 | avestan() |
اوستایی | Avestan | زرتشتی |
| 8 | linear_b() |
خط B | Linear B | یونان باستان |
| 9 | kharosthi() |
خروشتی | Kharosthi | شمال هند |
| 10 | runic() |
رونی | Runic | وایکینگها |
| 11 | brahmi() |
براهمی | Brahmi | هند باستان |
| 12 | hebrew() |
عبری | Hebrew | عبری باستان |
| 13 | sanskrit() |
سانسکریت | Sanskrit | هند باستان |
| 14 | elamite() 🆕 |
عیلامی | Elamite | تمدن عیلام، ایران |
| 15 | phoenician() 🆕 |
فنیقی | Phoenician | مادر الفباها |
⚡ خطوطی مثل Linear B و Oracle Bone از دیکشنریهای بهینهشده برای تبدیل سریعتر و دقیقتر استفاده میکنند.
📚 فهرست کلاسها | All Classes
| کلاس | قابلیت | API Key |
|---|---|---|
AncientScripts |
تبدیل متن به ۱۵ خط باستانی | ❌ |
AncientTimeline |
نمایش زمان فعلی به خط باستانی | ❌ |
AncientImageGenerator |
تولید تصویر کتیبهای از متن | ❌ |
AncientAnimator |
انیمیشن نوشتن حرفبهحرف | ❌ |
PDFConverter 🆕 |
خروجی PDF از متن باستانی | ❌ |
AncientVideo 🆕 |
ساخت ویدیوی کتیبهای | ❌ |
BatchConverter |
تبدیل دستهجمعی فایلها | ❌ |
AncientHistory |
ذخیره و جستوجوی تاریخچه | ❌ |
Plugin |
ساخت خط باستانی سفارشی | ❌ |
AncientWeb |
وباپ محلی آفلاین | ❌ |
AncientDocs 🆕 |
سایت مستندات محلی | ❌ |
AncientBot |
ربات تلگرام / روبیکا / بله | 🔑 توکن ربات |
AncientScriptAI |
چت هوشمند به خط باستانی | ✅ |
AncientReverseAI |
ترجمهی معنایی خط باستانی → فارسی/انگلیسی | ✅ |
AnalyzePhoto |
تشخیص و ترجمهی خط از روی عکس | ✅ |
SpeechToAncient |
تبدیل گفتار به خط باستانی | ✅ |
AncientAIWeb |
وباپ هوشمند (تصویر + تحلیل عکس) | ✅ |
🔑 کلید API را میتوانی از لیارا یا هر سرویس سازگار بگیری.
📜 AncientScripts
کلاس هسته. متن را حرفبهحرف با دیکشنریهای نگاشت جداگانه (فارسی، انگلیسی، عدد، نماد) تبدیل میکند. کاراکتری که در دیکشنری نباشد بدون تغییر میماند.
from ancient import AncientScripts
c = AncientScripts()
text = "hi"
for script in c.get_supported_scripts():
print(f"{script:<14} → {getattr(c, script)(text)}")
نحوه کارکرد:
Input Text → [بررسی نوع هر کاراکتر] → [دیکشنری متناظر] → Output
├─ حرف فارسی → Persian Mapping
├─ حرف انگلیسی → English Mapping
├─ عدد → Number Mapping
└─ نماد → Symbol Mapping
⏳ AncientTimeline
نمایش زمان فعلی به خط باستانی.
| پارامتر | نوع | توضیح |
|---|---|---|
script |
str |
cuneiform, pahlavi, manichaean, hieroglyph, akkadian, oracle_bone, avestan |
ancient_format |
bool |
نمایش تاریخ به سبک باستانی |
from ancient import AncientTimeline
timeline = AncientTimeline(script="pahlavi", ancient_format=True)
print(timeline.as_text()) # دریافت بهصورت رشته
timeline.show() # چاپ روی کنسول
🖼️ AncientImageGenerator
متن را به خط باستانی تبدیل کرده و روی تصویر پسزمینهی کتیبهای مینویسد.
پارامتر generate_image() |
نوع | الزامی | توضیح |
|---|---|---|---|
text |
str |
✅ | متن ورودی |
output_filename |
str |
— | نام فایل خروجی (خودکار اگر خالی) |
rtl |
bool |
— | نوشتن راستبهچپ |
enhance_contrast |
bool |
— | تنظیم خودکار رنگ نسبت به پسزمینه |
text_color |
tuple |
— | رنگ RGB، مثلاً (255,215,0) |
from ancient import AncientImageGenerator
gen = AncientImageGenerator(script="cuneiform")
path = gen.generate_image("تمدن از اینجا آغاز شد")
print(f"📜 ذخیره شد: {path}")
gen.generate_image(
"شاهکار تاریخ",
output_filename="my_ancient_text.png",
text_color=(255, 215, 0), # طلایی
rtl=True,
enhance_contrast=True
)
gen.clear_font_cache() # پاک کردن کش فونت
رنگهای پرکاربرد: طلایی (255,215,0) · نقرهای (192,192,192) · ارغوانی (128,0,128) · نارنجی (255,165,0) · قرمز (255,0,0) · سفید (255,255,255)
🎬 AncientAnimator
نمایش انیمیشنی نوشتهشدن تدریجی متن. قابل استفاده در ترمینال، GUI و وب.
| پارامتر | نوع | توضیح |
|---|---|---|
text |
str |
متن ورودی |
script |
str |
خط باستانی مقصد |
delay |
float |
تأخیر بین هر کاراکتر (ثانیه) |
output_func |
callable |
callback اختیاری برای خروجی مرحلهای |
ترمینال:
from ancient import AncientAnimator
animator = AncientAnimator(delay=0.1)
animator.run(text="Hello World", script="pahlavi")
تحت وب با Flask + SSE:
from flask import Flask, Response
from ancient import AncientAnimator
import time
app = Flask(__name__)
anim = AncientAnimator(delay=0.1)
def generate():
converted = anim.convert("سلام به وب", "cuneiform")
full = ""
for ch in converted:
full += ch
yield f"data: {full}\n\n"
time.sleep(0.1)
@app.route("/stream")
def stream():
return Response(generate(), mimetype="text/event-stream")
app.run()
رابط گرافیکی با Tkinter:
import tkinter as tk
from ancient import AncientAnimator
def update_label(text):
label.config(text=text)
root.update()
root = tk.Tk()
root.geometry("500x300")
label = tk.Label(root, text="", font=("Courier", 20), wraplength=450)
label.pack(pady=50)
def start():
AncientAnimator(delay=0.1).run("hello", "cuneiform", output_func=update_label)
tk.Button(root, text="شروع", command=start).pack()
root.mainloop()
📄 PDFConverter 🆕
تبدیل متن به تصویر کتیبهای و ذخیره در PDF.
| متد | توضیح |
|---|---|
pdf_image(text, output_file, text_color, rtl) |
تبدیل یک متن به PDF |
pdf_batch(texts, output_dir, mode) |
تبدیل دستهجمعی چند متن |
from ancient import PDFConverter
pdf = PDFConverter(script="cuneiform")
pdf.pdf_image("سلام ایران", output_file="salam.pdf")
pdf.pdf_image(
text="تمدن ایران باستان",
output_file="iran.pdf",
text_color=(255, 215, 0),
rtl=True
)
pdf.pdf_batch(["سلام", "ایران", "داریوش"], output_dir="pdfs")
🎞️ AncientVideo 🆕
ساخت ویدیوی کتیبهای با نوشتهشدن حرفبهحرف متن.
| پارامتر | نوع | پیشفرض | توضیح |
|---|---|---|---|
script |
str |
"cuneiform" |
خط باستانی هدف |
font_path |
str |
None |
مسیر فونت (خودکار پیدا میشود) |
from ancient import AncientVideo
video = AncientVideo(script="cuneiform")
video.create(
text="داریوش بزرگ هخامنشی",
output="darius.mp4",
duration=8,
fps=15,
font_size=80
)
video.create_batch(
texts=["سلام", "ایران", "داریوش بزرگ", "پارس"],
output_dir="my_videos",
duration=5,
fps=10,
font_size=70
)
⏱️ ساخت ویدیو عملیات سنگینی است. در سرویسهای وب آن را پشت یک صف کار (Job Queue) قرار بده تا درخواست HTTP قفل نشود.
📂 BatchConverter
تبدیل خودکار فایلهای متنی — یک فایل یا کل یک پوشه.
from ancient import convert_file, batch_convert, BatchConverter
# یک فایل
print(convert_file("my_text.txt", script="cuneiform"))
# کل پوشه
batch_convert(script="cuneiform", input_dir="texts/", output_dir="ancient/")
# با کلاس
batch = BatchConverter(script="cuneiform", input_dir="my_texts", output_dir="my_ancient")
batch.run()
batch.convert_file("test.txt")
🗃️ AncientHistory
ذخیرهی خودکار تاریخچهی تبدیلها با پشتیبانی JSON و SQLite.
| پارامتر | نوع | پیشفرض | توضیح |
|---|---|---|---|
enabled |
bool |
True |
فعال/غیرفعال کردن ذخیرهسازی |
db_type |
str |
"json" |
"json" یا "sqlite" |
db_path |
str |
"ancient_history" |
مسیر فایل ذخیرهسازی |
max_entries |
int |
1000 |
حداکثر تعداد رکورد |
from ancient import AncientScripts, AncientHistory
history = AncientHistory(enabled=True, db_type="json", db_path="my_history.json")
converter = AncientScripts(history=history)
converter.pahlavi("ایران")
# آخرین تبدیلها
for item in history.get_last(5):
print(f"{item['timestamp']['fa']}: {item['input']} → {item['output']}")
# جستوجو
for item in history.search("ایران"):
print(f"{item['script']}: {item['input']} → {item['output']}")
history.set_enabled(False) # خاموش کردن موقت
history.clear() # پاک کردن کل تاریخچه
🧩 Plugin
بدون تغییر در کد اصلی، خط باستانی دلخواه خودت را بساز.
| پارامتر | نوع | الزامی | توضیح |
|---|---|---|---|
mapping |
Dict[str, str] |
✅ | دیکشنری نگاشت حروف |
script_name |
str |
✅ | نام خط (با همین نام صدا زده میشود) |
description |
str |
— | توضیح خط |
author |
str |
— | نام سازنده |
from ancient import Plugin, AncientScripts
mapping = {
"ا": "𒀀", "ب": "𒁀", "س": "𒊓",
"ل": "𒇷", "م": "𒈠", "ن": "𒈾", "ی": "𒅀"
}
Plugin(
mapping=mapping,
script_name="my_script",
description="خط شخصی من",
author="نام سازنده"
).created_script()
print(AncientScripts().my_script("سلام"))
⚠️
created_script()فقط برای طول عمر همان پردازه اثر دارد. برای سرویسهای دائمی، نگاشت را ذخیره کن و در هر بالا آمدن برنامه دوباره ثبتش کن.
🤖 AncientScriptAI
چت هوشمند که پاسخ را به خط باستانی تولید میکند.
| پارامتر | نوع | توضیح |
|---|---|---|
api_key |
str |
کلید API |
base_url |
str |
آدرس پایهی سرویس |
script |
str |
خط باستانی هدف |
include_translation |
bool |
افزودن ترجمهی فارسی و انگلیسی |
from ancient import AncientScriptAI
ai_bot = AncientScriptAI(api_key="YOUR_API_KEY", base_url="YOUR_BASE_URL")
print(ai_bot.get_ancient_response("سلام باستانی", "cuneiform"))
🔄 AncientReverseAI
ترجمهی معنایی متن باستانی به فارسی و انگلیسی — نه بازگردانی حرفبهحرف.
from ancient import AncientReverseAI
ai = AncientReverseAI(api_key="YOUR_API_KEY", base_url="YOUR_BASE_URL")
print(ai.translate(text="𒀀𒁀𒂊", script="cuneiform"))
⚠️ این ترجمه مفهومی و تاریخی است، نه رمزگشایی گلیف. یک متن باستانی ممکن است چند تفسیر معتبر داشته باشد و بهترین نتیجه با جملات کامل به دست میآید.
📸 AnalyzePhoto
تحلیل تصویر خط باستانی: تشخیص نوع خط، تحلیل نمادها، تفسیر متن و ترجمهی دوزبانه.
from ancient import AnalyzePhoto
analyzer = AnalyzePhoto(api_key="YOUR_API_KEY", base_url="YOUR_BASE_URL")
print(analyzer.analyze_image("test.png"))
⚠️ خروجی توسط هوش مصنوعی تولید میشود و احتمال خطا وجود دارد. این کلاس در مرحلهی آزمایشی است.
🎤 SpeechToAncient
ضبط صدا از میکروفون یا خواندن فایل صوتی → تبدیل به متن با AI → تبدیل به خط باستانی.
from ancient import SpeechToAncient
stt = SpeechToAncient(
api_key="YOUR_API_KEY",
base_url="YOUR_BASE_URL",
script="pahlavi"
)
result = stt.to_ancient(duration=5) # ضبط ۵ ثانیه از میکروفون
print(result)
result2 = stt.from_file("my_voice.mp3") # از فایل صوتی
print(result2)
🌐 AncientWeb
وباپ Flask محلی و کاملاً آفلاین — بدون نیاز به هاست یا API Key.
from ancient import AncientWeb
app = AncientWeb(version="6.2.0")
app.run_app() # http://localhost:5000
🤖🖼️ AncientAIWeb
وباپ هوشمند ترکیبی از AncientImageGenerator + AnalyzePhoto — ساخت تصویر، تحلیل عکس با AI و دانلود خروجی.
from ancient import AncientAIWeb
web = AncientAIWeb(api_key="YOUR_API_KEY", base_url="https://api.gapgpt.app/v1")
web.set_config(
enhance_contrast=True,
text_color=(255, 215, 2),
rtl=True
)
web.run_app(port=8000)
📚 AncientDocs 🆕
اجرای سایت مستندات بهصورت محلی. با هر نسخهی جدید، محتوای آن هم بهروز میشود.
from ancient import AncientDocs
AncientDocs().run()
📱 AncientBot
ربات آماده برای سه پیامرسان. کاربر دستور باستانی <متن> را میفرستد؛ ربات متن تبدیلشده و یک تصویر طلایی باکیفیت را پس میفرستد.
| متد | پیامرسان |
|---|---|
run_telegram(token) |
تلگرام |
run_rubika(token) |
روبیکا |
run_bale(token) 🆕 |
بله |
from ancient import AncientBot
bot = AncientBot(script="cuneiform")
bot.run_telegram("YOUR_TELEGRAM_TOKEN")
# bot.run_rubika("YOUR_RUBIKA_TOKEN")
# bot.run_bale("YOUR_BALE_TOKEN")
🔑 برای گرفتن توکن، در پیامرسان مربوطه به @BotFather پیام بده.
⚡ CLI
بدون نوشتن حتی یک خط پایتون، همهچیز را از ترمینال اجرا کن.
| دستور | توضیح |
|---|---|
ancient list |
لیست تمام وباپهای آماده |
ancient version |
نمایش نسخهی فریمورک |
ancient start webapp |
اجرای وباپ اصلی |
ancient start aiwebapp |
وباپ هوشمند (کلید را میپرسد) |
ancient start aiwebapp --api-key KEY |
وباپ هوشمند با ورود مستقیم کلید |
ancient start aiwebapp --api-key KEY --base-url URL |
با base-url دلخواه |
ancient start docs |
اجرای سایت مستندات |
ancient start bot --telegram TOKEN |
اجرای ربات تلگرام |
ancient start bot --rubika TOKEN |
اجرای ربات روبیکا |
$ ancient list
AncientLines Framework - Available Web Apps
============================================================
ancient start webapp -> Main Web App
ancient start aiwebapp --api-key KEY -> AI Web App
ancient start docs -> Documentation Site
ancient start bot --telegram TOKEN -> Telegram Bot
ancient start bot --rubika TOKEN -> Rubika Bot
ancient version -> Show version
============================================================
📋 مشخصات | Specifications
| مورد | مقدار |
|---|---|
| نسخه | 6.2.0 |
| پایتون | ≥ 3.8 |
| لایسنس | MIT |
| خطوط باستانی | 15+ |
| کلاسها | 17 |
| پشتیبانی RTL | ✅ |
| کار آفلاین | ✅ (بهجز ماژولهای AI) |
🔗 لینکها | Links
- 🌐 وبسایت رسمی: ancientline.ir
- 📦 PyPI: ancientlinesoftheworld
- 🐙 GitHub: amirhossinpython
- 📱 روبیکا: Python_Source_1403
- 📄 یادداشت علمی (سیویلیکا): civilica.com/note/17282
📄 لایسنس | License
MIT License — رایگان و متنباز.
ساخته شده با ❤️ توسط امیرحسین خزاعی | Created by AmirHossein Khazaei
Metadata
Release files for ancientlinesoftheworld 6.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ancientlinesoftheworld-6.2.2.tar.gz | 4.1 MB | Without provenance | Details for ancientlinesoftheworld-6.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ancientlinesoftheworld-6.2.2-py3-none-any.whl | Python 3 | none | any | Details for ancientlinesoftheworld-6.2.2-py3-none-any.whl |
Total release size: 8.2 MB
Release files / ancientlinesoftheworld-6.2.2.tar.gz
| Download URL | ancientlinesoftheworld-6.2.2.tar.gz |
|---|---|
| Size | 4.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b346c1a56d61616eab59165a1d9824a53228d6ab078216d539d68457cf579f0
|
|
BLAKE2b-256 checksum How to use checksums |
5bab0aa124588dca03eb23abd7bc3795ada6a796a1540cdc8357de716b9a376e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / ancientlinesoftheworld-6.2.2-py3-none-any.whl
| Download URL | ancientlinesoftheworld-6.2.2-py3-none-any.whl |
|---|---|
| Size | 4.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df8220b6d62e1b25ec530d62951c215a77bf59f1c73fe50791eeb7cbcf8ab45a
|
|
BLAKE2b-256 checksum How to use checksums |
d753a35c55d06b4610bc117f43265d93ee122b624ed94ebba4e89d69aeb2924f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for ancientlinesoftheworld 6.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.