Skip to main content

mathbyart

ไลบรารี Python สำหรับการคำนวณทางคณิตศาสตร์ ครอบคลุมฟังก์ชันด้านทฤษฎีจำนวน (Number Theory) และการวิเคราะห์ข้อมูลทางสถิติเบื้องต้น (Statistics) อย่างง่ายและสะดวกรวดเร็ว


การติดตั้ง (Installation)

ติดตั้งผ่าน pip จาก PyPI:

pip install mathbyartMath & Stats Tools (mathbyart)

ตัวอย่าง Python Package มาตรฐาน PEP 517/621 สำหรับคำนวณด้านทฤษฎีจำนวนและสถิติเบื้องต้น

## การใช้งาน
```python
import mathbyart as pkg

# ==========================================
# 1. ทดสอบฟังก์ชันด้านทฤษฎีจำนวน (Number Theory)
# ==========================================
print("=== Number Theory Functions ===")

# ตรวจสอบจำนวนเฉพาะ (Recursion)
print("is_prime(17):", pkg.is_prime(17))
print("is_prime(20):", pkg.is_prime(20))

# หา ห.ร.ม. และ ค.ร.น.
print("gcd(48, 18):", pkg.gcd(48, 18))
print("lcm(4, 6):", pkg.lcm(4, 6))

# คำนวณแฟกทอเรียล (Memoization / lru_cache)
print("factorial(5):", pkg.factorial(5))

# ตรวจสอบจำนวนสมบูรณ์ และแยกตัวประกอบเฉพาะ
print("is_perfect_number(28):", pkg.is_perfect_number(28))
print("prime_factors(12):", pkg.prime_factors(12))

# เปรียบเทียบอัลกอริทึม (Algorithm Comparison: Recursive vs Iterative)
pkg.compare_gcd(1234567890, 987654321)

# วัตถุจำนวนเต็มและ Magic Methods (__str__, __eq__, __add__)
n1 = pkg.Number(48)
n2 = pkg.Number(18)
print(f"Number 1: {n1}, Number 2: {n2}")
print("GCD via '+' operator (n1 + n2):", n1 + n2)

# ทฤษฎีกราฟและเครือข่าย (NetworkX)
graph = pkg.create_divisibility_graph([2, 3, 4, 6, 12])
print("Divisibility Edges:", graph["edges"])

# สัญลักษณ์ทางคณิตศาสตร์ (SymPy - ถ้ามีการติดตั้ง)
try:
    print("Symbolic Factors (12):", pkg.prime_factors_symbolic(12))
except ImportError:
    pass


# ==========================================
# 2. ทดสอบฟังก์ชันด้านสถิติ (Statistics)
# ==========================================
print("\n=== Statistics Functions ===")

sample_data = [2, 4, 4, 4, 5, 5, 7, 9]

# ค่าสถิติพื้นฐาน (NumPy)
print("mean:", pkg.mean(sample_data))
print("median:", pkg.median(sample_data))
print("mode:", pkg.mode(sample_data))
print("variance:", pkg.variance(sample_data))
print("std_dev:", pkg.std_dev(sample_data))

# ประมวลผลข้อความตัวเลข (String Processing)
parsed = pkg.parse_numbers("10, 20, 30")
print("parse_numbers:", parsed)

# คลาสและการสืบทอดคุณสมบัติ (Class & Inheritance)
analyzer = pkg.DataAnalyzer(sample_data)
print("Analyzer Summary:", analyzer.get_summary())

adv = pkg.AdvancedAnalyzer([2, 4, 6, 8, 10], name="ScoreData")
print(f"[{adv.name}] Mean (Parent): {adv.get_mean()} | Range (Child): {adv.get_range()}")

# การอ่านและเขียนไฟล์ (File I/O)
pkg.save_summary_to_file(sample_data, "report.txt")
print("บันทึกสรุปผลลง 'report.txt' สำเร็จ")

Metadata

Release files for mathbyart 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mathbyart 0.3.3
File Size Uploaded Provenance Actions
mathbyart-0.3.3.tar.gz 8.1 kB Without provenance Details for mathbyart-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mathbyart 0.3.3
File Interpreter ABI Platform Actions
mathbyart-0.3.3-py3-none-any.whl Python 3 none any Details for mathbyart-0.3.3-py3-none-any.whl

Total release size: 17.7 kB

Release files / mathbyart-0.3.3.tar.gz

Download URL mathbyart-0.3.3.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
480cf8cbe3243a90a62280e52516386f0146c9e53fe8be90f1e54d580dedcd29
BLAKE2b-256 checksum
How to use checksums
1ebc50135b44470d5cb8378a2bf7a9584783bb4a828b7675c2808574b68f67c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / mathbyart-0.3.3-py3-none-any.whl

Download URL mathbyart-0.3.3-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03786c1fcf41c0ea8c28bdf6daf2540dd0e5ba15abd1f112e913eb83d94aa8aa
BLAKE2b-256 checksum
How to use checksums
afe3accb3df0b025eae44e74442e5d57b98d54f984b87021c7e9105fbb0e441e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for mathbyart 0.3.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page