Skip to main content

A Python module for accessing and managing Constitution data.

Project description

IndianConstitution (v0.7)

Python module to interact with the Constitution of India data and retrieve articles, details, summaries, and search functionalities.

PyPI - Python Version PyPI - License Maintenance PyPI PyPI - Status PyPI - Downloads Total Downloads SemVer


Installation

You can install the package directly from PyPI:

pip install indianconstitution

Features

The indianconstitution module provides:

  • Full access to the Constitution of India data.
  • Retrieval of individual articles and summaries.
  • Keyword-based search for articles.
  • Count of total articles and search by title functionality.

Usage

Here is how to get started with indianconstitution:

Example:

from indianconstitution import IndianConstitution

# Load the module with the correct path to the JSON file
india = IndianConstitution()

# Example usage
print(india.preamble())

Python Module Example

from indianconstitution import IndianConstitution

# Load the module with your Constitution data
india = IndianConstitution()

# Access the Preamble
print(india.preamble())

# Retrieve specific articles
print(india.get_article(14))  # Outputs details of Article 14

# List all articles
print(india.articles_list())

# Search for a keyword in the Constitution
print(india.search_keyword('equality'))

# Get a summary of an article
print(india.article_summary(21))

# Count the total number of articles
print(india.count_articles())

# Search articles by title
print(india.search_by_title('Fundamental'))

Key Functionalities

Function Description
preamble() Returns the Preamble of the Constitution of India.
get_article(number) Retrieves the full content of the specified article.
articles_list() Lists all articles in the Constitution with titles.
search_keyword(word) Finds all occurrences of a specific keyword in the Constitution text.
article_summary(num) Returns a summary of the specified article.
count_articles() Counts the total number of articles in the Constitution.
search_by_title(title) Searches articles by their titles and returns matching results.

Development

This project is actively maintained. Contributions, suggestions, and feedback are welcome. Please refer to the LICENSE file for usage terms.


License

This project is licensed under the Apache License 2.0. See the LICENSE file for more details.


Data Source

The Constitution data is compiled from publicly available resources, ensuring authenticity and accuracy.


Developer Information

Author: Vikhram S
Email: vikhrams@saveetha.ac.in


Copyright

© 2025 Vikhram S. All rights reserved.

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

indianconstitution-0.7.tar.gz (109.4 kB view details)

Uploaded Source

Built Distribution

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

indianconstitution-0.7-py3-none-any.whl (110.2 kB view details)

Uploaded Python 3

File details

Details for the file indianconstitution-0.7.tar.gz.

File metadata

  • Download URL: indianconstitution-0.7.tar.gz
  • Upload date:
  • Size: 109.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for indianconstitution-0.7.tar.gz
Algorithm Hash digest
SHA256 54881db470ed28b5e4c9508f1bd0396a7f873ed63b8a3daec14868f296b2ff27
MD5 c19eca09482dc5b7972f20751ffedd8e
BLAKE2b-256 f5a287c08aa9d1a376c32668809183e807249eb90991d419b43a42e970621b2a

See more details on using hashes here.

File details

Details for the file indianconstitution-0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for indianconstitution-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d8ba5ac2d85437743b80ccc632f31f846c33ed27cc946d74fc1cb131b2afbd37
MD5 c41484dbcc7dfb61a3a486bcac0a7c24
BLAKE2b-256 6a5f57c08af9eadb40a804c90f4789fb39ea3559e79d46c97ccbe2f4df73e77a

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