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)

หมายเหตุ 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.2.0.tar.gz (24.2 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.2.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for thaithon-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a99a03eb2f3986afde65970c973044fc997fa59a6af616dddf8375df77415577
MD5 fa1d9f10f4f7f5ba4ab8a4bb480a0e25
BLAKE2b-256 18f9fefc3d85651d247f7ef63097a686ad4a6243dc5aac9fe959bbc0175375b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thaithon-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.2 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed8718405cdfaab913a21e189cb59f7fdac1bff5aa7c9ca7bbcf0abb6e1701d6
MD5 aa52a6b944cf070fecdbe12a919a1da0
BLAKE2b-256 5fc1e6d384a36462c641689447159e564c49edf31dfcc18baf025b1ac6f1118c

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