日本の民法に基づく相続計算のコアライブラリ
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
バージョン: 0.9.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inheritance_calculator_core-0.9.0.tar.gz.
File metadata
- Download URL: inheritance_calculator_core-0.9.0.tar.gz
- Upload date:
- Size: 111.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d8f6628b8aca59759e83cdbadf014477e17625a7d4e58cdde02f708eeefcc0
|
|
| MD5 |
05b20f049844f4f41dd71b85b7e69afd
|
|
| BLAKE2b-256 |
05b24fbe14e6c20744e2323eb2e90c7e2fb9268b574337c817b051c423d38c2e
|
File details
Details for the file inheritance_calculator_core-0.9.0-py3-none-any.whl.
File metadata
- Download URL: inheritance_calculator_core-0.9.0-py3-none-any.whl
- Upload date:
- Size: 56.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26d2b72c559c873164e362935f89d834da63688037714add88ba2a769f0a3a51
|
|
| MD5 |
6679985a0014d5eefcb089016f346c59
|
|
| BLAKE2b-256 |
43e7ea3a5239c662a764344fef1cc7455eca8988736d1ee7e6f76f665dc94e59
|