Repository navigation
Home
Vikhram S edited this page Sep 2, 2026
·
2 revisions
This Wiki covers setup and fundamental concepts of the indianconstitution library.
- Python: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
-
Dependencies:
pydantic >= 2.0,typer >= 0.9,rich >= 13.0
Minimal installation with zero external data-science heavy dependencies:
pip install indianconstitutionIncludes pandas, networkx, and scipy for graph analysis and tabular workflows:
pip install "indianconstitution[data]"Includes sentence-transformers and torch for vector embeddings:
pip install "indianconstitution[ai]"from indianconstitution import get_article, get_constitution
# Fetch single article
art = get_article("14")
print(art.title) # Equality before law
print(art.content) # Full article text
print(art.part) # 3 (Part III - Fundamental Rights)
# Access full Constitution instance
ic = get_constitution()
print(f"Total articles loaded: {len(ic)}")
print(f"Preamble: {ic.preamble[:150]}...")from indianconstitution import search
# Sub-millisecond inverted-index search
matches = search("freedom of speech", limit=5)
for m in matches:
print(f"Art. {m.number}: {m.title}")from indianconstitution import get_constitution
ic = get_constitution()
ic.export("json", "constitution.json")
ic.export("csv", "constitution.csv")
ic.export("markdown", "constitution.md")