Content-Length: 330958 | pFad | http://github.com/Nasdaq/data-link-python/pull/22/commits/e87eee2d202242bea94cf09a60658388d070bf31

BD add AuthorizedSession by runawaycoast · Pull Request #22 · Nasdaq/data-link-python · GitHub
Skip to content

add AuthorizedSession #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix lint, add doc for AuthorizedSession
  • Loading branch information
runawaycoast committed Aug 16, 2022
commit e87eee2d202242bea94cf09a60658388d070bf31
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ data_link_log = logging.getLogger("nasdaqdatalink")
data_link_log.setLevel(logging.DEBUG)
```

### Session

By default, every API request will create a new session; This will have a performance impact when you wish to make multiple requests(see #16). You can use `AuthorizedSession` to take advantage of the reusing session:

```python
import nasdaqdatalink
session = nasdaqdatalink.AuthorizedSession()
data1 = session.get_table('ZACKS/FC', ticker='AAPL')
data2 = session.get_table('ZACKS/FC', ticker='MFST')
data3 = session.get_table('ZACKS/FC', ticker='NVDA')
```

### Detailed Usage

Our 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).
Expand Down
4 changes: 2 additions & 2 deletions test/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def test_non_data_link_error(self, request_method):
httpretty.register_uri(getattr(httpretty, request_method),
"https://data.nasdaq.com/api/v3/databases",
body=json.dumps(
{'foobar':
{'code': 'blah', 'message': 'something went wrong'}}), status=500)
{'foobar':
{'code': 'blah', 'message': 'something went wrong'}}), status=500)
self.assertRaises(
DataLinkError, lambda: Connection.request(request_method, 'databases'))

Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Nasdaq/data-link-python/pull/22/commits/e87eee2d202242bea94cf09a60658388d070bf31

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy