Skip to main content

Thai-first Python helper libraries with Thai function names

Project description

Thaithon

Thaithon logo

โปรเจกต์นี้เป็น playground สำหรับทำ helper/library ภาษาไทยบน Python โดยตั้งชื่อฟังก์ชันให้เป็นคำไทยที่อ่านง่าย และใช้งานได้ใกล้เคียง library มาตรฐาน

โครงสร้างโปรเจกต์

  • libs/
    • รวม library หลักทั้งหมด
    • ไพท่อน.py, ไพท่อน_builtins.py
    • คณิต.py, เวลา.py, สุ่ม.py, สถิติ.py
    • เจสัน.py, เรกซ์.py, เส้นทาง.py, ซีเอสวี.py
  • examples/
    • ตัวอย่างใช้งานสั้น ๆ
    • x.py, y.py
  • tests/
    • สคริปต์ทดสอบแต่ละโมดูล
  • tools/
    • utility/debug scripts
  • docs/
    • บันทึก handoff หรือเอกสารประกอบ

หมวด library ที่มีแล้ว

  • Built-ins ภาษาไทย (ไพท่อน.py)
  • Math (คณิต.py)
  • DateTime + sleep (เวลา.py)
  • Random (สุ่ม.py)
  • Statistics (สถิติ.py)
  • JSON (เจสัน.py)
  • Regex (เรกซ์.py)
  • File/Path (เส้นทาง.py)
  • CSV (ซีเอสวี.py)
  • System/OS (ระบบ.py)
  • Web/HTTP (เว็บ.py)
  • Argument parsing (อาร์กิวเมนต์.py)

หมายเหตุ Unicode

ภาษาไทยบางคำ (เช่นที่มี ) มีโอกาสพิมพ์คนละ Unicode form ได้ จึงมี alias สำรองบางชื่อเพื่อรองรับการใช้งานร่วมกัน

วิธีรันตัวอย่าง

เปิด terminal ที่ root ของโปรเจกต์ แล้วรัน:

python examples/y.py
python examples/x.py

วิธีรันเทส

python tests/test_data_libs.py
python tests/test_math.py
python tests/test_math_extended.py
python tests/test_datetime.py
python tests/test_random_stats.py
python tests/test_helpers.py
python tests/test_sleep.py

เริ่มใช้งานกับ Git

โปรเจกต์นี้ถูกเตรียมโครงสร้างและไฟล์พื้นฐานสำหรับ Git แล้ว (.gitignore, .gitattributes, .editorconfig, LICENSE, CHANGELOG.md, CONTRIBUTING.md)

คำสั่งเริ่มต้นที่แนะนำ:

git status
git add .
git commit -m "chore: initialize Pythai project structure"

Pre-package Checklist

ก่อนเริ่มทำเป็น package จริง แนะนำให้เช็ก:

  • ตั้งชื่อ package ที่จะ publish (เช่น pythai หรือชื่อไทยแบบทับศัพท์)
  • รวม API ที่ต้องการเปิด public ให้ชัดในแต่ละไฟล์ __all__
  • ให้ test หลักผ่านทั้งหมด
  • เก็บ changelog ให้เป็นเวอร์ชัน (Unreleased -> x.y.z)
  • เลือกแนวทาง versioning (เช่น SemVer)

เตรียมปล่อยขึ้น PyPI

โปรเจกต์นี้มีไฟล์ pyproject.toml แล้ว และสามารถ build ได้ด้วย PEP 517

  1. Build package
python -m build
  1. ตรวจสอบไฟล์ build
python -m twine check dist/*
  1. ทดลองปล่อยขึ้น TestPyPI
python -m twine upload --repository testpypi dist/*
  1. ปล่อยขึ้น PyPI จริง
python -m twine upload dist/*

หมายเหตุ:

  • เพิ่ม version ทุกครั้งก่อนปล่อย release ใหม่

License และ Attribution

  • โปรเจกต์นี้ใช้สัญญาอนุญาต Apache-2.0
  • กรุณาเก็บไฟล์ LICENSE และ NOTICE ไว้เมื่อมีการแจกจ่ายต่อ
  • หากใช้งานในงานวิจัย/บทความ แนะนำให้อ้างอิงจากไฟล์ CITATION.cff

Credit

แนวทาง naming

  • ใช้คำไทยความหมายตรง เช่น พิมพ์, รับค่า, จำนวนเต็ม, จำนวนจริง
  • ลดคำทับศัพท์เท่าที่ทำได้
  • เก็บ compatibility alias ในกรณีที่จำเป็น

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

thaithon-0.3.0.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

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

thaithon-0.3.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file thaithon-0.3.0.tar.gz.

File metadata

  • Download URL: thaithon-0.3.0.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for thaithon-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ae7c153c27e01a23a345d035942d7b7aa1d7719442bb7ddd4c66ea2df195abcb
MD5 06cc4d016b74061ec02ac4788a49ce31
BLAKE2b-256 c9b72cc4d00e31abcfa0f8d8a21b570b99eccaae9224a6a2506d78778f55fcb3

See more details on using hashes here.

File details

Details for the file thaithon-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: thaithon-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for thaithon-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa129e49dd0eab8fc84711a3b1f60dd45730502b5691ec92d2c4343a70e0db0e
MD5 1ff2f3ff81d34dad828b9f63088b2bc2
BLAKE2b-256 b8005f9aa4491b17143976b189b642e136e0ee72bae4a6db622bc363a49acdee

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