Genius class should automatically check for token environment variable
See original GitHub issueIs your feature request related to a problem? Please describe.
No problem, it’s just a hassle to retrieve your client access token from os
each time you use lyricsgenius
.
Describe the solution you’d like
If the user doesn’t pass a user token to Genius
, the class should check the OS environment variables for GENIUS_ACCESS_TOKEN
.
Describe alternatives you’ve considered There are no alternatives.
Additional context Probably here is where you’d modify the code.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
geniusr: the basics - Ewenme
Pass your access token to a GENIUS_API_TOKEN environment variable by explicitly calling the genius_token() function, or when prompted by other functions. Once ...
Read more >Set Bearer Token as Environment Variable in Postman for All ...
Once you set up everything properly click on send button. Then you will be able to see the token value is properly store...
Read more >Environment variables containing newlines in Node?
It must be that your PRIVATE_KEY variable doesn't contain actual newlines, but \n literals (a \ char. followed by char. n ). If...
Read more >Spring Boot Token based Authentication with Spring Security ...
Tables that we define in models package will be automatically generated in Database. If you check MySQL database for example, you can see...
Read more >How to Collect Song Lyrics with Python | by emakpati
We'll first start by importing lyricsgenius. import lyricsgenius as lg. We also need to create a variable for the path to the file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The only case that could lead to confusion is that if the user passes no token, but has an invalid token in their env var, and then tries to use an endpoint using the developers API. Should we print a message in that case? Something like this:
It’s probably better for the package to rely on the API as much as possible as you said. And since the token-less branch is complete, I’ll just leave it on my fork. I’ll update #162 soon.