https://github.com/vikhram-s/indianconstitution
A Python library for exploring the Constitution of India.
https://github.com/vikhram-s/indianconstitution
indian-constitution python3 textprocessing
Last synced: 2 months ago
JSON representation
A Python library for exploring the Constitution of India.
- Host: GitHub
- URL: https://github.com/vikhram-s/indianconstitution
- Owner: Vikhram-S
- License: apache-2.0
- Created: 2025-01-15T08:13:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-03T15:26:35.000Z (12 months ago)
- Last Synced: 2025-04-30T23:47:12.666Z (10 months ago)
- Topics: indian-constitution, python3, textprocessing
- Language: Jupyter Notebook
- Homepage: https://pypi.org/project/IndianConstitution/
- Size: 195 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IndianConstitution (v0.6.0)
Python module to interact with the Constitution of India data and retrieve articles, details, summaries, and search functionalities.
    


---
## Installation
You can install the package directly from PyPI:
```bash
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:**
```python
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
```python
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](mailto:vikhrams@saveetha.ac.in)
---
## Copyright
© 2025 Vikhram S. All rights reserved.