ut-course-catalog

GitHub License https://img.shields.io/pypi/v/ut_course_catalog.svg https://img.shields.io/travis/34j/ut_course_catalog.svg Documentation Status Updates

Python package to fetch UTokyo Online Course Catalogue.

Installation

Install ut-course-catalog using pip:

pip install ut-course-catalog

Features

  • Fetches UTokyo Online Course Catalogue.

Dataset

  • 東京大学授業カタログはインターネット上で公開されており、誰でも無償で入手可能であるため、データセットの公開は著作権者の利益を不当に害する行為ではない

  • 東京大学授業カタログに同意すべき利用規約はない

したがって、著作権法第三十条の四に基づいて、データセットを公開します。

  • CSV

  • Twitter映えを目指して軽く解析した Notebook

Kaggleに登録したいのですが電話番号が無くPublicにできませんでした…

Usage

Minimum:

#1. import
import ut_course_catalog.ja as utcc

#2. create a UTCourseCatalog instance
async with utcc.UTCourseCatalog() as catalog:
    #3. fetch search results
    results = await catalog.fetch_search(utcc.SearchParams(keyword="python"))
    #4. print the results
    print(results)

    #3. fetch details
    detail = await catalog.fetch_detail("30001", 2022)
    #4. print the results
    print(detail)

With pandas:

import pandas as pd
import ut_course_catalog.ja as utcc

async with utcc.UTCourseCatalog() as catalog:
    results = await catalog.fetch_search(utcc.SearchParams(keyword="python", 曜日=utcc.Weekday.Mon))
    # convert to pandas DataFrame
    df = pd.DataFrame([x._asdict() for x in results.items])
    display(df)

    detail = await catalog.fetch_detail("30001", 2022)
    # convert to pandas DataFrame (not Series, because it is not pretty)
    df = pd.Series(detail._asdict()).to_frame()
    display(df)

For more information, see the documentation.

Contributing

Contributions are welcome. Please open an issue first to let us know what you are going to work on.