Skip to main content

A Python wrapper for the Novig API with built-in filtering and liquidity validation.

Project description

Novig Liquidity

A Python wrapper around the Novig API with built-in filtering and validation.
This package helps you fetch sports market data and filter it based on liquidity and stat types.

Installation

pip install novig-liquidity

Requirements

Dependencies are listed in requirements.txt and are installed automatically. Core ones include:

  • aiohttp
  • redis
  • pydantic
  • requests

Usage

Create a filters.json file defining which stat types you care about. Example:

{
  "WNBA": [
    {
      "raw_name": "points_rebounds_assists",
      "display_name": "Points, Rebounds, and Assists",
      "active": true
    },
    {
      "raw_name": "points",
      "display_name": "Points",
      "active": true
    },
    {
      "raw_name": "rebounds_assists",
      "display_name": "Rebounds and Assists",
      "active": true
    },
    {
      "raw_name": "points_assists",
      "display_name": "Points and Assists",
      "active": true
    },
    {
      "raw_name": "points_rebounds",
      "display_name": "Points and Rebounds",
      "active": true
    },
    {
      "raw_name": "three_pointers_made",
      "display_name": "Three Pointers Made",
      "active": true
    },
    {
      "raw_name": "double_double",
      "display_name": "Double-Double",
      "active": true
    }
  ],
  "NFL": [
    {
      "raw_name": "rushing_yards",
      "display_name": "Rushing Yards",
      "active": true
    },
    {
      "raw_name": "rushing_attempts",
      "display_name": "Rushing Attempts",
      "active": true
    },
    {
      "raw_name": "longest_rush",
      "display_name": "Longest Rush",
      "active": true
    },
    {
      "raw_name": "passing_yards",
      "display_name": "Passing Yards",
      "active": true
    },
    {
      "raw_name": "receiving_yards",
      "display_name": "Receiving Yards",
      "active": true
    },
    {
      "raw_name": "receptions",
      "display_name": "Receptions",
      "active": true
    },
    {
      "raw_name": "longest_reception",
      "display_name": "Longest Receptions",
      "active": true
    },
    {
      "raw_name": "passing_completions",
      "display_name": "Passing Completions",
      "active": true
    }
  ]
}

Example script

import asyncio
import json
from Config import Novig

if __name__ == "__main__":
    # Load filters from file
    with open("filters.json", "r") as f:
        filters = json.load(f)

    # Choose your filter type and amounts
    total_and_difference_filter = {
        "filter_type": "liquidity_difference_and_highest_order",
        "difference_amount": 3000,
        "highest_order_amount": 1500
    }
    
    # OR
    
    total_difference_filter = {
        "filter_type": "liquidity_difference",
        "difference_amount": 3000,
    }

    # Create Novig instance
    novig = Novig(filters=filters, filter_amount_dict=total_and_difference_filter)

    # Run it
    results = asyncio.run(novig.run())
    print(results)
if __name__ == "__main__":
   raw = asyncio.run(Novig.get_raw_data(["NFL"]))
   import json
   with open("raw.json", "w") as f:
        json.dump(raw, f, indent=4)

Filter Types

Two filter types are currently supported:

  1. liquidity_difference
    Keeps markets where the liquidity difference between over/under is at least difference_amount.

  2. liquidity_difference_and_highest_order
    Keeps markets where:

    • Liquidity difference ≥ difference_amount, and
    • Either over/under side has a highest order with liquidity_lefthighest_order_amount.

Output

novig.run() returns a dict keyed by league name (e.g., "WNBA", "NFL"), each with a list of filtered market entries. Each entry includes:

  • key_name (market description)
  • liquidity (grouped by over/under, includes highest_order, totals, etc.)
  • additional_data (player name, stat type, line, game title, start time)

Features

  • Async API calls via aiohttp
  • Filtering on liquidity differences and totals
  • Stat-type validation via your filters.json
  • Clean models (Pydantic + dataclasses where applicable)

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

novig_liquidity-1.0.14.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

novig_liquidity-1.0.14-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file novig_liquidity-1.0.14.tar.gz.

File metadata

  • Download URL: novig_liquidity-1.0.14.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for novig_liquidity-1.0.14.tar.gz
Algorithm Hash digest
SHA256 d39d829850f5dde7e43cf64eec67b8419fac0b34ae0980a29480f1021835323c
MD5 b74be4c2e3abaf9882455def1af55850
BLAKE2b-256 e9146bb47e5374f8e2952133bab806f7561bd633691c53063020c66d43cacac9

See more details on using hashes here.

File details

Details for the file novig_liquidity-1.0.14-py3-none-any.whl.

File metadata

File hashes

Hashes for novig_liquidity-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 87c6ae4f920343e06dfb0ded400cd467e80227f8d4d16ca9442e271f20747b14
MD5 a779e6b102d12b02a9c1a2d12403960c
BLAKE2b-256 cfc0c1bb2f7ef985d2c7f72d5531c4bdd46c04e0e15e042aa342a52007052f79

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