Environment Variables

Manage environment variables in your Scrapybara instance

1

Start an instance

1from scrapybara import Scrapybara
2
3client = Scrapybara(api_key="your_api_key")
4instance = client.start(instance_type="small")
2

Set environment variables

1# Set one or more environment variables
2instance.env.set(
3 variables={
4 "API_KEY": "secret_key",
5 "DEBUG": "true",
6 "DATABASE_URL": "postgresql://localhost:5432/db"
7 }
8)
3

Get environment variables

1# Get all environment variables
2response = instance.env.get()
3env_vars = response.variables
4

Delete environment variables

1# Delete specific environment variables
2instance.env.delete(
3 keys=["API_KEY", "DEBUG"]
4)
Built with