Thai-first Python helper libraries with Thai function names
Project description
Thaithon
โปรเจกต์นี้เป็น 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)
หมายเหตุ 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
- Build package
python -m build
- ตรวจสอบไฟล์ build
python -m twine check dist/*
- ทดลองปล่อยขึ้น TestPyPI
python -m twine upload --repository testpypi dist/*
- ปล่อยขึ้น PyPI จริง
python -m twine upload dist/*
หมายเหตุ:
- เพิ่ม version ทุกครั้งก่อนปล่อย release ใหม่
License และ Attribution
- โปรเจกต์นี้ใช้สัญญาอนุญาต Apache-2.0
- กรุณาเก็บไฟล์
LICENSEและNOTICEไว้เมื่อมีการแจกจ่ายต่อ - หากใช้งานในงานวิจัย/บทความ แนะนำให้อ้างอิงจากไฟล์
CITATION.cff
Credit
- Maintainer: OteEnded
- Contact: ratnaritjumnong@gmail.com
แนวทาง 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thaithon-0.1.1.tar.gz.
File metadata
- Download URL: thaithon-0.1.1.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
045de7f3c0f8ceb847236e203dc101e1b19fdbcec21da3b107b9775b6d201fbc
|
|
| MD5 |
13cbd36f17af22060e7ffae28187326d
|
|
| BLAKE2b-256 |
69306bc1ddec9769f89b44eb9421527475ffac6824e7eac99abec7ba3965688b
|
File details
Details for the file thaithon-0.1.1-py3-none-any.whl.
File metadata
- Download URL: thaithon-0.1.1-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c0f4aa6f01982d9558a7803e18cb618652cce3205b6dcc49711168e4e8a779d
|
|
| MD5 |
2610a47c25df40788e874f2cfc622c8e
|
|
| BLAKE2b-256 |
e359c605228ae62b84fd5e6131750ebc41409531af4f3ddd9382b80da6819cd0
|