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.3.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.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: common_hj3415-0.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 9eff2114ffceeb52627b12cddd6bccf7043da8179bca8f9b38a9f5fb330fe344
MD5 3adbd23f576814fbac715c840d2d1f11
BLAKE2b-256 fee5e36a13a1f7e5bb94625d4532a19b71783d521e19379387907764c6b67edf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: common_hj3415-0.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8b03c9289f9ffe5b024f0834d998678e5b4a2985f9eeb27a2001d1d42fe64da1
MD5 82d00c0ce773afda8d96d8271595e3f9
BLAKE2b-256 4252c2416c49ec534ab2557feb5c2be02c6bdbd134db538859aff48bdab37a4d

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