본문 바로가기

기술스택을 쌓아보자/Python25

swagger codegen 을 이용해 api를 python sdk로 만들기 ./run-in-docker.sh mvn package 기본 전제 1. docker 가 깔려 있음 2. api 개발이 완료되어 있고, 해당 내용이 https://apiurl/docs/swagger에 예쁘게 반영되어 있다는 점!! swagger를 쓰는 다양한 방법들이 있는데, 여기서는 docker를 사용한 방법을 적고자 한다. docker 를 이용한 swagger codegen 1. https://github.com/swagger-api/swagger-codegen 프로젝트를 로컬에 clone 한다. git clone https://github.com/swagger-api/swagger-codegen.git 2. 내가 필요한 버전의 브랜치로 이동한다 ( 저는 3.0.0으로 진행) git checkout -.. 2024. 3. 8.
[Python/pandas] 두 데이터 프레임이 동일한지 확인하기 (identify two datafame is equivalent) from pandas.testing import assert_frame_equal assert_frame_equal(df_a, df_b) 옵션도 유연하게 적용할 수 있다. check_dtype=True, check_index_type='equiv', check_column_type='equiv', check_frame_type=True, check_names=True, by_blocks=False, check_exact=False, check_datetimelike_compat=False, check_categorical=True, check_like=False, check_freq=True, check_flags=True 참고자료 pandas.testing.assert_frame_equal — pand.. 2023. 7. 14.
[Codewars 6kyu / Python]- datetime 패키지로 날짜 빼고 시간만 처리하기/시간 연산하기 문제 여러분은 한 기업의 컴퓨팅 전문가입니다. 특정 시간들에 대한 인풋값을 입력하면 해당 시간의 range, avg, median 값을 출력해야 합니다. 예상되는 input과 output의 형태는 아래와 같습니다. "01|15|59, 1|47|6, 01|17|20, 1|32|34, 2|3|17" => "Range: 00|47|18 Average: 01|35|15 Median: 01|32|34" - 이 문제는 날짜를 다룰 필요가 없습니다. - 시간은 60진수 바탕이기 때문에 일반적인 숫자처럼 다루기 보다는 time 형태로 변환하여 연산해야합니다. Codewars - Achieve mastery through coding practice and developer mentorship A coding pract.. 2023. 4. 16.
[python/리눅스]HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules _________________________________ ERROR collecting tests/test_settings.py __________________________________ import file mismatch: imported module 'test_settings' has this __file__ attribute: /home/hoseung2/cc/tests/test_settings.py which is not the same as the test file we want to collect: /home/hoseung2/test_release/cc/tests/test_settings.py HINT: remove __pycache__ / .pyc files and/or use a u.. 2022. 8. 12.