Skip to main content

numin2 Package

numin2 is a Python package designed for algorithmic trading and backtesting providing an API called Numin2API.

numin (v1) is a different package!!

numin2 is under development; features available are documented below

Features

  • Data Retrieval: Download training, round, and validation data.
  • Prediction Submission: TBD
  • Real-Time Round Management: TBD
  • Backtesting: Backtesting cross-sectional predictions vs targets for Nifty50
  • File Management: TBD
  • Returns Summary: TBD

Supported Methods

  • Data Download:

    • Numin2API().get_data_for_month(self,year,month,batch_size=4,window_size=100,target_type='rank'):

    • Returns batches of sequences (lists) for the given year and month of Nifty 50 or n returns

    • Dimension of each sequence is window,n. Returns NuminDataset of shape batch_size,window_size,n for features. Default n=50. (Later n will be a parameter).

    • Targets are next day returns / ranked returns of shape batch_size,n

    • Numin2API().download_data(outfile,type='daily',features='returns')

    • Download data for a given type and features

    • type can be 'daily','intraday'

    • features can be 'returns' (close returns),'open_close' (open-close returns), or 'ohlcv'

    • outfile is the name of the parquet file to save the data

    • get_range_dataloader(data_path: str, start_year: int, start_month: int, end_year: int, end_month: int, batch_size: int = 32, window_size: int = 100, target_type: str = 'raw', top_k: int = 10)

    • Returns a torch dataloader for the given range of years and months of Nifty 50 or n returns

    • Dimension of each day is window,n. Returns tensor of shape batch_size,window_size,n for features. Default n=50. (Later n will be a parameter).

    • Targets are next day returns / ranked returns of shape batch_size,n

    • get_dataloader(data_path: str, batch_size: int = 32, window_size: int = 100, target_type: str = 'raw', top_k: int = 10)

    • Returns a torch dataloader for the given range of years and months of Nifty 50 or n returns

    • Dimension of each day is window,n. Returns tensor of shape batch_size,window_size,n for features. Default n=50. (Later n will be a parameter).

    • Targets are next day returns / ranked returns of shape batch_size,n

    • Numin2API()fetch_intraday_raw_data(delta=50,features='returns')

    • fetches current intraday data given delta time in minutes before current time

    • returns dataframe that can be appended to the consolidated data file or used in memory

    • features can be returns or ohlcv

  • Backytesting

    • backtest_positions(positions,targets,txn_costs=.9)
    • backtest_positions(positions,targets,txn_costs=.1)
    • Takes a batch of positions for 50 stocks
    • Each position is a list of length 51, 0 position for cash, rest interpreted as weight with which capital is allocated. So 1 0 0 0 .. means no positions all cash. Sum must be non-zero.
    • Targets are returns (real numbers) for each of these stocks ove the batch.
    • Returns a dict such as {'daily_pnl','total_profit','sharpe_ratio,'mean_daily_return'}
  • News Data

    • get_news(datestr), get_all_news_dates()
    • Unstructured news data is available for historical and current dates; datestr in the format 10-03-2026 to be passed

Installation

Install numin2 using pip:

pip install numin2

Metadata

Release files for numin2 1.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numin2 1.0.11
File Size Uploaded Provenance Actions
numin2-1.0.11.tar.gz 14.3 kB Without provenance Details for numin2-1.0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for numin2 1.0.11
File Interpreter ABI Platform Actions
numin2-1.0.11-py3-none-any.whl Python 3 none any Details for numin2-1.0.11-py3-none-any.whl

Total release size: 28.5 kB

Release files / numin2-1.0.11.tar.gz

Download URL numin2-1.0.11.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c242912e8f8aaac039bd52bb22ea03c7b5397c0d1462e97d824cd89bb16b7bbb
BLAKE2b-256 checksum
How to use checksums
8e243475cbe93166d58b0f20a3d4dada4780f417924bd9068aa7293fed2ccf1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Release files / numin2-1.0.11-py3-none-any.whl

Download URL numin2-1.0.11-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6351644669f72e64d9e6651f39deda6cff06ad470c19e598b017b7358c4908c
BLAKE2b-256 checksum
How to use checksums
ba04b91fa91722a8ae76f1568164e31e8d5982e101b956cdd5d6ad27a1a54e76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Security for numin2 1.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page