오늘은 오픈 API에 공개되어 있는 예금자보호 금융상품 조회 서비스 API 와 우체국금융 보험상품정보 조회 서비스 API를 활용해서 시중에서 거래되고 있는 보험 상품 정보들을 스크래핑하는 스크립트를 간단히 소개해드리고자 합니다. 인슈어테크 관련 해커톤에 나갔다가 수상은 못했지만, 여러모로 쓸모있을 거 같아 블로그를 통해 공유합니다.

 

예금자보호 금융상품 조회 서비스 API 와 우체국금융 보험상품정보 조회 서비스 API를 활용해서 시중 보험 상품 정보 스크래핑

사용한 오픈 API 정보

 

#-*- coding:utf-8 -*
import requests
import json

#update datas from openapi
def getPostProduct():
  keyword = ""
  productList = []
  resultList = []
  postProductJson = {"getProductList": ""}
  key = "<<set key>>"
  url = "http://apis.data.go.kr/1721301/KpostInsuranceProductView/insuranceGoods?serviceKey="+ key +"&GOOD_ABNM=" + keyword

  response = requests.get(url)
  jsonData = json.loads(response.content.decode(encoding='utf-8'))
  groupData = jsonData["response"]["body"]["items"]["item"]
  for data in groupData:
    resultList.append({"prtName":data["GOOD_ABNM"], "item":data})

  postProductJson["getProductList"] = resultList
  with open("postProduct.json", 'w', encoding='utf8') as outfile:
    json.dump(postProductJson, outfile, ensure_ascii=False)

def getNotCompany():
  key = "<<set key>>"
  rows = "10000"
  type = "json"
  pTypeList = ["금융투자", "은행", "저축은행"]
  notCompanyList = ["우리종합금융㈜"]
  for pType in pTypeList:
    url = "http://apis.data.go.kr/B190017/service/GetInsuredProductService/getCompanyList?serviceKey=" + key + "&numOfRows=" + rows + "&resultType=" + type + "&regnNm=" + pType

    response = requests.get(url)
    jsonData = json.loads(response.content.decode(encoding='utf-8'))
    groupData = jsonData['getCompanyList']['item'] 

    for data in groupData:
      company = data['fncIstNm']
      notCompanyList.append(company)

  return notCompanyList

def getCompany():
  key = "<<set key>>"
  rows = "10000"
  type = "json"
  url = "http://apis.data.go.kr/B190017/service/GetInsuredProductService/getCompanyList?serviceKey=" + key + "&numOfRows=" + rows + "&resultType=" + type
  response = requests.get(url)
  jsonData = json.loads(response.content.decode(encoding='utf-8'))
  groupData = jsonData['getCompanyList']['item']

  notCompanyList = getNotCompany()
  companyList = []
  for data in groupData:
    company = data['fncIstNm']
    check = str(company in notCompanyList)
    if check == "False":
      companyList.append(company)
  return companyList

def getProduct(company):
  key = "<<set key>>"
  rows = "10000"
  type = "json"
  url = "http://apis.data.go.kr/B190017/service/GetInsuredProductService/getProductList?serviceKey=" + key + "&numOfRows=" + rows + "&resultType=" + type + "&fncIstNm=" + company
  productList = []
  
  response = requests.get(url)
  jsonData = json.loads(response.content.decode(encoding='utf-8'))
  groupData = jsonData['getProductList']['item']
  for data in groupData:
    if data['prdSalDscnDt'] == "":
      productList.append(data['prdNm'])
  return productList
  
if __name__ == "__main__":
  getPostProduct()
  productJson = {"getProductList": ""}
  resultList = []

  companyList = getCompany()
  for company in companyList:
    productList = getProduct(company)
    result = {"company": company, "item": productList}
    resultList.append(result)
  
  productJson["getProductList"] = resultList
  with open("product.json", 'w', encoding='utf8') as outfile:
    json.dump(productJson, outfile, ensure_ascii=False)

 

스크립트 실행 후, 총 2개의 파일 생성

postProduct - 우체국 보험 상품 정보

postProduct.json
json viewer로 본 postProduct.json

product - 예금자 보호 금융 상품 중, 증권/은행 상품을 제외한 보험 상품 정보

product.json
json viewer로 본 product.json

 

반응형

오늘은 회사에서 근무하다가 문득 NoSQL에 속하는 데이터베이스들 중, 저한테만 조금 생소한 데이터베이스들에 대해서 기본적인 정보 및 특징들을 정리해보았습니다. 해당 포스트에서는 단순히 정보와 특징들만 정리하고, 다음 포스트에서는 차이점을 비교해보고자 합니다.

NoSQL: MongoDB,  RavenDB, CouchDB, DynamoDB에 대한 기본 정보 및 특징 정리

1. MongoDB http://mongodb.com

1.1. MongoDB 란?

MongoDB문서형 데이터베이스이므로 JSON과 같은 문서에 데이터를 저장한다.

일반적으로 알고 있는 MySQL과 같이 행렬로 이루어진 방식보다 훨씬 더 편리하다.

 

1.2. JSON 기반

- 데이터를 다룰때 가장 생산적인 방법

- 배열과 중첩된 객체 지원

- 유연하고 동적인 스키마 허용

 

1.3. 강력한 쿼리 언어

- 문서 내에 데이터들이 아무리 중첩되어 있더라도 필드 별로 필터링하고 정렬 가능

- 위치 기반 검색, 그래프 검색 및 텍스트 검색과 같은 집계 및 기타 지원

- 쿼리 자체는 JSON이므로 쉽게 작성 가능

 

1.4. 관계형 데이터베이스의 모든 기능 지원

2. RavenDB https://ravendb.net/features

2.1. RavenDB 란?

RavenDB문서형 데이터베이스이다.

 

2.2. 다중 모델 아키텍처

- 자동 ETL (추출, 변환 및로드) 프로세스 지원

- 데이터를 SQL 솔루션에 복제 가능

 

2.3. 올인원 데이터베이스

- 인하우스(in-house) 스토리지 엔진은 한 곳에서 모든 요구를 충족하도록 설계

 

2.4. 사용하기 쉬운

- 설치, 구현 및 사용이 쉬움

 

2.5. 빠른 확장

- 클러스터 설정은 RavenDB Management Studio에서 단순 클릭만으로도 관리 가능

 

2.6. 고 가용성

- 노드 간 실시간 복제를 통해 데이터베이스를 온라인 상태로 유지

- 항상 여러 지점에서 사용할 수 있음.

3. CouchDB https://couchdb.apache.org/

3.1. CouchDB 란?

CouchDB는 선택한 단일 응용 프로그램 서버 뒤의 다른 데이터베이스와 마찬가지로 작동하는 단일 노드 데이터베이스이다.
대부분의 사람들은 단일 노드 CouchDB 인스턴스로 시작한다. 이 보다 더 까다로운 프로젝트는 클러스터로 원활하게 업그레이드 할 수 있다.

 

3.2. 클러스터

- 여러 서버 또는 VM에서 단일 논리 데이터베이스 서버를 실행할 수있는 클러스터된 데이터베이스

- CouchDB 클러스터는 API를 변경하지 않고도 단일 노드 설정에서 더 높은 용량과 고 가용성 제공

 

3.3. HTTP / JSON

- 유비쿼터스 HTTP 프로토콜과 JSON 데이터 형식을 사용하며 이를 지원하는 모든 소프트웨어 호환

- HTTP 프록시 서버,로드 밸런서와 같은 외부 도구와도 원활히 동작

 

3.4. 오프라인 최초 데이터 동기화

- CouchDB의 고유한 복제 프로토콜은 네트워크 애플리케이션이 까다로운 모바일 애플리케이션 및 기타 환경을 위한 차세대의  "Offline First" 애플리케이션을 위한 토대

 

