Skip to main content

Thai-first Python helper libraries with Thai function names

Project description

Pythai

โปรเจกต์นี้เป็น 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

  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.1.0.tar.gz (23.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.1.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thaithon-0.1.0.tar.gz
  • Upload date:
  • Size: 23.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.1.0.tar.gz
Algorithm Hash digest
SHA256 a4a6f2a1a356b55a86dea8a325596874da57e1c9d78b9695f2f76b64de2ca437
MD5 9d961f442772305a6375fc657f6f34e1
BLAKE2b-256 48a44c58311d7cbd91c4cbb6c0306700ad6bd0a72ff52a87880994656d5ca137

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thaithon-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7177c6a634c50857ba1f19ae1e638f5fec60e710445eab017d1f91fe9aa0952
MD5 8223842ac7b7c33e4c58458601e541ce
BLAKE2b-256 304408a50f5af57a392ec7fba3d825d258c8327b7b45de45cffd30ff707aecb6

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