Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twinkle-parser

Package Overview
Dependencies
Maintainers
0
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twinkle-parser

Parse CSV from https://kdb.tsukuba.ac.jp to structured JSON.

  • 0.4.17
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

twinkle-parser

npm version Code Climate maintainability Codecov

Parse CSV from https://kdb.tsukuba.ac.jp to structured JSON.

Usage

From CLI

Quick use
npx twinkle-parser data_from_kdb.csv
Global Install
# Install with NPM
npm install -g twinkle-parser

# Install with yarn
yarn add --global twinkle-parser

# Then
twinkle-parser data_from_kdb.csv
Use inside repo
# * Inside repo directory
# Install dependencies
yarn

# Parse
yarn run parse data_from_kdb.csv

As API

# Install with NPM
npm install twinkle-parser

# Install with yarn
yarn add twinkle-parser
const parse = require('twinkle-parser')
const data = parse('CSV string here') // -> KDBData

CLI options

Option
-o PATH / --output PATHExport result to a file at the PATH instead of to stdout.
-p / --prettyPrettify json output.
--fieldsFields to be included (comma-separated, specifing all if not set)
-h / --helpPrint help & usage.
-v / --versionPrint version info

Output Format

{
  "COURSE_ID": {

    "title": "Twinkle",

    // Class type (defined value by original data)
    "type": 1,

    // Course unit
    "unit": 1,

    // Course target grades
    "targets": [1, 2],

    // Terms & Modules
    // 0 = Spring A, 1 = Spring B, ...
    "termStr": "春AB",
    "terms": [ 0, 1 ],

    // Day & Period sets
    "periodStr": "月1-3\n水4-6",
    "periods": [
      // [ Days( 0 = Sun. 1 = Mon. ... ), Periods ]
      [ [ 1 ], [ 0, 1, 2 ] ],
      [ [ 3 ], [ 4, 5, 6 ] ]
    ],

    // Rooms
    "rooms": [ "7A106", "7C202" ],

    // Instructors
    "instructors": [ "筑波 太郎" ],

    // Overview & Remarks
    "overview": "",
    "remarks": ""

    // Last update in unix time
    "updatedAt": 1583390263000
  }
}

TypeScript Support

TypeScript supported! 🎉

// This will be imported with types
import parse from 'twinkle-parser'

// And types for output data are also available
import { KDBData, KDBCourse } from 'twinkle-parser'

Contribution

Issue or PR submissions are welcome.

FAQs

Package last updated on 29 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc