Skip to main content

日本の民法に基づく相続計算のコアライブラリ

Project description

Inheritance Calculator Core

日本の民法に基づく相続計算のコアライブラリ

概要

inheritance-calculator-coreは、日本の民法に基づいた相続人の資格確定と相続割合の計算を行うPythonライブラリです。

このライブラリは以下のパッケージで使用されています:

  • inheritance-calculator-cli: CLIアプリケーション
  • inheritance-calculator-web: Webアプリケーション(開発予定)

特徴

  • 相続人資格の判定: 配偶者、子、直系尊属、兄弟姉妹の相続権を民法に基づいて判定
  • 相続割合の計算: 法定相続分を自動計算
  • 代襲相続の処理: 子の代襲相続(制限なし)、兄弟姉妹の代襲相続(1代限り)
  • 特殊ケースの対応: 相続放棄、相続欠格、相続廃除、再転相続
  • Neo4jデータベース統合: グラフデータベースによる相続関係の永続化
  • AI対話インターフェース: Ollama経由での自然言語対話(オプション)

インストール

pip install inheritance-calculator-core

使い方

基本的な使用例

from datetime import date
from inheritance_calculator_core.models.person import Person
from inheritance_calculator_core.services.inheritance_calculator import InheritanceCalculator

# 被相続人と相続人候補の作成
decedent = Person(
    name="山田太郎",
    is_decedent=True,
    is_alive=False,
    death_date=date(2025, 6, 15)
)

spouse = Person(name="山田花子", is_alive=True)
child1 = Person(name="山田一郎", is_alive=True)

# 相続計算
calculator = InheritanceCalculator()
result = calculator.calculate(
    decedent=decedent,
    spouses=[spouse],
    children=[child1],
    parents=[],
    siblings=[]
)

# 結果の表示
for heir in result.heirs:
    print(f"{heir.person.name}: {heir.share} ({heir.share_percentage}%)")

ライセンス

MIT License


バージョン: 1.0.0

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

inheritance_calculator_core-1.0.0.tar.gz (242.6 kB view details)

Uploaded Source

Built Distribution

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

inheritance_calculator_core-1.0.0-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

Details for the file inheritance_calculator_core-1.0.0.tar.gz.

File metadata

File hashes

Hashes for inheritance_calculator_core-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b75bc7d0042a3c694e02a0a456986752c2889655f7b934ccd9774ce3b36cb528
MD5 965a2ab5f79299c359373ebe93ad9229
BLAKE2b-256 e198c22d6de42fbe3f002e9bbde22bbb62c33115cb8ebfe4ac67c7f283ca820d

See more details on using hashes here.

File details

Details for the file inheritance_calculator_core-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for inheritance_calculator_core-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7df1e28492f2e8e548ddf4ef05733956a7d13d7f7507c2fec31d3ceb356be893
MD5 300db62f3fd35290e4c1726a4d3b2597
BLAKE2b-256 7b09e486841fd1d2575ace0320df4416136e3d5e698fe397675f17c536beea16

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