Skip to main content

Shared tools for hj3415 projects

Project description

common-hj3415 README

common-hj3415는 프로젝트 간 공통으로 사용하는 경량 유틸리티 라이브러리입니다.
문자열 정리, 숫자 변환, 시간 정규화, 딕셔너리 일부 추출 같은 반복 로직을 한 곳에 모아 재사용할 수 있게 제공합니다.

pyproject.toml 기준 정보:

  • 패키지명: common-hj3415
  • 버전: 0.2.2
  • Python: >=3.11
  • 빌드 백엔드: flit_core
  • 의존성: contracts-hj3415

1. 프로젝트 기능 설명

이 프로젝트는 비즈니스 로직 패키지가 아니라 “공통 도구 모음” 역할을 합니다.

주요 기능:

  • 문자열 정규화: clean_text
    • None -> ""
    • NBSP 제거
    • 연속 공백 축소
  • 숫자 처리: to_float, parse_number_token, nan_to_none
  • 시간 처리: utcnow, to_utc
  • 디버깅/출력 보조: head_dict

이런 유틸을 공통 패키지로 분리하면, 여러 프로젝트에서 동일한 데이터 정리 규칙을 유지하기 쉽습니다.

2. 프로젝트 구조 설명

common-hj3415/
├─ pyproject.toml
└─ src/common_hj3415/
   ├─ utils/
   │  ├─ strings.py   # clean_text
   │  ├─ numbers.py   # to_float, parse_number_token, nan_to_none
   │  ├─ time.py      # utcnow, to_utc
   │  └─ etc.py       # head_dict
   ├─ domain/         # 현재는 빈 스켈레톤(확장용)
   └─ py.typed

utils는 실제 사용 코드가 들어 있고, domain은 향후 공통 도메인 규칙 확장을 위한 자리입니다.

3. 다른 프로젝트에서 임포트해서 사용하는 예시

설치:

python -m pip install common-hj3415

문자열/숫자/시간 유틸 사용 예시:

from datetime import datetime

from common_hj3415.utils.numbers import to_float
from common_hj3415.utils.strings import clean_text
from common_hj3415.utils.time import to_utc

name = clean_text("  삼성전자\xa0 ")
price = to_float("1,234.50")
asof = to_utc(datetime(2026, 3, 29, 12, 0, 0))

print(name)   # "삼성전자"
print(price)  # 1234.5
print(asof)   # 2026-03-29 12:00:00+00:00

딕셔너리 일부만 출력할 때:

from common_hj3415.utils.etc import head_dict

d = {"a": 1, "b": 2, "c": 3, "d": 4}
print(head_dict(d, n=2))  # {"a": 1, "b": 2}

4. 참고 사항

  • 이 패키지는 CLI를 제공하지 않는 라이브러리입니다.
  • 현재 코드 기준으로 별도 환경변수 설정이 필요하지 않습니다.
  • 단독 실행 서비스가 아니므로 Docker 실행 섹션은 포함하지 않았습니다.

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

common_hj3415-0.2.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

common_hj3415-0.2.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file common_hj3415-0.2.4.tar.gz.

File metadata

  • Download URL: common_hj3415-0.2.4.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for common_hj3415-0.2.4.tar.gz
Algorithm Hash digest
SHA256 f7c45a33c6d74f0a4b80aa1b800df82f42fe5f4de8b42bae39a7a9242f1f72fc
MD5 52a177bb4b651bb206bad19c2bf7dbdd
BLAKE2b-256 11e0f76d64f50dcf4b114e46c080f99b34c1c0f8b026bff09627edeedffd2fda

See more details on using hashes here.

File details

Details for the file common_hj3415-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: common_hj3415-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for common_hj3415-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 88d163dd9803baab96ddc0f7be14a0edac5285b0312cecb63c56ecff661af666
MD5 ea786e3eb02abb74739a470b9d388c74
BLAKE2b-256 5b191068119a9b9e7bd3572ea953fab5ef815fa49864e558084d78aba9f8d293

See more details on using hashes here.

Supported by

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