Metadata-Version: 2.1
Name: ut-course-catalog
Version: 0.1.0
Summary: Fetch UTokyo Online Course Catalogue.
Home-page: https://github.com/34j/ut_course_catalog
Author: 34j
Author-email: 34j@github.com
License: MIT license
Keywords: ut_course_catalog
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.6
License-File: LICENSE

=================
ut-course-catalog
=================

.. image:: https://img.shields.io/github/license/34j/ut-course-catalog
        :target: https://github.com/34j/ut-course-catalog
        :alt: GitHub License

.. image:: https://img.shields.io/pypi/v/ut_course_catalog.svg
        :target: https://pypi.python.org/pypi/ut_course_catalog

.. image:: https://img.shields.io/travis/34j/ut_course_catalog.svg
        :target: https://travis-ci.com/34j/ut_course_catalog

.. image:: https://readthedocs.org/projects/ut-course-catalog/badge/?version=latest
        :target: https://ut-course-catalog.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status

.. image:: https://pyup.io/repos/github/34j/ut_course_catalog/shield.svg
        :target: https://pyup.io/repos/github/34j/ut_course_catalog/
        :alt: Updates

Python package to fetch UTokyo Online Course Catalogue.

Installation
------------

Install ``ut-course-catalog`` using ``pip``:

.. code-block:: shell
        
        pip install ut-course-catalog


Features
--------

* Fetches UTokyo Online Course Catalogue.

Usage
-------

Minimum:

.. code-block:: python

    #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:

.. code-block:: python

    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 <https://ut-course-catalog.readthedocs.io>`_.
