Skip to content

Instantly share code, notes, and snippets.

@ShabbirHasan1
Created May 5, 2025 16:09
Show Gist options
  • Save ShabbirHasan1/71eea3c123ffd8da31af12f13c296ad1 to your computer and use it in GitHub Desktop.
Save ShabbirHasan1/71eea3c123ffd8da31af12f13c296ad1 to your computer and use it in GitHub Desktop.
NseIndiaEventCalender
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"id": "NryMNpix-lQO"
},
"outputs": [],
"source": [
"!pip install -U --quiet curl_cffi\n",
"import curl_cffi, polars as pl; from io import StringIO"
]
},
{
"cell_type": "code",
"source": [
"NSE_BASE_URL = \"https://www.nseindia.com\"\n",
"GET_NSE_APP_ID = f\"{NSE_BASE_URL}/market-data/new-stock-exchange-listings-forthcoming\"\n",
"EVENTS_URL = f\"{NSE_BASE_URL}/api/event-calendar\""
],
"metadata": {
"id": "4Oh8FiI8KqK4"
},
"execution_count": 2,
"outputs": []
},
{
"cell_type": "code",
"source": [
"client = curl_cffi.Session()\n",
"client.get(NSE_BASE_URL), client.get(GET_NSE_APP_ID)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "86X6rG3G_KO8",
"outputId": "fcd28cde-c176-46e7-8a12-e5e04f82311a"
},
"execution_count": 3,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"(<Response [200]>, <Response [200]>)"
]
},
"metadata": {},
"execution_count": 3
}
]
},
{
"cell_type": "code",
"source": [
"all_eq, all_fno = client.get(EVENTS_URL, impersonate=\"chrome\"), client.get(EVENTS_URL, params={\"index\":\"equities\", \"fo_sec\": True})"
],
"metadata": {
"id": "RJwznSZj_khy"
},
"execution_count": 4,
"outputs": []
},
{
"cell_type": "markdown",
"source": [],
"metadata": {
"id": "pI8QKE-2ARFn"
}
},
{
"cell_type": "markdown",
"source": [],
"metadata": {
"id": "M_nuMbNC_KBM"
}
},
{
"cell_type": "code",
"source": [
"all_upcoming_eq_events, all_upcoming_fno_events = pl.read_json(StringIO(all_eq.text)), pl.read_json(StringIO(all_fno.text))"
],
"metadata": {
"id": "Po0bMk76B11x"
},
"execution_count": 5,
"outputs": []
},
{
"cell_type": "code",
"source": [
"all_upcoming_eq_events"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 443
},
"id": "QhgFpXOOLheg",
"outputId": "b5f8b2b2-5441-4939-fc39-9a1c4ef4be8b"
},
"execution_count": 6,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"shape: (407, 5)\n",
"┌────────────┬─────────────────────────┬────────────────────────┬────────────────────┬─────────────┐\n",
"│ symbol ┆ company ┆ purpose ┆ bm_desc ┆ date │\n",
"│ --- ┆ --- ┆ --- ┆ --- ┆ --- │\n",
"│ str ┆ str ┆ str ┆ str ┆ str │\n",
"╞════════════╪═════════════════════════╪════════════════════════╪════════════════════╪═════════════╡\n",
"│ AADHARHFC ┆ Aadhar Housing Finance ┆ Financial Results/Fund ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ Limited ┆ Raising ┆ approve the fi… ┆ │\n",
"│ AARTIDRUGS ┆ Aarti Drugs Limited ┆ Financial Results ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ ┆ ┆ approve the fi… ┆ │\n",
"│ ADOR ┆ Ador Welding Limited ┆ Financial ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ ┆ Results/Other busine… ┆ approve the fi… ┆ │\n",
"│ APLLTD ┆ Alembic Pharmaceuticals ┆ Financial ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ Limite… ┆ Results/Dividend ┆ approve the fi… ┆ │\n",
"│ APTUS ┆ Aptus Value Housing ┆ Financial ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ Finance In… ┆ Results/Dividend/Fun… ┆ approve the fi… ┆ │\n",
"│ … ┆ … ┆ … ┆ … ┆ … │\n",
"│ ARE&M ┆ Amara Raja Energy & ┆ Financial ┆ To consider and ┆ 29-May-2025 │\n",
"│ ┆ Mobility L… ┆ Results/Dividend ┆ approve the fi… ┆ │\n",
"│ ICRA ┆ ICRA Limited ┆ Financial ┆ To consider and ┆ 29-May-2025 │\n",
"│ ┆ ┆ Results/Dividend ┆ approve the fi… ┆ │\n",
"│ PGHL ┆ Procter & Gamble Health ┆ Financial ┆ To consider and ┆ 29-May-2025 │\n",
"│ ┆ Limite… ┆ Results/Dividend ┆ approve the au… ┆ │\n",
"│ RANEHOLDIN ┆ Rane Holdings Limited ┆ Financial Results ┆ RANE HOLDINGS LTD. ┆ 30-May-2025 │\n",
"│ ┆ ┆ ┆ has informe… ┆ │\n",
"│ SSDL ┆ Saraswati Saree Depot ┆ Financial Results ┆ To consider and ┆ 30-May-2025 │\n",
"│ ┆ Limited ┆ ┆ approve the fi… ┆ │\n",
"└────────────┴─────────────────────────┴────────────────────────┴────────────────────┴─────────────┘"
],
"text/html": [
"<div><style>\n",
".dataframe > thead > tr,\n",
".dataframe > tbody > tr {\n",
" text-align: right;\n",
" white-space: pre-wrap;\n",
"}\n",
"</style>\n",
"<small>shape: (407, 5)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>symbol</th><th>company</th><th>purpose</th><th>bm_desc</th><th>date</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;AADHARHFC&quot;</td><td>&quot;Aadhar Housing Finance Limited&quot;</td><td>&quot;Financial Results/Fund Raising&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&quot;AARTIDRUGS&quot;</td><td>&quot;Aarti Drugs Limited&quot;</td><td>&quot;Financial Results&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&quot;ADOR&quot;</td><td>&quot;Ador Welding Limited&quot;</td><td>&quot;Financial Results/Other busine…</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&quot;APLLTD&quot;</td><td>&quot;Alembic Pharmaceuticals Limite…</td><td>&quot;Financial Results/Dividend&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&quot;APTUS&quot;</td><td>&quot;Aptus Value Housing Finance In…</td><td>&quot;Financial Results/Dividend/Fun…</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;ARE&amp;M&quot;</td><td>&quot;Amara Raja Energy &amp; Mobility L…</td><td>&quot;Financial Results/Dividend&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;29-May-2025&quot;</td></tr><tr><td>&quot;ICRA&quot;</td><td>&quot;ICRA Limited&quot;</td><td>&quot;Financial Results/Dividend&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;29-May-2025&quot;</td></tr><tr><td>&quot;PGHL&quot;</td><td>&quot;Procter &amp; Gamble Health Limite…</td><td>&quot;Financial Results/Dividend&quot;</td><td>&quot;To consider and approve the au…</td><td>&quot;29-May-2025&quot;</td></tr><tr><td>&quot;RANEHOLDIN&quot;</td><td>&quot;Rane Holdings Limited&quot;</td><td>&quot;Financial Results&quot;</td><td>&quot;RANE HOLDINGS LTD. has informe…</td><td>&quot;30-May-2025&quot;</td></tr><tr><td>&quot;SSDL&quot;</td><td>&quot;Saraswati Saree Depot Limited&quot;</td><td>&quot;Financial Results&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;30-May-2025&quot;</td></tr></tbody></table></div>"
]
},
"metadata": {},
"execution_count": 6
}
]
},
{
"cell_type": "code",
"source": [
"all_upcoming_fno_events"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 443
},
"id": "2xnTG8QtLhFp",
"outputId": "9bf7afb0-af4d-49f7-ede0-3e51a723fe53"
},
"execution_count": 7,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"shape: (407, 5)\n",
"┌────────────┬─────────────────────────┬────────────────────────┬────────────────────┬─────────────┐\n",
"│ symbol ┆ company ┆ purpose ┆ bm_desc ┆ date │\n",
"│ --- ┆ --- ┆ --- ┆ --- ┆ --- │\n",
"│ str ┆ str ┆ str ┆ str ┆ str │\n",
"╞════════════╪═════════════════════════╪════════════════════════╪════════════════════╪═════════════╡\n",
"│ AADHARHFC ┆ Aadhar Housing Finance ┆ Financial Results/Fund ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ Limited ┆ Raising ┆ approve the fi… ┆ │\n",
"│ AARTIDRUGS ┆ Aarti Drugs Limited ┆ Financial Results ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ ┆ ┆ approve the fi… ┆ │\n",
"│ ADOR ┆ Ador Welding Limited ┆ Financial ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ ┆ Results/Other busine… ┆ approve the fi… ┆ │\n",
"│ APLLTD ┆ Alembic Pharmaceuticals ┆ Financial ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ Limite… ┆ Results/Dividend ┆ approve the fi… ┆ │\n",
"│ APTUS ┆ Aptus Value Housing ┆ Financial ┆ To consider and ┆ 06-May-2025 │\n",
"│ ┆ Finance In… ┆ Results/Dividend/Fun… ┆ approve the fi… ┆ │\n",
"│ … ┆ … ┆ … ┆ … ┆ … │\n",
"│ ARE&M ┆ Amara Raja Energy & ┆ Financial ┆ To consider and ┆ 29-May-2025 │\n",
"│ ┆ Mobility L… ┆ Results/Dividend ┆ approve the fi… ┆ │\n",
"│ ICRA ┆ ICRA Limited ┆ Financial ┆ To consider and ┆ 29-May-2025 │\n",
"│ ┆ ┆ Results/Dividend ┆ approve the fi… ┆ │\n",
"│ PGHL ┆ Procter & Gamble Health ┆ Financial ┆ To consider and ┆ 29-May-2025 │\n",
"│ ┆ Limite… ┆ Results/Dividend ┆ approve the au… ┆ │\n",
"│ RANEHOLDIN ┆ Rane Holdings Limited ┆ Financial Results ┆ RANE HOLDINGS LTD. ┆ 30-May-2025 │\n",
"│ ┆ ┆ ┆ has informe… ┆ │\n",
"│ SSDL ┆ Saraswati Saree Depot ┆ Financial Results ┆ To consider and ┆ 30-May-2025 │\n",
"│ ┆ Limited ┆ ┆ approve the fi… ┆ │\n",
"└────────────┴─────────────────────────┴────────────────────────┴────────────────────┴─────────────┘"
],
"text/html": [
"<div><style>\n",
".dataframe > thead > tr,\n",
".dataframe > tbody > tr {\n",
" text-align: right;\n",
" white-space: pre-wrap;\n",
"}\n",
"</style>\n",
"<small>shape: (407, 5)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>symbol</th><th>company</th><th>purpose</th><th>bm_desc</th><th>date</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;AADHARHFC&quot;</td><td>&quot;Aadhar Housing Finance Limited&quot;</td><td>&quot;Financial Results/Fund Raising&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&quot;AARTIDRUGS&quot;</td><td>&quot;Aarti Drugs Limited&quot;</td><td>&quot;Financial Results&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&quot;ADOR&quot;</td><td>&quot;Ador Welding Limited&quot;</td><td>&quot;Financial Results/Other busine…</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&quot;APLLTD&quot;</td><td>&quot;Alembic Pharmaceuticals Limite…</td><td>&quot;Financial Results/Dividend&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&quot;APTUS&quot;</td><td>&quot;Aptus Value Housing Finance In…</td><td>&quot;Financial Results/Dividend/Fun…</td><td>&quot;To consider and approve the fi…</td><td>&quot;06-May-2025&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;ARE&amp;M&quot;</td><td>&quot;Amara Raja Energy &amp; Mobility L…</td><td>&quot;Financial Results/Dividend&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;29-May-2025&quot;</td></tr><tr><td>&quot;ICRA&quot;</td><td>&quot;ICRA Limited&quot;</td><td>&quot;Financial Results/Dividend&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;29-May-2025&quot;</td></tr><tr><td>&quot;PGHL&quot;</td><td>&quot;Procter &amp; Gamble Health Limite…</td><td>&quot;Financial Results/Dividend&quot;</td><td>&quot;To consider and approve the au…</td><td>&quot;29-May-2025&quot;</td></tr><tr><td>&quot;RANEHOLDIN&quot;</td><td>&quot;Rane Holdings Limited&quot;</td><td>&quot;Financial Results&quot;</td><td>&quot;RANE HOLDINGS LTD. has informe…</td><td>&quot;30-May-2025&quot;</td></tr><tr><td>&quot;SSDL&quot;</td><td>&quot;Saraswati Saree Depot Limited&quot;</td><td>&quot;Financial Results&quot;</td><td>&quot;To consider and approve the fi…</td><td>&quot;30-May-2025&quot;</td></tr></tbody></table></div>"
]
},
"metadata": {},
"execution_count": 7
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment