{"id":21284477,"url":"https://github.com/nasdaq/nasdaqclouddataservice-sdk-python","last_synced_at":"2025-07-25T06:09:32.812Z","repository":{"id":43837163,"uuid":"394409370","full_name":"Nasdaq/NasdaqCloudDataService-SDK-Python","owner":"Nasdaq","description":"Nasdaq Data Link provides a modern and efficient method of delivery for real-time exchange data and other financial information. This repository provides a Python SDK for developing applications using Nasdaq Data Link's real-time data.","archived":false,"fork":false,"pushed_at":"2025-06-13T16:02:01.000Z","size":410,"stargazers_count":76,"open_issues_count":12,"forks_count":30,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-11T12:44:20.855Z","etag":null,"topics":["bx","exchange-data","financial-data","index","low-cost","market-data","nasdaq","nasdaq-canada","ncds","news","options","psx","realtime","rest","restapi","sdk","streaming"],"latest_commit_sha":null,"homepage":"https://www.nasdaq.com/solutions/data-link-api","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nasdaq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-09T19:08:05.000Z","updated_at":"2025-07-08T10:44:46.000Z","dependencies_parsed_at":"2024-01-04T21:31:23.430Z","dependency_job_id":"1e702438-fdec-43b9-beaf-dc423274f662","html_url":"https://github.com/Nasdaq/NasdaqCloudDataService-SDK-Python","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Nasdaq/NasdaqCloudDataService-SDK-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2FNasdaqCloudDataService-SDK-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2FNasdaqCloudDataService-SDK-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2FNasdaqCloudDataService-SDK-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2FNasdaqCloudDataService-SDK-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nasdaq","download_url":"https://codeload.github.com/Nasdaq/NasdaqCloudDataService-SDK-Python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2FNasdaqCloudDataService-SDK-Python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266963541,"owners_count":24013076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bx","exchange-data","financial-data","index","low-cost","market-data","nasdaq","nasdaq-canada","ncds","news","options","psx","realtime","rest","restapi","sdk","streaming"],"created_at":"2024-11-21T11:16:09.045Z","updated_at":"2025-07-25T06:09:32.783Z","avatar_url":"https://github.com/Nasdaq.png","language":"Python","readme":"# Nasdaq Data Link\n\nNasdaq Data Link provides a modern and efficient method of delivery for realtime exchange data and other financial information. Data is made available through a suite of APIs, allowing for effortless integration of data from disparate sources, and a dramatic reduction in time to market for customer-designed applications. The API is highly scalable, and robust enough to support the delivery of real-time exchange data.  \n\n# Products Currently Available\n### Equities\n#### The Nasdaq Stock Market\n- [Nasdaq Basic v1](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NasdaqBasic-Cloud.pdf) (real-time \u0026 delayed)\n- [Nasdaq Basic v2](https://assets.ctfassets.net/mx0rke14e5yt/v98L9JONLPyiFWpNZ1Qnv/799904397161ba3662c8cf7e071abb9a/NasdaqBBO_Cloud-2025.pdf) (real-time \u0026 delayed)\n- [Nasdaq Last Sale+ v3](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NLSPlus-cloud.pdf) (real-time \u0026 delayed)\n- [Nasdaq Last Sale+ v4](https://assets.ctfassets.net/mx0rke14e5yt/56DTTqad89Rok21eYI7Ogw/3994fee598fc6910573b327b94493418/NasdaqLastSale_Cloud-2025.pdf) (real-time \u0026 delayed)\n- [Nasdaq TotalView](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/Totalview-ITCH-cloud.pdf)\n- [Nasdaq Consolidated Quotes and Trades](https://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/CQT-cloud.pdf) (real-time \u0026 delayed)\n#### Nasdaq BX\n- [BX BBO v1](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/BX_BBO_Cloud.pdf)\n- [BX BBO v2](https://assets.ctfassets.net/mx0rke14e5yt/v98L9JONLPyiFWpNZ1Qnv/799904397161ba3662c8cf7e071abb9a/NasdaqBBO_Cloud-2025.pdf)\n- [BX Last Sale v3](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/BLS_Cloud.pdf)\n- [BX Last Sale v4](https://assets.ctfassets.net/mx0rke14e5yt/56DTTqad89Rok21eYI7Ogw/3994fee598fc6910573b327b94493418/NasdaqLastSale_Cloud-2025.pdf)\n#### Nasdaq PSX\n- [PSX BBO v1](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/PSX_BBO_Cloud.pdf)\n- [PSX BBO v2](https://assets.ctfassets.net/mx0rke14e5yt/v98L9JONLPyiFWpNZ1Qnv/799904397161ba3662c8cf7e071abb9a/NasdaqBBO_Cloud-2025.pdf)\n- [PSX Last Sale v3](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/PLS_Cloud.pdf)\n- [PSX Last Sale v4](https://assets.ctfassets.net/mx0rke14e5yt/56DTTqad89Rok21eYI7Ogw/3994fee598fc6910573b327b94493418/NasdaqLastSale_Cloud-2025.pdf)\n#### Nasdaq Canada\n- [Nasdaq Canada Basic](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/Nasdaq-Basic-Canada-Cloud-Specification.pdf)\n#### OTC Markets\n- [OTC Markets](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/OTCM-cloud.pdf) (real-time \u0026 delayed)\n### Indexes \u0026 ETPs\n- [Global Index Data Service](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/GIDS_Cloud.pdf)\n### Options\n#### Nasdaq U.S. Derivatives\n- [Nasdaq Smart Options]()\n- [Nasdaq Options Greeks and Implied Volatility](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/GreeksandVols_Specification.pdf)\n### Mutual Funds\n- [Nasdaq Fund Network](http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NFNDS_NCDS.pdf)\n### News\n- [Financial News - MT Newswires](http://nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/MTNewswires-cloud.pdf)\n- [Benzinga Market Newswires](https://data.nasdaq.com/databases/BENZ)\n\n# Items To Note\n\n* Connecting to the API requires credentials, which are provided by the Nasdaq Data Operations team during an on-boarding process\n* This sample code only connects to one topic (NLSCTA); during on-boarding process, you will receive a topic list that you're entitled to.\n* See https://github.com/Nasdaq/NasdaqCloudDataService-SDK-Java for our officially support Java-based SDK.\n\n\n# Table of Contents\n - [Getting Started](#getting-started)\n - [Using the SDK](#using-the-sdk)\n\n## Getting Started\n### Python version support\nThe SDK currently supports Python 3.9 and above\n\n### Get the SDK\nThe source code is currently hosted on GitHub at: https://github.com/Nasdaq/NasdaqCloudDataService-SDK-Python\n- Clone the repository: ```git clone https://github.com/Nasdaq/NasdaqCloudDataService-SDK-Python.git```\n- Move into the directory ```cd NasdaqCloudDataService-SDK-Python```\n- Install the library and its dependencies from local source with ```pip install -e .```\n\nOptional: to use the Jupyter notebook provided, \n- Download Jupyter notebook using either pip ```pip3 install notebook``` or conda ```conda install -c conda-forge notebook```\n- To run the notebook, use the command ```jupyter notebook``` and the Notebook Dashboard will open in your browser\n- Select the file ```python_sdk_examples.ipynb```\n\n### Stream configuration\n\nReplace example stream properties in the file **kafka-config.json** (https://github.com/Nasdaq/NasdaqCloudDataService-SDK-Python/blob/master/ncdssdk_client/src/main/python/resources/kafka-config.json) with provided values during on-boarding.\n\n  Required kafka configuration\n\n```properties\n\"bootstrap.servers\": {streams_endpoint_url}:9094\n```\n\n  For optional consumer configurations see: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md\n\n### Client Authentication configuration\n\nReplace example client authentication properties in the file **client-authentication-config.json** (https://github.com/Nasdaq/NasdaqCloudDataService-SDK-Python/blob/master/ncdssdk_client/src/main/python/resources/client-authentication-config.json) with valid credentials provided during on-boarding.\n\n```properties\noauth.token.endpoint.uri: \"https://{auth_endpoint_url}/auth/realms/pro-realm/protocol/openid-connect/token\"\noauth.client.id: \"client_id\"\noauth.client.secret: \"client_secret\"\n```\n\n### Logging Configuration\n\nTo enable debug logging, edit the file (https://github.com/Nasdaq/NasdaqCloudDataService-SDK-Python/blob/master/ncdssdk/src/main/resources/logging.json)\nand change the logging levels in whichever handler you would like output to go to. \n\nFor example, to enable debug logging to a file:\n```json\n\"file_handler\": {\n      \"class\": \"logging.handlers.RotatingFileHandler\",\n      \"level\": \"DEBUG\",\n      \"formatter\": \"simple\",\n      \"filename\": \"logging.log\",\n      \"maxBytes\": 10485760,\n      \"backupCount\": 20,\n      \"encoding\": \"utf8\"\n    }\n  },\n\n  \"loggers\": {\n    \"\": {\n      \"level\": \"DEBUG\",\n      \"handlers\": [\"console\", \"file_handler\"],\n      \"propogate\": false\n    }\n  }\n}\n```\n\nNext, add a debug option to your kafka configurations:\n```python\nkafka_cfg = {\n    \"bootstrap.servers\": \"{streams_endpoint_url}:9094\",\n    \"auto.offset.reset\": \"earliest\",\n    \"debug\": \"all\"\n}\n```\n\n\n### Create NCDS Session Client\n\n  How to run:\n```\n-opt -- Provide the operation you want to perform \\n\" +\n  \"        * TOP - View the top nnn records in the Topic/Stream\\n\" +\n  \"        * SCHEMA - Display the Schema for the topic\\n\" +\n  \"        * METRICS - Display the Metrics for the topic\\n\" +\n  \"        * TOPICS - List of streams available on Nasdaq Cloud DataService\\n\" +\n  \"        * GETMSG - Get one example message for the given message name\\n\" +\n  \"        * CONTSTREAM   - Retrieve continuous stream  \\n\" +\n  \"        * FILTERSTREAM  - Retrieve continuous stream filtered by symbols and/or msgtypes \\n\" +\n  \"        * HELP - help \\n\" +\n\"-topic -- Provide topic for selected option         --- REQUIRED for TOP,SCHEMA,METRICS,GETMSG,CONTSTREAM and FILTERSTREAM \\n\" +\n\"-symbols -- Provide symbols comma separated list    --- OPTIONAL for FILTERSTREAM\" +\n\"-msgnames -- Provide msgnames comma separated list  --- OPTIONAL for FILTERSTREAM\" +\n\"-authprops -- Provide Client Properties File path   --- For using different set of Client Authentication Properties \\n\" +\n\"-kafkaprops -- Provide Kafka Properties File path   --- For using different set of Kafka Properties \\n\" +\n\"-n -- Provide number of messages to retrieve        --- REQUIRED for TOP \\n\" +\n\"-msgName -- Provide name of message based on schema --- REQUIRED for GETMSG \\n\" +\n\"-timestamp -- Provide timestamp in milliseconds     --- OPTIONAL for TOP, CONTSTREAM and FILTERSTREAM\\n\"\n```\n\nA few examples:\n\nGet first 100 records for given stream\n\n```python3.9 ncdssdk_client/src/main/python/ncdsclient/NCDSSession.py -opt TOP -n 100 -topic NLSCTA```\n\nGet all available streams\n\n```python3.9 ncdssdk_client/src/main/python/ncdsclient/NCDSSession.py -opt TOPICS```\n\n## Using the SDK\n\nBelow are several examples for how to access data using the SDK. A Jupyter notebook with this same code and information is provided in the file ```python_sdk_examples.ipnyb```\n\nTo run these examples, you will need the import and configuration dictionaries below. Replace the config information with your credentials. \n\n```python\nfrom ncdssdk import NCDSClient\n\nsecurity_cfg = {\n    \"oauth.token.endpoint.uri\": \"https://{auth_endpoint_url}/auth/realms/demo/protocol/openid-connect/token\",\n    \"oauth.client.id\": \"client\",\n    \"oauth.client.secret\": \"client-secret\"\n}\nkafka_cfg = {\n    \"bootstrap.servers\": \"{streams_endpoint_url}:9094\",\n    \"auto.offset.reset\": \"earliest\"\n}\n```\n \n  ### Getting list of data stream available\n  List all available data stream for the user\n\n  ```python\n  ncds_client = NCDSClient(security_cfg, kafka_cfg)\n  topics = ncds_client.list_topics_for_client()\n  print(\"Data set topics:\")\n  for topic_entry in topics:\n  print(topic_entry)\n  ```\n\n  Example output:\n  ```\n  List of streams available on Nasdaq Cloud Data Service:\n  GIDS\n  NLSUTP\n  NLSCTA\n  ```\n\n  ### Getting schema for the stream\n  This method returns the schema for the stream in Apache Avro format (https://avro.apache.org/docs/current/spec.html)\n  ```python\n  ncds_client = NCDSClient(security_cfg, kafka_cfg)\n  topic = \"NLSCTA\"\n  schema = ncds_client.get_schema_for_topic(topic)\n  print(schema)\n  ```\n\n  Example output:\n  ```\n  [ {\n  \"type\" : \"record\",\n  \"name\" : \"SeqAdjClosingPrice\",\n  \"namespace\" : \"com.nasdaq.equities.trades.applications.nls.messaging.binary21\",\n  \"fields\" : [ {\n    \"name\" : \"SoupPartition\",\n    \"type\" : \"int\"\n  }, {\n    \"name\" : \"SoupSequence\",\n    \"type\" : \"long\"\n  }, {\n    \"name\" : \"trackingID\",\n    \"type\" : \"long\"\n  }, {\n    \"name\" : \"msgType\",\n    \"type\" : \"string\"\n  }, {\n    \"name\" : \"symbol\",\n    \"type\" : \"string\"\n  }, {\n    \"name\" : \"securityClass\",\n    \"type\" : \"string\"\n  }, {\n    \"name\" : \"adjClosingPrice\",\n    \"type\" : \"int\"\n  } ],\n  \"version\" : \"1\"\n  }, {...\n  } .......\n  .... ]\n  ```\n  \n  ### Get first 10 messages of the stream \n  ```python\n  ncds_client = NCDSClient(security_cfg, kafka_cfg)\n  topic = \"NLSCTA\"\n  records = ncds_client.top_messages(topic)\n  for i in range(0, 10):\n      print(\"key: \", records[i].key())\n      print(\"value: \", str(records[i].value()))\n  ```\n  Example output:\n  ```\n  Top 10 Records for the Topic: NLSCTA\nkey: 14600739\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600739, \"trackingID\": 72000000024569, \"msgType\": \"S\", \"event\": \"E\", \"schema_name\": \"SeqSystemEventMessage\"}\nkey: 14600740\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600740, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"A\", \"securityClass\": \"N\", \"consHigh\": 1487799, \"consLow\": 1466600, \"consClose\": 1478100, \"cosolidatedVolume\": 1259303, \"consOpen\": 1486800, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\nkey: 14600741\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600741, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"AA\", \"securityClass\": \"N\", \"consHigh\": 378039, \"consLow\": 366800, \"consClose\": 368400, \"cosolidatedVolume\": 6047752, \"consOpen\": 372000, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\nkey: 14600742\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600742, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"AAA\", \"securityClass\": \"P\", \"consHigh\": 250400, \"consLow\": 250101, \"consClose\": 250250, \"cosolidatedVolume\": 3121, \"consOpen\": 250400, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\nkey: 14600743\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600743, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"AAAU\", \"securityClass\": \"P\", \"consHigh\": 176500, \"consLow\": 174700, \"consClose\": 176000, \"cosolidatedVolume\": 303143, \"consOpen\": 175000, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\nkey: 14600744\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600744, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"AAC\", \"securityClass\": \"N\", \"consHigh\": 97900, \"consLow\": 97500, \"consClose\": 97500, \"cosolidatedVolume\": 19787, \"consOpen\": 97600, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\nkey: 14600745\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600745, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"AAC+\", \"securityClass\": \"N\", \"consHigh\": 12800, \"consLow\": 12000, \"consClose\": 12500, \"cosolidatedVolume\": 85652, \"consOpen\": 12300, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\nkey: 14600746\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600746, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"AAC=\", \"securityClass\": \"N\", \"consHigh\": 100500, \"consLow\": 99500, \"consClose\": 100000, \"cosolidatedVolume\": 74060, \"consOpen\": 99500, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\nkey: 14600747\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600747, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"AAIC\", \"securityClass\": \"N\", \"consHigh\": 41850, \"consLow\": 40600, \"consClose\": 40600, \"cosolidatedVolume\": 241597, \"consOpen\": 41800, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\nkey: 14600748\nvalue: {\"SoupPartition\": 0, \"SoupSequence\": 14600748, \"trackingID\": 72900000006514, \"msgType\": \"J\", \"symbol\": \"AAIC-B\", \"securityClass\": \"N\", \"consHigh\": 249700, \"consLow\": 249700, \"consClose\": 249700, \"cosolidatedVolume\": 238, \"consOpen\": 249700, \"schema_name\": \"SeqEndOfDayTradeSummary\"}\n```\n\n### Get first 10 messages of the stream from given timestamp\nThis returns the first 10 available messages of the stream given timestamp in milliseconds since the UNIX epoch.\n```python\nncds_client = NCDSClient(security_cfg, kafka_cfg)\ntopic=\"NLSCTA\"\ntimestamp = 1590084446510\nrecords = ncds_client.top_messages(topic, timestamp)\nfor i in range(0, 10):\n    print(\"key: \", records[i].key())\n    print(\"value: \", str(records[i].value()))\n```\n\nExample output:\n```\nOffset: 105834100\nTop 10 Records for the Topic:NLSCTA\nkey:9362630\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362630, \"trackingID\": 50845551492208, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"SIVR    \", \"securityClass\": \"P\", \"controlNumber\": \"0000A2MLOB\", \"price\": 164797, \"size\": 1, \"saleCondition\": \"@  o\", \"cosolidatedVolume\": 520174}\nkey:9362631\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362631, \"trackingID\": 50845557908136, \"msgType\": \"T\", \"marketCenter\": \"Q\", \"symbol\": \"TJX     \", \"securityClass\": \"N\", \"controlNumber\": \"   8358213\", \"price\": 540300, \"size\": 100, \"saleCondition\": \"@   \", \"cosolidatedVolume\": 16278768}\nkey:9362632\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362632, \"trackingID\": 50845565203932, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"CMI     \", \"securityClass\": \"N\", \"controlNumber\": \"0000A2MLOC\", \"price\": 1579900, \"size\": 100, \"saleCondition\": \"@   \", \"cosolidatedVolume\": 568622}\nkey:9362633\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362633, \"trackingID\": 50845565791061, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"UTI     \", \"securityClass\": \"N\", \"controlNumber\": \"0000A2MLOD\", \"price\": 70150, \"size\": 64, \"saleCondition\": \"@  o\", \"cosolidatedVolume\": 151359}\nkey:9362634\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362634, \"trackingID\": 50845566628604, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"UFS     \", \"securityClass\": \"N\", \"controlNumber\": \"0000A2MLOE\", \"price\": 203660, \"size\": 24, \"saleCondition\": \"@  o\", \"cosolidatedVolume\": 664962}\nkey:9362635\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362635, \"trackingID\": 50845569154140, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"KR      \", \"securityClass\": \"N\", \"controlNumber\": \"0000A2MLOF\", \"price\": 320350, \"size\": 100, \"saleCondition\": \"@   \", \"cosolidatedVolume\": 4054473}\nkey:9362636\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362636, \"trackingID\": 50845577944984, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"PAGP    \", \"securityClass\": \"N\", \"controlNumber\": \"0000A2MLOG\", \"price\": 98350, \"size\": 100, \"saleCondition\": \"@   \", \"cosolidatedVolume\": 1557084}\nkey:9362637\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362637, \"trackingID\": 50845588007117, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"LUV     \", \"securityClass\": \"N\", \"controlNumber\": \"0000A2MLOH\", \"price\": 297413, \"size\": 4, \"saleCondition\": \"@  o\", \"cosolidatedVolume\": 16791899}\nkey:9362638\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362638, \"trackingID\": 50845596356365, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"M       \", \"securityClass\": \"N\", \"controlNumber\": \"0000A2MLOI\", \"price\": 54000, \"size\": 10, \"saleCondition\": \"@  o\", \"cosolidatedVolume\": 39273663}\nkey:9362639\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9362639, \"trackingID\": 50845600594567, \"msgType\": \"T\", \"marketCenter\": \"L\", \"symbol\": \"TTM     \", \"securityClass\": \"N\", \"controlNumber\": \"0000A2MLOJ\", \"price\": 56000, \"size\": 400, \"saleCondition\": \"@   \", \"cosolidatedVolume\": 1293244}\n```\n\n### Get example message from stream\nPrint message to the console for given message name.\n```python\nncds_client = NCDSClient(security_cfg, kafka_cfg)\ntopic = \"NLSCTA\"\nprint(ncds_client.get_sample_messages(topic, \"SeqDirectoryMessage\", all_messages=False))\n```\n\nExample output:\n```\n{'SoupPartition': 0, 'SoupSequence': 500, 'trackingID': 11578737109589, 'msgType': 'R', 'symbol': 'AMN', 'marketClass': 'N', 'fsi': '', 'roundLotSize': 100, 'roundLotOnly': 'N', 'issueClass': 'C', 'issueSubtype': 'Z', 'authenticity': 'P', 'shortThreshold': 'N', 'ipo': '', 'luldTier': '2', 'etf': 'N', 'etfFactor': 0, 'inverseETF': 'N', 'compositeId': 'BBG000BCT197', 'schema_name': 'SeqDirectoryMessage'}\n```\n\n### Get continuous stream\n```python\n\nncds_client = NCDSClient(security_cfg, kafka_cfg)\ntopic = \"NLSCTA\"\nconsumer = ncds_client.ncds_kafka_consumer(topic)\nwhile True:\n    messages = consumer.consume(num_messages=1, timeout=5)\n    if len(messages) == 0:\n        print(f\"No Records Found for the Topic: {topic}\")\n              \n    for message in messages:\n        print(f\"value :\" + str(message.value()))\n```\n\nExample output:\n*note that only the first ten messages of the stream are shown in this example*\n```\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 1, \"trackingID\": 7233292771056, \"msgType\": \"S\", \"event\": \"O\", \"schema_name\": \"SeqSystemEventMessage\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 2, \"trackingID\": 11578719526113, \"msgType\": \"R\", \"symbol\": \"A\", \"marketClass\": \"N\", \"fsi\": \"\", \"roundLotSize\": 100, \"roundLotOnly\": \"N\", \"issueClass\": \"C\", \"issueSubtype\": \"Z\", \"authenticity\": \"P\", \"shortThreshold\": \"N\", \"ipo\": \"\", \"luldTier\": \"1\", \"etf\": \"N\", \"etfFactor\": 0, \"inverseETF\": \"N\", \"compositeId\": \"BBG000C2V3D6\", \"schema_name\": \"SeqDirectoryMessage\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 3, \"trackingID\": 11578719526113, \"msgType\": \"G\", \"symbol\": \"A\", \"securityClass\": \"N\", \"adjClosingPrice\": 1500300, \"schema_name\": \"SeqAdjClosingPrice\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 4, \"trackingID\": 11578719831656, \"msgType\": \"R\", \"symbol\": \"AA\", \"marketClass\": \"N\", \"fsi\": \"\", \"roundLotSize\": 100, \"roundLotOnly\": \"N\", \"issueClass\": \"C\", \"issueSubtype\": \"Z\", \"authenticity\": \"P\", \"shortThreshold\": \"N\", \"ipo\": \"\", \"luldTier\": \"1\", \"etf\": \"N\", \"etfFactor\": 1, \"inverseETF\": \"N\", \"compositeId\": \"BBG00B3T3HD3\", \"schema_name\": \"SeqDirectoryMessage\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 5, \"trackingID\": 11578719831656, \"msgType\": \"G\", \"symbol\": \"AA\", \"securityClass\": \"N\", \"adjClosingPrice\": 374400, \"schema_name\": \"SeqAdjClosingPrice\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 6, \"trackingID\": 11578719879872, \"msgType\": \"R\", \"symbol\": \"AAA\", \"marketClass\": \"P\", \"fsi\": \"\", \"roundLotSize\": 100, \"roundLotOnly\": \"N\", \"issueClass\": \"Q\", \"issueSubtype\": \"I\", \"authenticity\": \"P\", \"shortThreshold\": \"N\", \"ipo\": \"\", \"luldTier\": \"2\", \"etf\": \"Y\", \"etfFactor\": 1, \"inverseETF\": \"N\", \"compositeId\": \"BBG00X5FSP48\", \"schema_name\": \"SeqDirectoryMessage\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 7, \"trackingID\": 11578719879872, \"msgType\": \"G\", \"symbol\": \"AAA\", \"securityClass\": \"P\", \"adjClosingPrice\": 250050, \"schema_name\": \"SeqAdjClosingPrice\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 8, \"trackingID\": 11578719916519, \"msgType\": \"R\", \"symbol\": \"AAAU\", \"marketClass\": \"P\", \"fsi\": \"\", \"roundLotSize\": 100, \"roundLotOnly\": \"N\", \"issueClass\": \"Q\", \"issueSubtype\": \"I\", \"authenticity\": \"P\", \"shortThreshold\": \"N\", \"ipo\": \"\", \"luldTier\": \"1\", \"etf\": \"Y\", \"etfFactor\": 1, \"inverseETF\": \"N\", \"compositeId\": \"BBG00LPXX872\", \"schema_name\": \"SeqDirectoryMessage\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 9, \"trackingID\": 11578719916519, \"msgType\": \"G\", \"symbol\": \"AAAU\", \"securityClass\": \"P\", \"adjClosingPrice\": 179850, \"schema_name\": \"SeqAdjClosingPrice\"}\nvalue :{\"SoupPartition\": 0, \"SoupSequence\": 10, \"trackingID\": 11578719950254, \"msgType\": \"R\", \"symbol\": \"AAC\", \"marketClass\": \"N\", \"fsi\": \"\", \"roundLotSize\": 100, \"roundLotOnly\": \"N\", \"issueClass\": \"O\", \"issueSubtype\": \"Z\", \"authenticity\": \"P\", \"shortThreshold\": \"N\", \"ipo\": \"\", \"luldTier\": \"2\", \"etf\": \"N\", \"etfFactor\": 1, \"inverseETF\": \"N\", \"compositeId\": \"BBG00YZC2Z91\", \"schema_name\": \"SeqDirectoryMessage\"}\n```\n\n### Example syntax to run the client based on this SDK\n\n1. To list streams available on Nasdaq Cloud Data Service\n\n```python3.9 NCDSSession.py -opt TOPICS```\n\n2. To display the schema for the given topic\n\n```python3.9 NCDSSession.py -opt SCHEMA -topic NLSCTA```\n\n3. To dump top n records from the given topic\n\n```python3.9 NCDSSession.py -opt TOP -n 10 -topic NLSCTA```\n\n4. To use client based specific authorization file instead of using from the resources of client code base\n\n```python3.9 NCDSSession.py -opt TOP -n 10 -topic NLSCTA -authprops client-authentication-config.json```\n\n5. To use the specific kafka properties instead of using the kafka properties from the resources of the client base code\n\n```python3.9 NCDSSession.py -opt TOP -n 10 -topic NLSCTA -kafkaprops kafka-config.json```\n\n6. To use the specific client based authorization file and specific kafka properties file\n\n```python3.9 NCDSSession.py -opt TOP -n 10 -topic NLSCTA -authprops client-authentication-config.json -kafkaprops kafka-config.json```\n\n7. To display a specific message type\n\n```python3.9 NCDSSession.py -opt GETMSG -topic NLSCTA -msgname SeqDirectoryMessage```\n\n8. To dump top n records from the given topic from given timestamp in milliseconds since the UNIX epoch\n\n```python3.9 NCDSSession.py -opt TOP -n 10 -topic NLSCTA -timestamp 1590084445610```\n\n9. To retrieve a continuous stream of messages from the given topic\n\n```python3.9 NCDSSession.py -opt CONTSTREAM -topic NLSCTA```\n\n10. To retrieve a stream of messages from the given topic, filtered by symbols or message names\n\n```python3.9 NCDSSession.py -opt FILTERSTREAM -topic NLSCTA -symbols SPCE```\n\n## Documentation\n\nAn addition to the example application, there is extra documentation at the package and class level, which are located in project ```https://github.com/Nasdaq/NasdaqCloudDataService-SDK-Python​/tree/master/ncdssdk/docs```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\nCode and documentation released under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasdaq%2Fnasdaqclouddataservice-sdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnasdaq%2Fnasdaqclouddataservice-sdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasdaq%2Fnasdaqclouddataservice-sdk-python/lists"}