Skip to main content

A Python module for accessing and managing Constitution data.

Project description

IndianConstitution (v0.5.6.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


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:

Configuration Requirement

Ensure you load the Constitution data file correctly. By default, the file is included in the package directory. If not, you must provide the full path to the constitution_of_india.json file.

Example:

from indianconstitution import IndianConstitution

# Load the module with the correct path to the JSON file
india = IndianConstitution("D:\\indianconstitution\\indianconstitution\\indianconstitution\\constitution_of_india.json")

# Example usage
print(india.preamble())

Python Module Example

from indianconstitution import IndianConstitution

# Load the module with your Constitution data
india = IndianConstitution('constitution_data.json')

# 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.5.7.tar.gz (5.6 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.5.7-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for indianconstitution-0.5.7.tar.gz
Algorithm Hash digest
SHA256 c61d061c7590474aa287e4a511a925fdc4fa034fcda965fd7677796c823b7554
MD5 48b3db1ab9fc6f078511997ba99ca969
BLAKE2b-256 990e078f54eb6169392c3fa3853d7371dcf9f0b7148bf32fb1809f39c59bbef9

See more details on using hashes here.

File details

Details for the file IndianConstitution-0.5.7-py3-none-any.whl.

File metadata

File hashes

Hashes for IndianConstitution-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 85b79b44bf3bfc95674b6fcf4c3e937289f04ed04b93b43c3f0fda06e2c282ee
MD5 86de3bd55e2acafa34a02eabd275d201
BLAKE2b-256 ecfaf44bb611ec4503942404ef91d8ef59a5649115a2e8e23f5d6659ba69f321

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