STT Wastukancana Student ID (NIM) Parser

Installs: 53

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

pkg:composer/wastukancana/nim

2.0.0 2025-10-16 13:06 UTC

This package is auto-updated.

Last update: 2025-10-16 13:09:36 UTC


README

I stand with Palestine

Waska NIM

version total downloads latest unstable version codecov license

Sekolah Tinggi Teknologi Wastukancana Student ID (NIM) Parser.

Requirements

  • PHP >= 7.4 (tested on 7.4, 8.0, 8.1, 8.2, 8.3)
  • Composer v2
  • cURL >= 7.19.4

Installation

Install the package with:

composer require wastukancana/nim

Usage

<?php

use Wastukancana\Nim;
use Exception;

require __DIR__ . '/vendor/autoload.php';

try {
    $nim = new Nim('211351143');
    var_dump($nim->dump());
} catch (Exception $e) {
    echo $e->getMessage();
}

Example dump without provider (name/gender/isGraduated null):

$student = (new Nim('211351143'))->dump();
/* object(Wastukancana\Student) {
    nim: "211351143",
    name: null,
    gender: null,
    isGraduated: null,
    admissionYear: 2021,
    study: "Teknik Informatika",
    educationLevel: "S1",
    firstSemester: 1,
    sequenceNumber: 143
} */

Provider (optional)

You can enrich student data by plugging one optional provider class (FQCN). Without a provider, only parser-derived fields are available (year, study, level, semester, sequence). Fields like name, gender, and graduation status will be null until a provider is used.

use Wastukancana\Nim;
use Wastukancana\Provider\PDDikti;
use Wastukancana\Provider\WastuFyi;

$nim = '211351143';

// Using PDDikti provider (pass FQCN)
$student = (new Nim($nim, PDDikti::class))->dump();

// Using Wastu.FYI provider (requires a Bearer token)
$token = getenv('WASTU_FYI_TOKEN');
$student = (new Nim($nim, WastuFyi::class, ['token' => $token])))->dump();
/* object(Wastukancana\Student) {
    nim: "211351143",
    name: "SULUH SULISTIAWAN",
    gender: "M",
    isGraduated: true,
    admissionYear: 2021,
    study: "Teknik Informatika",
    educationLevel: "S1",
    firstSemester: 1,
    sequenceNumber: 143
} */

Development

Run code style checks and tests locally:

composer psr2check
composer tests

This repository uses GitHub Actions to run the matrix CI against PHP 7.4 and 8.x with coverage reporting to Codecov.

License

This project is licensed under MIT License.