Skip to content
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

Have AlchemiscaleClient automatically pull settings from the environment #355

Open
jthorton opened this issue Feb 5, 2025 · 2 comments
Open

Comments

@jthorton
Copy link

jthorton commented Feb 5, 2025

I currently store my alchemiscale key, identifier and url in environment variables and find that I often have to write the same bit of code to get them from the environment and create the client object like so

import os
from alchemiscale import AlchemiscaleClient
client = AlchemiscaleClient(api_url=os.environ["ALCHEMISCALE_URL"], key=os.environ["ALCHEMISCALE_KEY"], identifier=os.environ["ALCHEMISCALE_ID"])

however it would be great if we could have the client do this automatically if the variables are present. We currently do this in asap-alchemy which helps when building a CLI which interacts with alchemiscale. Porting this to alchemiscale would be great and save packages from reimplementing this.

In broad terms, what are you trying to do?

Briefly detail what you have already tried

Describe the new feature(s) that would help you to achieve this

@mikemhenry
Copy link
Collaborator

Is your proposal that

client = AlchemiscaleClient()

Would just work if those environment variables exist?

@dotsdl
Copy link
Member

dotsdl commented Feb 12, 2025

Thanks @jthorton! I've added this to the 0.6.1 milestone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants