diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 313c2716..f0767d70 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,7 +7,7 @@ on: branches: - master schedule: - - cron: '33 12 * * 3' + - cron: "33 12 * * 3" jobs: analyze: name: analyze @@ -19,15 +19,15 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'python' ] + language: ["python"] steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/examples/rest/economy-treasury_yields.py b/examples/rest/economy-treasury_yields.py new file mode 100644 index 00000000..011b1866 --- /dev/null +++ b/examples/rest/economy-treasury_yields.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/rest/economy/treasury-yields + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +yields = [] +for date in client.vx.list_treasury_yields(): + yields.append(date) + +print(yields) diff --git a/examples/rest/stocks-ipos.py b/examples/rest/stocks-ipos.py index 54852335..cc09f61b 100644 --- a/examples/rest/stocks-ipos.py +++ b/examples/rest/stocks-ipos.py @@ -1,7 +1,7 @@ from polygon import RESTClient # docs -# https://polygon.io/docs/stocks/get_vx_reference_ipos +# https://polygon.io/docs/rest/stocks/corporate-actions/ipos # client = RESTClient("XXXXXX") # hardcoded api_key is used client = RESTClient() # POLYGON_API_KEY environment variable is used diff --git a/examples/rest/stocks-short_interest.py b/examples/rest/stocks-short_interest.py new file mode 100644 index 00000000..3b64cd2a --- /dev/null +++ b/examples/rest/stocks-short_interest.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/rest/stocks/fundamentals/short-interest + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +items = [] +for item in client.vx.list_short_interest(ticker="RDDT"): + items.append(item) + +print(items) diff --git a/examples/rest/stocks-short_volume.py b/examples/rest/stocks-short_volume.py new file mode 100644 index 00000000..711bfd47 --- /dev/null +++ b/examples/rest/stocks-short_volume.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/rest/stocks/fundamentals/short-volume + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +items = [] +for item in client.vx.list_short_volume(ticker="RDDT"): + items.append(item) + +print(items) diff --git a/poetry.lock b/poetry.lock index 3709112e..8a686894 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. [[package]] name = "alabaster" @@ -6,6 +6,7 @@ version = "0.7.12" description = "A configurable sidebar-enabled Sphinx theme" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "alabaster-0.7.12-py2.py3-none-any.whl", hash = "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359"}, {file = "alabaster-0.7.12.tar.gz", hash = "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"}, @@ -17,16 +18,17 @@ version = "22.1.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "attrs-22.1.0-py2.py3-none-any.whl", hash = "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"}, {file = "attrs-22.1.0.tar.gz", hash = "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"}, ] [package.extras] -dev = ["cloudpickle", "coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy (>=0.900,!=0.940)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "sphinx", "sphinx-notfound-page", "zope.interface"] +dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy (>=0.900,!=0.940)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "sphinx", "sphinx-notfound-page", "zope.interface"] docs = ["furo", "sphinx", "sphinx-notfound-page", "zope.interface"] -tests = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "zope.interface"] -tests-no-zope = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins"] +tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "zope.interface"] +tests-no-zope = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins"] [[package]] name = "Babel" @@ -34,6 +36,7 @@ version = "2.11.0" description = "Internationalization utilities" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "Babel-2.11.0-py3-none-any.whl", hash = "sha256:1ad3eca1c885218f6dce2ab67291178944f810a10a9b5f3cb8382a5a232b64fe"}, {file = "Babel-2.11.0.tar.gz", hash = "sha256:5ef4b3226b0180dedded4229651c8b0e1a3a6a2837d45a073272f313e4cf97f6"}, @@ -48,6 +51,7 @@ version = "24.8.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "black-24.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6"}, {file = "black-24.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb"}, @@ -84,7 +88,7 @@ typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] +d = ["aiohttp (>=3.7.4) ; sys_platform != \"win32\" or implementation_name != \"pypy\"", "aiohttp (>=3.7.4,!=3.9.0) ; sys_platform == \"win32\" and implementation_name == \"pypy\""] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] @@ -94,6 +98,7 @@ version = "2025.1.31" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main", "dev"] files = [ {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, @@ -105,6 +110,7 @@ version = "2.1.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.6.0" +groups = ["dev"] files = [ {file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"}, {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, @@ -119,6 +125,7 @@ version = "8.1.3" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, @@ -133,6 +140,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\" or platform_system == \"Windows\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -144,6 +153,7 @@ version = "0.18.1" description = "Docutils -- Python Documentation Utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +groups = ["dev"] files = [ {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, @@ -155,6 +165,7 @@ version = "2.1.3" description = "URL manipulation made simple." optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "furl-2.1.3-py2.py3-none-any.whl", hash = "sha256:9ab425062c4217f9802508e45feb4a83e54324273ac4b202f1850363309666c0"}, {file = "furl-2.1.3.tar.gz", hash = "sha256:5a6188fe2666c484a12159c18be97a1977a71d632ef5bb867ef15f54af39cc4e"}, @@ -170,6 +181,7 @@ version = "3.7" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, @@ -181,6 +193,7 @@ version = "1.4.1" description = "Getting image size from png/jpeg/jpeg2000/gif file" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +groups = ["dev"] files = [ {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, @@ -192,6 +205,8 @@ version = "5.1.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.10\"" files = [ {file = "importlib_metadata-5.1.0-py3-none-any.whl", hash = "sha256:d84d17e21670ec07990e1044a99efe8d615d860fd176fc29ef5c306068fda313"}, {file = "importlib_metadata-5.1.0.tar.gz", hash = "sha256:d5059f9f1e8e41f80e9c56c2ee58811450c31984dfa625329ffd7c0dad88a73b"}, @@ -203,7 +218,7 @@ zipp = ">=0.5" [package.extras] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] perf = ["ipython"] -testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] +testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3) ; python_version < \"3.9\"", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8 ; python_version < \"3.12\"", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\"", "pytest-perf (>=0.9.2)"] [[package]] name = "importlib-resources" @@ -211,6 +226,8 @@ version = "5.10.0" description = "Read resources from Python packages" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.9\"" files = [ {file = "importlib_resources-5.10.0-py3-none-any.whl", hash = "sha256:ee17ec648f85480d523596ce49eae8ead87d5631ae1551f913c0100b5edd3437"}, {file = "importlib_resources-5.10.0.tar.gz", hash = "sha256:c01b1b94210d9849f286b86bb51bcea7cd56dde0600d8db721d7b81330711668"}, @@ -221,17 +238,18 @@ zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} [package.extras] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] -testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] +testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\""] [[package]] name = "jinja2" -version = "3.1.5" +version = "3.1.6" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ - {file = "jinja2-3.1.5-py3-none-any.whl", hash = "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb"}, - {file = "jinja2-3.1.5.tar.gz", hash = "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb"}, + {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, + {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"}, ] [package.dependencies] @@ -246,6 +264,7 @@ version = "4.17.1" description = "An implementation of JSON Schema validation for Python" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "jsonschema-4.17.1-py3-none-any.whl", hash = "sha256:410ef23dcdbca4eaedc08b850079179883c2ed09378bd1f760d4af4aacfa28d7"}, {file = "jsonschema-4.17.1.tar.gz", hash = "sha256:05b2d22c83640cde0b7e0aa329ca7754fbd98ea66ad8ae24aa61328dfe057fa3"}, @@ -267,6 +286,7 @@ version = "2.1.1" description = "Safely add untrusted strings to HTML/XML markup." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812"}, {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a"}, @@ -316,6 +336,7 @@ version = "1.13.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, @@ -369,6 +390,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -380,6 +402,7 @@ version = "1.0.1" description = "Ordered Multivalue Dictionary" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "orderedmultidict-1.0.1-py2.py3-none-any.whl", hash = "sha256:43c839a17ee3cdd62234c47deca1a8508a3f2ca1d0678a3bf791c87cf84adbf3"}, {file = "orderedmultidict-1.0.1.tar.gz", hash = "sha256:04070bbb5e87291cc9bfa51df413677faf2141c73c61d2a5f7b26bea3cd882ad"}, @@ -394,6 +417,7 @@ version = "3.10.15" description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "orjson-3.10.15-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:552c883d03ad185f720d0c09583ebde257e41b9521b74ff40e08b7dec4559c04"}, {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:616e3e8d438d02e4854f70bfdc03a6bcdb697358dbaa6bcd19cbe24d24ece1f8"}, @@ -482,6 +506,7 @@ version = "23.1" description = "Core utilities for Python packages" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, @@ -493,6 +518,7 @@ version = "0.10.2" description = "Utility library for gitignore style pattern matching of file paths." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pathspec-0.10.2-py3-none-any.whl", hash = "sha256:88c2606f2c1e818b978540f73ecc908e13999c6c3a383daf3705652ae79807a5"}, {file = "pathspec-0.10.2.tar.gz", hash = "sha256:8f6bf73e5758fd365ef5d58ce09ac7c27d2833a8d7da51712eac6e27e35141b0"}, @@ -504,6 +530,8 @@ version = "1.3.10" description = "Resolve a name to an object." optional = false python-versions = ">=3.6" +groups = ["dev"] +markers = "python_version < \"3.9\"" files = [ {file = "pkgutil_resolve_name-1.3.10-py3-none-any.whl", hash = "sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e"}, {file = "pkgutil_resolve_name-1.3.10.tar.gz", hash = "sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174"}, @@ -515,6 +543,7 @@ version = "2.5.4" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "platformdirs-2.5.4-py3-none-any.whl", hash = "sha256:af0276409f9a02373d540bf8480021a048711d572745aef4b7842dad245eba10"}, {file = "platformdirs-2.5.4.tar.gz", hash = "sha256:1006647646d80f16130f052404c6b901e80ee4ed6bef6792e1f238a8969106f7"}, @@ -530,6 +559,7 @@ version = "2.0.1" description = "HTTP traffic mocking and expectations made easy" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pook-2.0.1-py3-none-any.whl", hash = "sha256:30d73c95e0520f45c1e3889f3bf486e990b6f04b4915aa9daf86cf0d8136b2e1"}, {file = "pook-2.0.1.tar.gz", hash = "sha256:e04c0e698f256438b4dfbf3ab1b27559f0ec25e42176823167f321f4e8b9c9e4"}, @@ -546,13 +576,14 @@ version = "2.15.0" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "Pygments-2.15.0-py3-none-any.whl", hash = "sha256:77a3299119af881904cd5ecd1ac6a66214b6e9bed1f2db16993b54adede64094"}, {file = "Pygments-2.15.0.tar.gz", hash = "sha256:f7e36cffc4c517fbc252861b9a6e4644ca0e5abadf9a113c72d1358ad09b9500"}, ] [package.extras] -plugins = ["importlib-metadata"] +plugins = ["importlib-metadata ; python_version < \"3.8\""] [[package]] name = "pyrsistent" @@ -560,6 +591,7 @@ version = "0.19.2" description = "Persistent/Functional/Immutable data structures" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pyrsistent-0.19.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d6982b5a0237e1b7d876b60265564648a69b14017f3b5f908c5be2de3f9abb7a"}, {file = "pyrsistent-0.19.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:187d5730b0507d9285a96fca9716310d572e5464cadd19f22b63a6976254d77a"}, @@ -591,6 +623,7 @@ version = "2022.6" description = "World timezone definitions, modern and historical" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "pytz-2022.6-py2.py3-none-any.whl", hash = "sha256:222439474e9c98fced559f1709d89e6c9cbf8d79c794ff3eb9f8800064291427"}, {file = "pytz-2022.6.tar.gz", hash = "sha256:e89512406b793ca39f5971bc999cc538ce125c0e51c27941bef4568b460095e2"}, @@ -602,6 +635,7 @@ version = "2.32.0" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "requests-2.32.0-py3-none-any.whl", hash = "sha256:f2c3881dddb70d056c5bd7600a4fae312b2a300e39be6a118d30b90bd27262b5"}, {file = "requests-2.32.0.tar.gz", hash = "sha256:fa5490319474c82ef1d2c9bc459d3652e3ae4ef4c4ebdd18a21145a47ca4b6b8"}, @@ -623,6 +657,7 @@ version = "1.16.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["dev"] files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, @@ -634,6 +669,7 @@ version = "2.2.0" description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, @@ -645,6 +681,7 @@ version = "7.1.2" description = "Python documentation generator" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "sphinx-7.1.2-py3-none-any.whl", hash = "sha256:d170a81825b2fcacb6dfd5a0d7f578a053e45d3f2b153fecc948c37344eb4cbe"}, {file = "sphinx-7.1.2.tar.gz", hash = "sha256:780f4d32f1d7d1126576e0e5ecc19dc32ab76cd24e950228dcf7b1f6d3d9e22f"}, @@ -680,6 +717,7 @@ version = "2.0.1" description = "Type hints (PEP 484) support for the Sphinx autodoc extension" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "sphinx_autodoc_typehints-2.0.1-py3-none-any.whl", hash = "sha256:f73ae89b43a799e587e39266672c1075b2ef783aeb382d3ebed77c38a3fc0149"}, {file = "sphinx_autodoc_typehints-2.0.1.tar.gz", hash = "sha256:60ed1e3b2c970acc0aa6e877be42d48029a9faec7378a17838716cacd8c10b12"}, @@ -699,6 +737,7 @@ version = "3.0.2" description = "Read the Docs theme for Sphinx" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "sphinx_rtd_theme-3.0.2-py2.py3-none-any.whl", hash = "sha256:422ccc750c3a3a311de4ae327e82affdaf59eb695ba4936538552f3b00f4ee13"}, {file = "sphinx_rtd_theme-3.0.2.tar.gz", hash = "sha256:b7457bc25dda723b20b086a670b9953c859eab60a2a03ee8eb2bb23e176e5f85"}, @@ -718,6 +757,7 @@ version = "1.0.2" description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"}, {file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"}, @@ -733,6 +773,7 @@ version = "1.0.2" description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, @@ -748,6 +789,7 @@ version = "2.0.0" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "sphinxcontrib-htmlhelp-2.0.0.tar.gz", hash = "sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2"}, {file = "sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl", hash = "sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07"}, @@ -763,6 +805,7 @@ version = "4.1" description = "Extension to include jQuery on newer Sphinx releases" optional = false python-versions = ">=2.7" +groups = ["dev"] files = [ {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, @@ -777,6 +820,7 @@ version = "1.0.1" description = "A sphinx extension which renders display math in HTML via JavaScript" optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, @@ -791,6 +835,7 @@ version = "1.0.3" description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, @@ -806,6 +851,7 @@ version = "1.1.5" description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, @@ -821,6 +867,8 @@ version = "2.0.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, @@ -832,6 +880,7 @@ version = "2021.10.8.3" description = "Typing stubs for certifi" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "types-certifi-2021.10.8.3.tar.gz", hash = "sha256:72cf7798d165bc0b76e1c10dd1ea3097c7063c42c21d664523b928e88b554a4f"}, {file = "types_certifi-2021.10.8.3-py3-none-any.whl", hash = "sha256:b2d1e325e69f71f7c78e5943d410e650b4707bb0ef32e4ddf3da37f54176e88a"}, @@ -843,6 +892,7 @@ version = "75.8.0.20250110" description = "Typing stubs for setuptools" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types_setuptools-75.8.0.20250110-py3-none-any.whl", hash = "sha256:a9f12980bbf9bcdc23ecd80755789085bad6bfce4060c2275bc2b4ca9f2bc480"}, {file = "types_setuptools-75.8.0.20250110.tar.gz", hash = "sha256:96f7ec8bbd6e0a54ea180d66ad68ad7a1d7954e7281a710ea2de75e355545271"}, @@ -854,6 +904,7 @@ version = "1.26.25.14" description = "Typing stubs for urllib3" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "types-urllib3-1.26.25.14.tar.gz", hash = "sha256:229b7f577c951b8c1b92c1bc2b2fdb0b49847bd2af6d1cc2a2e3dd340f3bda8f"}, {file = "types_urllib3-1.26.25.14-py3-none-any.whl", hash = "sha256:9683bbb7fb72e32bfe9d2be6e04875fbe1b3eeec3cbb4ea231435aa7fd6b4f0e"}, @@ -865,6 +916,7 @@ version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -876,13 +928,14 @@ version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] @@ -893,6 +946,7 @@ version = "13.1" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "websockets-13.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f48c749857f8fb598fb890a75f540e3221d0976ed0bf879cf3c7eef34151acee"}, {file = "websockets-13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c7e72ce6bda6fb9409cc1e8164dd41d7c91466fb599eb047cfda72fe758a34a7"}, @@ -988,6 +1042,7 @@ version = "0.13.0" description = "Makes working with XML feel like you are working with JSON" optional = false python-versions = ">=3.4" +groups = ["dev"] files = [ {file = "xmltodict-0.13.0-py2.py3-none-any.whl", hash = "sha256:aa89e8fd76320154a40d19a0df04a4695fb9dc5ba977cbb68ab3e4eb225e7852"}, {file = "xmltodict-0.13.0.tar.gz", hash = "sha256:341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56"}, @@ -999,6 +1054,8 @@ version = "3.19.1" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version < \"3.10\"" files = [ {file = "zipp-3.19.1-py3-none-any.whl", hash = "sha256:2828e64edb5386ea6a52e7ba7cdb17bb30a73a858f5eb6eb93d8d36f5ea26091"}, {file = "zipp-3.19.1.tar.gz", hash = "sha256:35427f6d5594f4acf82d25541438348c26736fa9b3afa2754bcd63cdb99d8e8f"}, @@ -1009,6 +1066,6 @@ doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linke test = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [metadata] -lock-version = "2.0" +lock-version = "2.1" python-versions = "^3.8" content-hash = "c80bc058f0871dd694ea1761d3266a1d46d0265b19312868ccc7e5cf3dbe3244" diff --git a/polygon/rest/models/tickers.py b/polygon/rest/models/tickers.py index 317275ed..76cb6f6f 100644 --- a/polygon/rest/models/tickers.py +++ b/polygon/rest/models/tickers.py @@ -1,5 +1,4 @@ from typing import Optional, List - from ...modelclass import modelclass @@ -255,10 +254,6 @@ def from_dict(d): return TickerChangeResults(**d) -from typing import Optional -from ...modelclass import modelclass - - @modelclass class IPOListing: """ @@ -310,3 +305,110 @@ def from_dict(d): total_offer_size=d.get("total_offer_size"), us_code=d.get("us_code"), ) + + +@modelclass +class ShortInterest: + """ + Short Interest data for a specific identifier. + """ + + avg_daily_volume: Optional[int] = None + days_to_cover: Optional[float] = None + settlement_date: Optional[str] = None + short_interest: Optional[int] = None + ticker: Optional[str] = None + + @staticmethod + def from_dict(d): + return ShortInterest( + avg_daily_volume=d.get("avg_daily_volume"), + days_to_cover=d.get("days_to_cover"), + settlement_date=d.get("settlement_date"), + short_interest=d.get("short_interest"), + ticker=d.get("ticker"), + ) + + +@modelclass +class ShortVolume: + """ + Short Volume data for a specific identifier on a given date. + """ + + adf_short_volume: Optional[int] = None + adf_short_volume_exempt: Optional[int] = None + date: Optional[str] = None + exempt_volume: Optional[int] = None + nasdaq_carteret_short_volume: Optional[int] = None + nasdaq_carteret_short_volume_exempt: Optional[int] = None + nasdaq_chicago_short_volume: Optional[int] = None + nasdaq_chicago_short_volume_exempt: Optional[int] = None + non_exempt_volume: Optional[int] = None + nyse_short_volume: Optional[int] = None + nyse_short_volume_exempt: Optional[int] = None + short_volume: Optional[int] = None + short_volume_ratio: Optional[float] = None + ticker: Optional[str] = None + total_volume: Optional[int] = None + + @staticmethod + def from_dict(d): + return ShortVolume( + adf_short_volume=d.get("adf_short_volume"), + adf_short_volume_exempt=d.get("adf_short_volume_exempt"), + date=d.get("date"), + exempt_volume=d.get("exempt_volume"), + nasdaq_carteret_short_volume=d.get("nasdaq_carteret_short_volume"), + nasdaq_carteret_short_volume_exempt=d.get( + "nasdaq_carteret_short_volume_exempt" + ), + nasdaq_chicago_short_volume=d.get("nasdaq_chicago_short_volume"), + nasdaq_chicago_short_volume_exempt=d.get( + "nasdaq_chicago_short_volume_exempt" + ), + non_exempt_volume=d.get("non_exempt_volume"), + nyse_short_volume=d.get("nyse_short_volume"), + nyse_short_volume_exempt=d.get("nyse_short_volume_exempt"), + short_volume=d.get("short_volume"), + short_volume_ratio=d.get("short_volume_ratio"), + ticker=d.get("ticker"), + total_volume=d.get("total_volume"), + ) + + +@modelclass +class TreasuryYield: + """ + Treasury yield data for a specific date. + """ + + date: Optional[str] = None + yield_1_month: Optional[float] = None + yield_3_month: Optional[float] = None + yield_6_month: Optional[float] = None + yield_1_year: Optional[float] = None + yield_2_year: Optional[float] = None + yield_3_year: Optional[float] = None + yield_5_year: Optional[float] = None + yield_7_year: Optional[float] = None + yield_10_year: Optional[float] = None + yield_20_year: Optional[float] = None + yield_30_year: Optional[float] = None + + @staticmethod + def from_dict(d): + return TreasuryYield( + date=d.get("date"), + yield_1_month=d.get("yield_1_month"), + yield_3_month=d.get("yield_3_month"), + yield_6_month=d.get("yield_6_month"), + yield_1_year=d.get("yield_1_year"), + yield_2_year=d.get("yield_2_year"), + yield_3_year=d.get("yield_3_year"), + yield_5_year=d.get("yield_5_year"), + yield_7_year=d.get("yield_7_year"), + yield_10_year=d.get("yield_10_year"), + yield_20_year=d.get("yield_20_year"), + yield_30_year=d.get("yield_30_year"), + ) diff --git a/polygon/rest/vX.py b/polygon/rest/vX.py index 228134d4..23f0e94e 100644 --- a/polygon/rest/vX.py +++ b/polygon/rest/vX.py @@ -1,9 +1,17 @@ from .base import BaseClient from typing import Optional, Any, Dict, List, Union, Iterator -from .models import StockFinancial, IPOListing, Timeframe, Sort, Order +from .models import ( + StockFinancial, + IPOListing, + ShortInterest, + ShortVolume, + TreasuryYield, + Timeframe, + Sort, + Order, +) from urllib3 import HTTPResponse from datetime import datetime, date - from .models.request import RequestOptionBuilder @@ -77,6 +85,10 @@ def list_ipos( us_code: Optional[str] = None, isin: Optional[str] = None, listing_date: Optional[str] = None, + listing_date_lt: Optional[str] = None, + listing_date_lte: Optional[str] = None, + listing_date_gt: Optional[str] = None, + listing_date_gte: Optional[str] = None, ipo_status: Optional[str] = None, limit: Optional[int] = None, sort: Optional[Union[str, Sort]] = None, @@ -111,3 +123,170 @@ def list_ipos( result_key="results", options=options, ) + + def list_short_interest( + self, + ticker: Optional[str] = None, + days_to_cover: Optional[str] = None, + days_to_cover_lt: Optional[str] = None, + days_to_cover_lte: Optional[str] = None, + days_to_cover_gt: Optional[str] = None, + days_to_cover_gte: Optional[str] = None, + settlement_date: Optional[str] = None, + settlement_date_lt: Optional[str] = None, + settlement_date_lte: Optional[str] = None, + settlement_date_gt: Optional[str] = None, + settlement_date_gte: Optional[str] = None, + avg_daily_volume: Optional[str] = None, + avg_daily_volume_lt: Optional[str] = None, + avg_daily_volume_lte: Optional[str] = None, + avg_daily_volume_gt: Optional[str] = None, + avg_daily_volume_gte: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[ShortInterest], HTTPResponse]: + """ + Retrieve short interest data for stocks. + + :param ticker: Filter by the primary ticker symbol. + :param days_to_cover: Filter by the days to cover value. + :param days_to_cover_lt: Filter for days to cover dates less than the provided date. + :param days_to_cover_lte: Filter for days to cover dates less than or equal to the provided date. + :param days_to_cover_gt: Filter for days to cover dates greater than the provided date. + :param days_to_cover_gte: Filter for days to cover dates greater than or equal to the provided date. + :param settlement_date: Filter by settlement date (YYYY-MM-DD). + :param settlement_date_lt: Filter for settlement dates less than the provided date. + :param settlement_date_lte: Filter for settlement dates less than or equal to the provided date. + :param settlement_date_gt: Filter for settlement dates greater than the provided date. + :param settlement_date_gte: Filter for settlement dates greater than or equal to the provided date. + :param avg_daily_volume: Filter by average daily volume. + :param avg_daily_volume_lt: Filter for average daily volume dates less than the provided date. + :param avg_daily_volume_lte: Filter for average daily volume dates less than or equal to the provided date. + :param avg_daily_volume_gt: Filter for average daily volume dates greater than the provided date. + :param avg_daily_volume_gte: Filter for average daily volume dates greater than or equal to the provided date. + :param limit: Limit the number of results returned. Default 10, max 50000. + :param sort: Field to sort by (e.g., "ticker"). + :param order: Order results based on the sort field ("asc" or "desc"). Default "desc". + :param params: Additional query parameters. + :param raw: Return raw HTTPResponse object if True, else return List[ShortInterest]. + :param options: RequestOptionBuilder for additional headers or params. + :return: A list of ShortInterest objects or HTTPResponse if raw=True. + """ + url = "/stocks/vX/short-interest" + + return self._paginate( + path=url, + params=self._get_params(self.list_short_interest, locals()), + deserializer=ShortInterest.from_dict, + raw=raw, + result_key="results", + options=options, + ) + + def list_short_volume( + self, + ticker: Optional[str] = None, + date: Optional[str] = None, + date_lt: Optional[str] = None, + date_lte: Optional[str] = None, + date_gt: Optional[str] = None, + date_gte: Optional[str] = None, + short_volume_ratio: Optional[str] = None, + short_volume_ratio_lt: Optional[str] = None, + short_volume_ratio_lte: Optional[str] = None, + short_volume_ratio_gt: Optional[str] = None, + short_volume_ratio_gte: Optional[str] = None, + total_volume: Optional[str] = None, + total_volume_lt: Optional[str] = None, + total_volume_lte: Optional[str] = None, + total_volume_gt: Optional[str] = None, + total_volume_gte: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[ShortVolume], HTTPResponse]: + """ + Retrieve short volume data for stocks. + + :param ticker: Filter by the primary ticker symbol. + :param date: Filter by the date of trade activity (YYYY-MM-DD). + :param date_lt: Filter for dates less than the provided date. + :param date_lte: Filter for dates less than or equal to the provided date. + :param date_gt: Filter for dates greater than the provided date. + :param date_gte: Filter for dates greater than or equal to the provided date. + :param short_volume_ratio: Filter by short volume ratio. + :param short_volume_ratio_lt: Filter for short volume ratio less than the provided date. + :param short_volume_ratio_lte: Filter for short volume ratio less than or equal to the provided date. + :param short_volume_ratio_gt: Filter for short volume ratio greater than the provided date. + :param short_volume_ratio_gte: Filter for short volume ratio greater than or equal to the provided date. + :param total_volume: Filter by total volume. + :param total_volume_lt: Filter for total volume less than the provided date. + :param total_volume_lte: Filter for total volume less than or equal to the provided date. + :param total_volume_gt: Filter for total volume greater than the provided date. + :param total_volume_gte: Filter for total volume greater than or equal to the provided date. + :param limit: Limit the number of results returned. Default 10, max 50000. + :param sort: Field to sort by (e.g., "ticker"). + :param order: Order results based on the sort field ("asc" or "desc"). Default "desc". + :param params: Additional query parameters. + :param raw: Return raw HTTPResponse object if True, else return List[ShortVolume]. + :param options: RequestOptionBuilder for additional headers or params. + :return: A list of ShortVolume objects or HTTPResponse if raw=True. + """ + url = "/stocks/vX/short-volume" + + return self._paginate( + path=url, + params=self._get_params(self.list_short_volume, locals()), + deserializer=ShortVolume.from_dict, + raw=raw, + result_key="results", + options=options, + ) + + def list_treasury_yields( + self, + date: Optional[str] = None, + date_gt: Optional[str] = None, + date_gte: Optional[str] = None, + date_lt: Optional[str] = None, + date_lte: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[TreasuryYield], HTTPResponse]: + """ + Retrieve treasury yield data. + + :param date: Calendar date of the yield observation (YYYY-MM-DD). + :param date_gt: Filter for dates greater than the provided date. + :param date_gte: Filter for dates greater than or equal to the provided date. + :param date_lt: Filter for dates less than the provided date. + :param date_lte: Filter for dates less than or equal to the provided date. + :param limit: Limit the number of results returned. Default 100, max 50000. + :param sort: Field to sort by (e.g., "date"). Default "date". + :param order: Order results based on the sort field ("asc" or "desc"). Default "desc". + :param params: Additional query parameters. + :param raw: Return raw HTTPResponse object if True, else return List[TreasuryYield]. + :param options: RequestOptionBuilder for additional headers or params. + :return: A list of TreasuryYield objects or HTTPResponse if raw=True. + """ + url = "/fed/vX/treasury-yields" + + return self._paginate( + path=url, + params=self._get_params(self.list_treasury_yields, locals()), + deserializer=TreasuryYield.from_dict, + raw=raw, + result_key="results", + options=options, + )
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: