Skip to main content

school meal data

Project description

๐Ÿž K-School Meal

k-๊ธ‰์‹


๋‹ค์šด

python3 -m pip install k-SchoolMeal

์˜ˆ์‹œ


import asyncio

import KSchoolMeal

#async
async def main():
    school_data = await KSchoolMeal.school_code( input('school: ') )

    meal_data = await KSchoolMeal.school_meal(school_data.region_code, school_data.school_code, input('date(yyyyMM): '))
    # meal_data: List[SchoolMealInfo] 

#sync
def main():
    school_data = KSchoolMeal.sync.school_code( input('school: ') )
    
    meal_data = KSchoolMeal.sync.school_meal(school_data.region_code, school_data.school_code, input('date(yyyyMM): '))

์ •๋ณด


๊ต์œก์ฒญ ์ฝ”๋“œ

region_codes = {
        '์„œ์šธํŠน๋ณ„์‹œ': 'B10',
        '๋ถ€์‚ฐ๊ด‘์—ญ์‹œ': 'C10',
        '๋Œ€๊ตฌ๊ด‘์—ญ์‹œ': 'D10',
        '์ธ์ฒœ๊ด‘์—ญ์‹œ': 'E10',
        '๊ด‘์ฃผ๊ด‘์—ญ์‹œ': 'F10',
        '๋Œ€์ „๊ด‘์—ญ์‹œ': 'G10',
        '์šธ์‚ฐ๊ด‘์—ญ์‹œ': 'H10',
        '์„ธ์ข…ํŠน๋ณ„์ž์น˜์‹œ': 'I10',
        '๊ฒฝ๊ธฐ๋„': 'J10',
        '๊ฐ•์›๋„': 'K10',
        '์ถฉ์ฒญ๋ถ๋„': 'M10',
        '์ถฉ์ฒญ๋‚จ๋„': 'N10',
        '์ „๋ผ๋ถ๋„': 'P10',
        '์ „๋ผ๋‚จ๋„': 'Q10',
        '๊ฒฝ์ƒ๋ถ๋„': 'R10',
        '๊ฒฝ์ƒ๋‚จ๋„': 'S10',
        '์ œ์ฃผํŠน๋ณ„์ž์น˜๋„': 'T10'
    }

ํด๋ž˜์Šค

class SchoolMealInfo: # ๊ธ‰์‹ ์ •๋ณด
    region_code : str               #์‹œ๋„๊ต์œก์ฒญ์ฝ”๋“œ
    region_office_name : str        #์‹œ๋„๊ต์œก์ฒญ๋ช…
    school_code : str               #ํ‘œ์ค€ํ•™๊ต์ฝ”๋“œ
    school_name : str               #ํ•™๊ต๋ช…
    meal_code : str                 #์‹์‚ฌ์ฝ”๋“œ
    meal_type : str                 #์‹์‚ฌ๋ช…
    date : str                      #๊ธ‰์‹์ผ์ž
    person_number: int              #๊ธ‰์‹์ธ์›์ˆ˜
    dish : list[str]                #์š”๋ฆฌ๋ช…
    origin_info : list[str]         #์›์‚ฐ์ง€์ •๋ณด
    calorie : str                   #์นผ๋กœ๋ฆฌ์ •๋ณด
    nutrients : dict[str, float]    #์˜์–‘์ •๋ณด
class SchoolInfo: # ํ•™๊ต ์ •๋ณด
    region_code : str               #์‹œ๋„๊ต์œก์ฒญ์ฝ”๋“œ
    region_office_name : str        #์‹œ๋„๊ต์œก์ฒญ๋ช…
    school_code : str               #ํ‘œ์ค€ํ•™๊ต์ฝ”๋“œ
    school_name : str               #ํ•™๊ต๋ช…
    school_level: str               #ํ•™๊ต์ข…๋ฅ˜๋ช…
    location_name : str             #์†Œ์žฌ์ง€๋ช…
    foundation_type : str           #์„ค๋ฆฝ๋ช…(ex: ์‚ฌ๋ฆฝ, ๊ณต๋ฆฝ)
    address : str                   #๋„๋กœ๋ช…์ฃผ์†Œ
    tel: str                        #์ „ํ™”๋ฒˆํ˜ธ
    homepage: str                   #ํ™ˆํŽ˜์ด์ง€์ฃผ์†Œ
    coeducation: str                #๋‚จ๋…€๊ณตํ•™๊ตฌ๋ถ„๋ช…
    school_type : str               #๊ณ ๋“ฑํ•™๊ต๊ตฌ๋ถ„๋ช…
    school_anniversary : str        #๊ฐœ๊ต๊ธฐ๋…์ผ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

k-SchoolMeal-1.0.6.Alpha.tar.gz (17.5 kB view hashes)

Uploaded Source

Built Distribution

k_SchoolMeal-1.0.6a0-py3-none-any.whl (18.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page