nsepython 2.99__tar.gz → 2.100__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nsepython
3
- Version: 2.99
3
+ Version: 2.100
4
4
  Summary: Python library for NSE India APIs
5
5
  Home-page: https://github.com/aeron7/nsepython
6
6
  Author: Aeron7
@@ -1773,6 +1773,39 @@ def share_holding(symbol):
1773
1773
  return df
1774
1774
 
1775
1775
 
1776
+ def nse_annual_reports(symbol, year_from=None, year_to=None, index="equities"):
1777
+ """Forum feature request (forum.unofficed.com topic 1459): list a listed
1778
+ company's annual reports with direct PDF download links, optionally
1779
+ filtered to a from/to year range. Backed by
1780
+ `/api/annual-reports?index=equities&symbol=X`, confirmed live via
1781
+ curl_cffi -- NOT the Akamai-walled historical/* family, just a plain
1782
+ metadata+link listing, so this is reliable. `index` is almost always
1783
+ "equities" (NSE also recognises "debt", but that returns no rows for a
1784
+ pure-equity symbol like most NSE-listed companies). Each returned row's
1785
+ `fileName` column IS the direct downloadable PDF/zip URL on
1786
+ nsearchives.nseindia.com -- fetch it yourself (e.g. with `requests` or
1787
+ `curl`) if you want the actual file; this function returns the metadata
1788
+ + link, matching how every other *_history-style function in this
1789
+ library works, rather than silently downloading files to disk.
1790
+ `year_from`/`year_to` filter client-side on the report's `fromYr` (NSE's
1791
+ own API has no year-range parameter, it always returns the full
1792
+ available history -- commonly 15-20+ years for large-cap companies)."""
1793
+ symbol = nsesymbolpurify(symbol)
1794
+ payload = nsefetch(f"https://www.nseindia.com/api/annual-reports?index={index}&symbol={symbol}")
1795
+ rows = payload.get("data") or []
1796
+ df = pd.DataFrame.from_records(rows)
1797
+ if df.empty:
1798
+ return df
1799
+ if year_from is not None or year_to is not None:
1800
+ years = pd.to_numeric(df["fromYr"], errors="coerce")
1801
+ if year_from is not None:
1802
+ df = df[years >= int(year_from)]
1803
+ years = years[df.index]
1804
+ if year_to is not None:
1805
+ df = df[years <= int(year_to)]
1806
+ return df.reset_index(drop=True)
1807
+
1808
+
1776
1809
  #Request from subhash
1777
1810
  ## https://unofficed.com/how-to-find-the-beta-of-indian-stocks-using-python/
1778
1811
  def get_beta_df_maker(symbol,days):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nsepython
3
- Version: 2.99
3
+ Version: 2.100
4
4
  Summary: Python library for NSE India APIs
5
5
  Home-page: https://github.com/aeron7/nsepython
6
6
  Author: Aeron7
File without changes
File without changes
File without changes
File without changes