3.5. 생태계

- CouchDB는 서버용으로 (Raspberry Pi에서 대규모 클라우드 설치에 이르기까지) 구축

- PouchDB는 모바일 및 데스크탑 웹 브라우저 용으로 구축

- Couchbase Lite는 기본 iOS 및 Android 앱용으로 구축

- 모두 원활하게 데이터 복제

3.6. 신뢰할 수 있음

- CouchDB는 데이터 신뢰성에 대해 많은 고민을 했음 ( 원문. CouchDB is serious about data reliability. )

- 개별 노드는 충돌 방지 추가 전용 데이터 구조 사용

- 다중 노드 CouchDB 클러스터는 모든 데이터를 중복 저장하므로 필요할 때 언제든지 사용 가능

4. DynamoDB https://aws.amazon.com/ko/dynamodb/

4.1. DynamoDB 란?

Amazon DynamoDB는 어떤 규모에서도 10밀리초 미만의 성능을 제공하는 키-값문서형 데이터베이스이다.

 

4.2. 큰 규모를 지원하는 성능

- DynamoDB는 어떤 규모에서도 일관되게 10밀리초 미만의 응답 시간을 제공하여 세계에서 가장 큰 규모의 몇몇 애플리케이션 지원

- 고객은 사실상 무제한의 처리량과 스토리지로 애플리케이션 구축 가능

- DynamoDB 글로벌 테이블은 여러 AWS 리전에 데이터를 복제하므로 전 세계에 배포된 애플리케이션의 데이터에 빠르게 로컬 액세스 가능

- 밀리 초 단위의 지연 시간으로 더 빠른 액세스가 필요한 사용 사례를 위해 DynamoDB Accelerator(DAX)는 완전 관리형 인 메모리 캐시 제공

 

4.3. 서버 관리 불필요

- DynamoDB는 서버리스이므로, 서버를 프로비저닝하거나 패치를 적용하거나 관리할 필요 없음

- 소프트웨어를 설치하거나 관리하거나 운영할 필요 없음

- DynamoDB는 용량에 맞게 테이블을 자동으로 확장하고 축소하며 성능 유지

- 가용성과 내결함성이 내장되어 있어서 이러한 기능을 위해 애플리케이션을 설계할 필요 없음

- DynamoDB는 온디맨드 용량 모드와 및 프로비저닝 용량 모드를 모두 제공하므로 워크로드당 용량을 지정하거나, 사용하는 리소스에 대해서만 비용을 지불함으로써 비용을 최적화 가능

 

4.4. 엔터프라이즈에 사용 가능

- DynamoDB는 ACID 트랜잭션을 지원하므로 규모에 맞게 비즈니스 크리티컬 애플리케이션 구축 가능

- DynamoDB는 기본적으로 모든 데이터를 암호화하고 모든 테이블에 대해 세분화된 자격 증명 및 액세스 제어 제공

- 테이블에 대한 성능 저하 없이 수백 테라바이트의 데이터를 즉시 전체 백업하고, 가동 중지 없이 이전 35일 이내의 원하는 시점으로 복구 가능

- DynamoDB는 또한 가용성 보장을 위한 서비스 수준 계약을 통해 지원

 

반응형

오늘은 VMware Associate Solution Engineer 1차 서류 통과 후, 2차 전화 인터뷰 후기에 대해서 작성해보고자 합니다. 이번 공고에 지원하기 전에 여러 후기들을 많이 찾아보았는데, 국내에서는 1-2개 정도였는데 국내 후기 보다는 Glass door에 있는 후기들이 가장 큰 도움이 되었습니다. 다른 분들께도 저의 후기가 도움이 되었으면 합니다. 

지원 공고: https://careers.vmware.com/main/jobs/R1909520?lang=en-us

 

New Grad - Associate Solution Consultant - 신입 채용 | Seoul, Korea, Republic of | main

main is hiring a New Grad - Associate Solution Consultant - 신입 채용 in Seoul, Korea, Republic of. Review all of the job details and apply today!

careers.vmware.com

VMware 1차 서류 합격 메일

치맥을 하고 들어가던 길에 1차 서류 합격 메일을 받았다. Hooray!!!!!!!!!!!!!! VMware 서류 합격이라니.. 서류 합격만으로도 일단은 감사했다. 메일의 일부만 캡쳐했지만 아래 내용에는 전화 인터뷰 일정을 5개 정도 날짜를 정해서 후보로 적어달라는 내용이 있었다.

전화 인터뷰 일정

그리고 빠르게 5개의 날짜를 정해서 초 스피드로 답장을 했다. 전화 인터뷰 전에 Glass door를 통해 질문들을 확인하고, 예상 질문별로 답변을 엑셀 시트로 간단하게 정리하였다.그리고 전화 인터뷰 날짜를 정해서 인터뷰를 진행하였고, 전화 인터뷰 당시 질문들은 간단했다.

질문 리스트 답변 리스트
Tell me about a time when you went above and beyond the realm of your responsibilities. When I took the Best Of the Best nth program, I had a project for n months, which was the hardest. There is not enough data on the subject of Dark Web, and there are not many companies studying it. So it was a very difficult project for students to do. But, I tried to hard working & keep in touch with my teammates to overcome it. I was able to achieve a lot of things. And if I don't try to hard to overcome it, I had not good result. Even in difficult situations, I could overcome the communication with the team members, and continued to solve the problem and respond strategically.
Complete this sentence with one word. As a consultant, my job is to ______

Friend

I think consultant is Friend. Because, When we consult the client's Architecture and Infra structure, We need to know more about client's environment for better architecture. So Consultant needs to make the good environment for better communication. and consultant should be close to client.

Tell me about yourself. I have been working as a A role for more than n months. and while working cybersecurity company which was called A company, I was primarily responsible for Dark Web research, Cloud engineering and Cloud consulting. I have been studying the Cloud services since university. and next When I working in A company, I developed the anti-fraud solution based on cloud service. Therefore, more than anyone else I know about the cloud engineering and has the ability of professionals. And I have also experienced in cyber security and IT. My various experiences will be very helpful in conducting consultants.
Did you use any VMware's product? To be honest, I was surprised that vmware had more solutions and services than I thought. According to Wikipedia and the corporate page, there are a total of 36 solutions and services. And, after seeing vmware2019, I started to be interested in vShpere. So I used vShpere hands on lab for about 2 hours and I liked the manual in detail. And I usually need google ring when using other solutions or tools and have to look back on how to use, hands on lab didn't need to find a way to use it, so for 2 hours I was able to focus on the experience.
Tell me your understanding of the job nature of an Associate Consultant
I think an associate consultant needs to put a lot of effort into trying to get as much experience as possible.

And I believe that the basic quality of a consultant should provide the best solution for the customer, and the consultant should have a lot of experience and knowledge.

이 외에도 다양한 질문들이 있었는데, 대부분 이전 회사 혹은 이력에 대한 질문들이였다. 인터뷰 질문들은 일반적으로 많이 물어보는 자기소개, 본인이 생각하고 있는 회사, 자사 제품을 써본 적이 있는 지에 대한 질문들이였다.

전화 인터뷰 중에 이제 마지막에는 이 회사 이외에 다른 회사는 어떤 곳을 지원했는 지 물어보았다. 그리고 최종 면접 일정을 알려주었고, 다음 면접은 기술 면접이라고 알려주었다. ( 여기서 전화 인터뷰는 일단 통과했다! 라고 생각했다. ) 그리고, 전화 인터뷰 결과는 8-9일 정도 지나서 발표되었고, 8-9일 사이에 다른 회사로부터 합격 통지가 먼저 와서 일단 입사한 상태에서 3차 면접 통지를 받았다.

