Skip to main content

JEE Mains PYQS data base

Project description

JEE Mains PYQS Database

This project provides a structured database of more than 14,000 previous year questions (PYQS) from JEE Mains. The questions are reverse engineered from API endpoints of a subscription site and cached for efficient use. It supports clustering, filtering, and rendering of questions into HTML for easy study.

Features

  • Access to 14k+ JEE Mains PYQS
  • Precomputed embeddings using the intfloat/e5-base-v2 model for efficient clustering
  • Cluster similar questions together based on semantic embeddings
  • Apply chainable filters (by chapter, topic, year, etc.)
  • Render filtered or clustered questions into HTML using themed styles

Project Structure

The core folder contains the following modules:

  • cache.py – Defines the Cache class for creating and loading internal caches. Not intended for direct user interaction.
  • chapter.py – Defines the Chapter class, which is stored in the DataBaseChapters cache file. Internal use only.
  • data_base.py – Defines the DataBase class. This must be initialized before any operations.
  • filter.py – Defines the Filter class. Provides chainable methods to filter questions and update the current set.
  • question.py – Defines the Question object.
  • styles.py – Contains themed HTML styles for rendering.
  • pdfy.py – Provides functions to convert clusters or sets of questions into HTML.

Installation

Clone the repository:

git clone https://github.com/HostServer001/jee_mains_pyqs_data_base

Navigate into the project directory and ensure dependencies are installed.

Usage

Basic Initialization

import os
from core import DataBase, Filter, pdfy

data_base_path = "path_to_data"
cache_path = f"{data_base_path}/cache"

# Initialize database
db = DataBase(data_base_path, cache_path)

# Initialize filter
filter = Filter(db.chapters_dict)

# Inspect available chapters
print(filter.get_possible_filter_values()["chapter"])

Filtering by Chapter and Year

# Get all questions from a specific chapter in the last 3 years
questions = filter.by_chapter("thermodynamics").by_n_last_yrs(3).get()

for q in questions:
    print(q.question)

Clustering and Rendering

# Cluster questions by topic and render to HTML
filter.current_set = filter.by_chapter("organic-compounds").by_n_last_yrs(5).get()
cluster = filter.cluster()

pdfy.render_cluster_to_html(
    cluster,
    "organic_compounds.html",
    "Organic Compounds - Last 5 Years"
)

Example: Render Chapter Questions by Topic

def render_chapter(chapter_name: str):
    all_q = filter.by_chapter(chapter_name).by_n_last_yrs(5).get()
    os.makedirs(chapter_name, exist_ok=True)

    for topic in filter.get_possible_filter_values()["topic"]:
        filter.current_set = all_q
        filter.by_topic(topic)
        cluster = filter.cluster()
        pdfy.render_cluster_to_html_skim(
            cluster,
            f"{chapter_name}/{topic}.html",
            topic
        )

render_chapter("alcohols-phenols-and-ethers")

Data Caches

  • DataBaseChapters – Contains a dictionary with chapter names as keys and Chapter objects as values.
  • EmbeddingsChapters – Contains precomputed embeddings of all questions to save computation time.

Contributing

Contributions are welcome. You can help by:

  • Improving documentation
  • Adding new filters or clustering strategies
  • Enhancing rendering styles
  • Reporting issues and suggesting features

Fork the repository, create a new branch for your changes, and submit a pull request.

License

This project is provided for educational purposes. Please review the repository for licensing details.

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

jee_data_base-0.1.2.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

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

jee_data_base-0.1.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file jee_data_base-0.1.2.tar.gz.

File metadata

  • Download URL: jee_data_base-0.1.2.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for jee_data_base-0.1.2.tar.gz
Algorithm Hash digest
SHA256 38a244f344693426b88fbfbf41c8def158f571f8156b6989f38899bf2702f44b
MD5 3fdbda0ca36c2da78c10b906cdd0425e
BLAKE2b-256 e4ed4a3f178f4cd8c295a981b1d5881338999e79da48232261d7ece48982dbd6

See more details on using hashes here.

File details

Details for the file jee_data_base-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: jee_data_base-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for jee_data_base-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18e4f7ee6be1820511fcb0fa0b6518299780611fd428bef457c81e7e0a54ee53
MD5 c1efb6e6e777c60531201ea6aaad4dd3
BLAKE2b-256 fb9985ede4d6cd73abc4c2471eb0bac24ae0c633377a8ba3a9c09ad12d84e4f5

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