{"id":21284472,"url":"https://github.com/nasdaq/data-link-python","last_synced_at":"2025-05-16T03:04:58.056Z","repository":{"id":38050885,"uuid":"423862002","full_name":"Nasdaq/data-link-python","owner":"Nasdaq","description":"A Python library for Nasdaq Data Link's RESTful API","archived":false,"fork":false,"pushed_at":"2022-11-15T17:36:44.000Z","size":113,"stargazers_count":529,"open_issues_count":26,"forks_count":82,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-16T03:04:52.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nasdaq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-02T13:49:22.000Z","updated_at":"2025-05-06T03:52:52.000Z","dependencies_parsed_at":"2022-07-12T00:17:37.860Z","dependency_job_id":null,"html_url":"https://github.com/Nasdaq/data-link-python","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2Fdata-link-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2Fdata-link-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2Fdata-link-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2Fdata-link-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nasdaq","download_url":"https://codeload.github.com/Nasdaq/data-link-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459087,"owners_count":22074605,"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","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":[],"created_at":"2024-11-21T11:16:07.118Z","updated_at":"2025-05-16T03:04:53.049Z","avatar_url":"https://github.com/Nasdaq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nasdaq Data Link Python Client\n\nThis is the official documentation for Nasdaq Data Link's Python Package. The package can be used to interact with the latest version of the [Nasdaq Data Link's RESTful API](https://docs.data.nasdaq.com/docs). This package is compatible with python v3.7+.\n\n## Installation\n\nThe installation process varies depending on your python version and system used. However in most cases the following should work:\n\n```shell\npip install nasdaq-data-link\n```\n\nAlternatively on some systems python3 may use a different pip executable and may need to be installed via an alternate pip command. For example:\n\n```shell\npip3 install nasdaq-data-link\n```\n\n## Configuration\n\n| Option | Explanation | Example |\n|---|---|---|\n| api_key | Your access key | `tEsTkEy123456789` | Used to identify who you are and provide full access. |\n| use_retries | Whether API calls which return statuses in `retry_status_codes` should be automatically retried | True\n| number_of_retries | Maximum number of retries that should be attempted. Only used if `use_retries` is True | 5\n| max_wait_between_retries | Maximum amount of time in seconds that should be waited before attempting a retry. Only used if `use_retries` is True | 8\n| retry_backoff_factor | Determines the amount of time in seconds that should be waited before attempting another retry. Note that this factor is exponential so a `retry_backoff_factor` of 0.5 will cause waits of [0.5, 1, 2, 4, etc]. Only used if `use_retries` is True | 0.5\n| retry_status_codes | A list of HTTP status codes which will trigger a retry to occur. Only used if `use_retries` is True| [429, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511]\n\nBy default, SSL verification is enabled. To bypass SSL verification (not recommended), simply:\n\n```python\nnasdaqdatalink.ApiConfig.verify_ssl = False\n```\n\n### Environment Variables\n\nYou may use environment variables to configure the Data Link SDK to avoid any\ninline boilerplate.\n\n| Env | Description |\n|---|---|\n| NASDAQ_DATA_LINK_API_KEY | The SDK will configure itself to use the given API Key |\n| NASDAQ_DATA_LINK_BASE_DOMAIN | The SDK will configure itself to use the provided domain |\n\n### Local API Key Environment Variable\n\nIf you wish to store your API as an environment variable, you can do so by setting `NASDAQ_DATA_LINK_API_KEY`.  If set, NASDAQ_DATA_LINK_API_KEY will take precedence over the API Key file mentioned below.\n\n### Local API Key file\n\nThe default configuration file location is `~/.nasdaq/data_link_apikey`.  The\nclient will attempt to load this file if it exists.  Note: if the file exists\nand empty, a ValueError will be thrown.\n\n#### Alternative API Key file location\n\nSince 1.0.1, the `nasdaq-data-link` module will attempt to autoload your API Key. If you prefer to store it in another location, you must\nexplicitly call `read_key()` with a custom path.  See below:\n\n```python\nimport nasdaqdatalink\nnasdaqdatalink.read_key(filename=\"/data/.corporatenasdaqdatalinkapikey\")\n```\n\n## Retrieving Data\n\nThere are two methods for retrieving data in Python: the Quick method and the Detailed method. The latter is more suitable to application programming. Both methods work with Nasdaq Data Link's two types of data structures: time-series (dataset) data and non-time series (datatable).\n\nThe following quick call can be used to retrieve a dataset:\n\n```python\nimport nasdaqdatalink\ndata = nasdaqdatalink.get('NSE/OIL')\n```\n\nThis example finds all data points for the dataset `NSE/OIL` and stores them in a pandas dataframe. You can then view the dataframe with data.head().\n\nA similar quick call can be used to retrieve a datatable:\n\n```python\nimport nasdaqdatalink\ndata = nasdaqdatalink.get_table('ZACKS/FC', ticker='AAPL')\n```\n\nThis example retrieves all rows for `ZACKS/FC` where `ticker='AAPL'` and stores them in a pandas dataframe. Similarly you can then view the dataframe with data.head().\n\nNote that in both examples if an `api_key` has not been set you may receive limited or sample data. You can find more details on these quick calls and others in our [Quick Method Guide](./FOR_ANALYSTS.md).\n\n### Logging\n\nCurrently, Nasdaq Data Link debug logging is limited in scope.  However, to enable debug\nlogs you can use the following snippet.\n\n```python\nimport nasdaqdatalink\nimport logging\n\nlogging.basicConfig()\n# logging.getLogger().setLevel(logging.DEBUG)  # optionally set level for\neverything.  Useful to see dependency debug info as well.\n\ndata_link_log = logging.getLogger(\"nasdaqdatalink\")\ndata_link_log.setLevel(logging.DEBUG)\n```\n\n### Detailed Usage\n\nOur API can provide more than just data. It can also be used to search and provide metadata or to programmatically retrieve data. For these more advanced techniques please follow our [Detailed Method Guide](./FOR_DEVELOPERS.md).\n\n## Local Development\n\n### Setup\n\nIf you wish to work on local development please clone/fork the git repo and use `pip install -r requirements.txt` to setup the project.\n\n### Testing\n\nWe recommend the following tools for testing any changes:\n\n* [nose](https://nose.readthedocs.org/en/latest/) for running tests.\n* [tox](https://pypi.python.org/pypi/tox) for testing against multiple versions of python.\n* [flake8](https://flake8.readthedocs.org/en/latest/) for syntax checking.\n* [virtualenv](https://virtualenv.pypa.io/en/latest/) for use with tox virtualization.\n\nThe following are instructions for running our tests:\n\n1. Make sure a version of 3.x is installed locally in your system. To avoid permission issues on OSX we recommend installing the packages from: https://www.python.org/downloads/\n2. Install `virtualenv` and `tox` using:\n    `pip install tox virtualenv`\n3. Run following command (you may notice slow performance the first time):\n    `python setup.py install`\n4. Run the following command to test the plugin in all versions of python we support:\n    `tox`\n\nOnce you have all required packages installed, you can run tests locally with:\n\nRunning all tests locally\n\n```python\npython -W always setup.py -q test\n```\n\nRunning an individual test\n\n```python\npython -m unittest test.[test file name].[class name].[individual test name]`\n```\n\nExample:\n\n```python\npython -m unittest -v test.test_datatable.ExportDataTableTest.test_download_get_file_info\n```\n\n## Recommended Usage\n\nWe would suggest downloading the data in raw format in the highest frequency possible and performing any data manipulation\nin pandas itself.\n\nSee [this link](http://pandas.pydata.org/pandas-docs/dev/timeseries.html) for more information about timeseries in pandas.\n\n## Release the Package\n\nTo release the package, you can follow the instructions on this [page](https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects)\n\n## Additional Links\n\n* [Nasdaq Data Link](https://data.nasdaq.com)\n* [Nasdaq Data Link Tools](https://data.nasdaq.com/tools/full-list)\n* [API Docs](https://docs.data.nasdaq.com/docs)\n\n## License\n\n[MIT License](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasdaq%2Fdata-link-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnasdaq%2Fdata-link-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasdaq%2Fdata-link-python/lists"}