Skip to content

Commit

Permalink
Update TFL API token variable name to api_token in rest_client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mnbf9rca authored Jul 15, 2024
1 parent 4cce3a9 commit 2b97711
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ pip install pydantic-tfl-api

Uses Pydantic so you can use the `model_dump_json()` method to fully expand all the objects in the result. See [Pydantic documentation](https://docs.pydantic.dev/latest/) for more help.

You can obtain an API key from [your profile page on the API portal](https://api-portal.tfl.gov.uk/profile) although you only need this if doing more than a dozen or so requests per minute.

```python
from pydantic_tfl_api.client import Client

app_id = 'APPLICATION ID'
app_key = 'APPLICATION KEY'

token = "your_secret_token"
token = "your_secret_token from https://api-portal.tfl.gov.uk/profile"

client = Client(token)
print (client.get_line_meta_modes())
Expand Down
2 changes: 0 additions & 2 deletions pydantic_tfl_api/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,4 @@ def _get_request_headers(self):
def _get_query_strings(self, params):
if params is None:
params = {}
# if self.api_token is not None:
# params.update(self.api_token)
return urlencode(params)

0 comments on commit 2b97711

Please sign in to comment.