Skip to main content

MyFAP API CLI

Giới thiệu

Đây là cli tương tác giống hoàn toàn với APP MYFAP trên điện thoại. Bạn có thể xem lịch học, lịch thi, điểm số (sự thất vọng của gia đình), thông tin cá nhân, v.v. 1 cách thuận tiện, không bị gò bó trong giao diện app.

  • Lưu ý: repo này được thực hiện cùng với sự hỗ trợ của AI.

Tính năng chính

  • Hỗ trợ đa nền tảng.
  • Login thông qua FEID hoặc Google OAuth.
  • Xem lịch học (từng tuần hoặc cả Kỳ).
  • Xem điểm (từng môn hoặc cả Kỳ).
  • Check điểm danh (từng môn hoặc cả Kỳ).
  • Check tình trạng đơn từ.
  • Xem thông báo của trường.
  • Check Info của sinh viên hoặc phòng dvsv.
  • Convert lịch học Kỳ sang ICS, dễ dàng import lịch học vào Google Calendar hoặc các dịch vụ tương tự.
  • Và nhiều hơn nữa ...

Cách sử dụng

Bạn có thể cài ứng dụng bằng pip theo hướng dẫn bên dưới. Để phát triển từ mã nguồn, xem mục dùng uv.

  • Cài đặt ứng dụng.

    pip install myfap
    
  • Lấy danh sách cơ sở.

    myfap campuses
    
  • Login vào feid (chỉ cần làm 1 lần, mặc định chọn cơ sở Hola).

    myfap login
    

    Sau khi hoàn thành login, phiên đăng nhập sẽ dc lưu ở ~/.myfap-api-cli/session.json

  • Login cho cơ sở Xavalo.

    myfap login -c HCM
    
  • Lấy Lịch học (tự động lấy kỳ mới nhất).

    myfap schedule
    

Phát triển với uv

Bạn cần cài uv trước khi bắt đầu. Repo dùng Python 3.11 cho môi trường dev, được chọn trong .python-version; package vẫn hỗ trợ Python từ 3.9. Cả .python-version và uv.lock được commit để các máy dùng cùng cấu hình và phiên bản dependency.

Clone repo và cài môi trường theo lockfile:

git clone https://github.com/WindowScary321/myfap-api-cli.git
cd myfap-api-cli
uv sync --locked

uv sync tạo .venv và cài package ở chế độ editable, nên thay đổi mã nguồn có hiệu lực khi chạy CLI. Bạn dùng uv run để chạy trong môi trường này, không cần activate thủ công hay chạy uv init trong repo đã có cấu hình.

uv run myfap --help
uv run myfap version
uv run python -m unittest discover -s tests -v
uv build

Trình duyệt cho đăng nhập

Đăng nhập mở cửa sổ trình duyệt và ưu tiên Chrome đã cài trên máy, sau đó thử Edge. Nếu có Chrome hoặc Edge chạy được, bạn không cần cài thêm trình duyệt. Để dùng Firefox làm phương án dự phòng, cài trình duyệt của Playwright bằng lệnh sau:

uv run playwright install firefox

Bước cài Firefox là tùy chọn; việc build package không cần trình duyệt.

Cập nhật dependency

Bạn dùng uv add <tên-package> hoặc uv remove <tên-package> để cập nhật dependency trong pyproject.toml và uv.lock. Nếu sửa dependency trực tiếp trong pyproject.toml, chạy uv lock rồi uv sync --locked. Sau khi kiểm tra, commit cả thay đổi cấu hình và lockfile cùng nhau. Không commit thư mục .venv.

Các Options

Option Chú thích
--help Hiển thị bảng Commands và Options
--config <đường dẫn> Đường dẫn tới file cấu hình session tùy chỉnh (mặc định: ~/.myfap-api-cli/session.json)
-c, --campus <cơ sở> Mã cơ sở (VD: APHL, HCM, DN) [default: APHL]
-s, --semester <kỳ học> Tên kỳ học (VD: Summer2026)
-cid, --courseid <mã môn> Chọn mã môn, chỉ có ở command marks. (VD: 82934, lấy từ bảng điểm của kỳ, ko phải mã môn như PRO192, SWE201c, ...)
-w, --week <số tuần> Chọn tuần, chỉ có ở command week-timetable
-y, --year <số năm> Chọn năm học, chỉ có ở command week-timetable
-d, --date <YYYY-MM-DD> Chỉ định ngày chính xác, chỉ có ở command week-timetable
-sc, --subjectcode <mã môn> Chọn môn học, chỉ có ở command attendance
-cn, --classname <mã lớp> Chọn lớp học, chỉ có ở command attendance
--ics Convert Sang ICS, dễ dàng import lịch học vào Google Calendar hoặc các dịch vụ tương tự, chỉ có ở command schedule)
-p, --pretty Format lại bảng điểm gốc của trường sang dạng json, chỉ có ở command marks)
--output, -o <thư mục> Thư mục xuất file thay vì thư mục hiện tại
--stdout In kết quả trực tiếp ra màn hình thay vì lưu file
-f, --force Buộc đăng nhập lại, bỏ qua file session.json, chỉ có ở command login

Các ví dụ sử dụng

Metadata

Release files for myfap 0.1.8

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

Source distribution (sdist)

Source distribution for myfap 0.1.8
File Size Uploaded Provenance Actions
myfap-0.1.8.tar.gz 18.2 kB With provenance Details for myfap-0.1.8.tar.gz

Built distribution (wheel)

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

Total release size: 36.1 kB

Release files / myfap-0.1.8.tar.gz

Download URL myfap-0.1.8.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1618821b866cc768bcc229323c1174434f9c79ed16cd03a68f926664fb002772
BLAKE2b-256 checksum
How to use checksums
10130af248c7e342cf0acdf75e5364257b77e77d75eba89f484dbdec3d768e5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / myfap-0.1.8-py3-none-any.whl

Download URL myfap-0.1.8-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42c98bed4ae4ce67ee4468d47d37bece31aea2e84fe0262491620752cd7d2ecf
BLAKE2b-256 checksum
How to use checksums
ca51a21df38448f6a343e60a5f0ee4f249e1abc53ab97dbeffda9a6bac6da3d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Security for myfap 0.1.8

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for myfap-0.1.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

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