면접 준비 당시 참고한 자료들

TITLE URL
Cloud computing trends in 2019 https://hub.packtpub.com/cloud-computing-trends-in-2019/
The 5 Trends Every Cloud Evangelist Has on Their Mind https://blogs.vmware.com/cloudprovider/2017/05/the-5-trends-every-cloud-evangelist-has-on-their-mind.html
The Most Popular Cloud Computing Trends Beyond 2019 https://www.strategix.co.za/the-most-popular-cloud-computing-trends-beyond-2019/
vForum 2016 http://gsem.co.kr/2016/VMware/vFORUM/download.html
vForum 2017 http://www.vmwarekorea.co.kr/vFORUM2017/download.html
vForum 2018 http://www.vmwarekorea.co.kr/vFORUM2018/download.html
vSphere 개념 및 기능 http://blog.naver.com/PostView.nhn?blogId=printf7&logNo=221086723999&parentCategoryNo=&categoryNo=19&viewDate=&isShowPopularPosts=true&from=search

 

반응형

1. docker 가이드

https://subicura.com/2017/01/19/docker-guide-for-beginners-1.html

https://www.slideshare.net/pyrasis/docker-fordummies-44424016

 

1.1. docker for mini OS

https://blog.ubuntu.com/2018/07/09/minimal-ubuntu-released

 

Minimal Ubuntu, on public clouds and Docker Hub | Ubuntu

Today we are delighted to introduce the new Minimal Ubuntu, optimized for automated use at scale, with a tiny package set and minimal security cross-section. Speed, performance and stability are primary concerns for cloud developers and ops. “The small foo

ubuntu.com

 

1.2. docker redis

https://jistol.github.io/docker/2017/09/01/docker-redis/

 

Docker Redis 사용하기

 

jistol.github.io

 

1.3. docker - let's set redis on docker

http://yongho1037.tistory.com/699

 

Docker 활용기(4) - redis 구성해보기

Custom config 파일 적용하기 redis 이미지를 구동하면 설정이 기본값으로 적용되기 때문에 직접 설정한 redis.conf 파일을 적용하려면 docker run 명령 수행시에 -v 옵션을 통해 container 내의 /usr/local/etc/r..

yongho1037.tistory.com

 

1.4. docker blog

http://yongho1037.tistory.com/category/Programming/Docker?page=2

 

'Programming/Docker' 카테고리의 글 목록 (2 Page)

 

yongho1037.tistory.com

 

1.5. docker elasticsearch

http://brownbears.tistory.com/66

 

Elasticsearch 설치 및 사용법

Elastic Search 설치 $ docker pull elasticsearch # 이미지 다운로드 $ docker run -d -p 9200:9200 --name elastic elasticsearch # 기본세팅으로 바로 실행 $ docker run -d -p 9200:9200 --name elastic elast..

brownbears.tistory.com

 

1.6. docker save the change thing

https://code.i-harness.com/ko/q/1b402e1

불러오는 중입니다...

 

1.7. set the password in redis

http://dejavuqa.tistory.com/154

 

redis 암호 설정과 외부 접속 허용 설정

redis-server를 기본으로 설정했다면 로컬 접속만 허용되게 됩니다. 외부 서버에서는 접속이 되지 않습니다. 외부에서 접속하기 위한 설정과 암호를 설정해 봅시다. 먼저 암호설정입니다. redis.conf를 엽니다. $..

dejavuqa.tistory.com

 

2. docker 명령어 모음

docker + command

docker search < image name >

docker pull < image name > : < tag >

docker images

docker run < option > < image name > < file >

docker ps

docker start < container name > / restart

docker attach < container name >

docker exec < container name >

docker stop < container name >

docker rm < container name >

docker rmi < image name > : < tag >

docker build < option > < Dockerfile path >

 

2.1. 한 라인으로 모든 컨테이너 삭제

only one line command for delete all container

docker stop $(docker ps -a -q)

docker rm $(docker ps -a -q)

 

 

반응형

이번 포스트는 Elasticsearch를 공부하면서 참고한 자료들을 단순히 주제별로 정리한 포스트입니다.

 

1. ELK 스택

Elasticsearch + Logstash + Kibana 스택 구축 가이드

Digital Ocean - [how to install]

 

2. elasticsearch-dump [엘라스틱서치-덤프]

엘라스틱 서치에 있는 파일들을 json 포맷이나 csv 포맷으로 저장하는 파이썬 모듈 

2.1. Copy

2.2. Backup

 

3.4. merge

curl -XPOST 'localhost:9200/kimchy,elasticsearch/_forcemerge?pretty'

Best way, using reindex API

POST _reindex
{
  "conflicts": "proceed",
  "source": {
  "index": ["twitter", "blog"],
  "type": ["tweet", "post"]
  },
  "dest": {
  "index": "all_together"
  }
}

 

3.5. mapping

PUT post
{
  "mappings":{
    "nulled":{
      "properties":{
        "user":{
        "type":"text"
        },
        "title":{
        "type":"text"
        },
        "detail":{
        "type":"text"
        },
        "url":{
        "type":"text"
        },
        "datetime":{
        "type":"date","format":"YYYY-MM-dd HH:mm"
        }
     }
   }
}



반응형

이번 포스트의 주제는 파이썬으로 azure 서버 blob 스토리지 관리 입니다.

azure 에서 blob 스토리지를 생성하고 관리하는 과정은 다음 포스트에서 단계적으로 다룰 예정이며, 이번 포스트에서는 azure blob 스토리지에 있는 파일들을 로컬에서 저장하는 역할을 하는 파이썬 스크립트에 대해 작성하도록 하겠습니다!

 

먼저, 테스팅한 환경 정보입니다!

 

- 우분투 18.04 lts 환경

- 파이썬 패키지(pip)가 설치되어 있고, 파이썬 2.x 활용

 

파이썬 스크립트 작성 전, 확인해야하는 요소들

- account_name ( 여기서 name에 있는 정보들이 account_name 입니다. )

 

 

- access keys ( 여기서 account_name과 동시에 access keys 정보를 확인할 수 있습니다. )

해당 탭은 storage accounts 탭에서 특정 account에 접근 시 활성화되는 관리 창입니다.

( 관리 창이라는 표현이 맞는 지 모르겠습니다ㅠ 혹시 적절한 표현을 아시는 분은 피드백주시면 바로 반영하도록 하겠습니다. )

 

 

 

- container_name

특정 account에 접근하신 다음, 아래와 같이 blobs 탭이 창에 활성화되실텐데, 여기서 blobs에 접근하시면,

아래와 같은 정보들이 보여지게 됩니다. 여기서 name에 있는 정보들이 container_name 입니다.

 

 

 

 

다음은 azure blob 스토리지로부터의 파일 다운로드를 위한 파이썬 스크립트입니다.

from azure.storage.blob import BlockBlobServiceimport os

#connect azure blob storage
#azure blob storage와의 연동
block_blob_service = BlockBlobService(account_name='<account name>', account_key='<access keys>')
 
#set the saved file information
#로컬에서의 파일 저장 경로 설정
local_path = '<file path>'

#azure blob 스토리지 내의 저장할 파일 정보 설정
local_file_name = '<file name>'container_name = '<container_name>'

full_path_to_file = os.path.join(local_path, str.replace(local_file_name ,'.txt', '_DOWNLOADED.txt'))print("\nDownloading blob to " + full_path_to_file)block_blob_service.get_blob_to_path(container_name, local_file_name, full_path_to_file)

 

Reference

참고자료

 

Microsoft Azure Storage Library for Python

https://azure-storage.readthedocs.io

https://github.com/Azure/azure-storage-python

 

반응형

+ Recent posts