IPython: Productive Interactive Computing - An advanced interactive computing environment and command shell for Python.
86
Build a Python application that generates custom IPython configuration profiles for different development environments (development, production, and testing). The application should create profile directories with properly configured settings that control IPython's interactive behavior.
Your application should support three distinct profiles:
Each profile must configure the following IPython behaviors:
Display Settings
Auto-completion and Suggestions
History Management
Execution Behavior
Create a Python module profile_generator.py with the following:
A ProfileConfig class that holds configuration settings for a profile
A generate_profile(profile_name: str, config: ProfileConfig, output_dir: str) -> None function that:
Profile-specific configurations:
The generated configuration file should be valid Python code that IPython can load. Use the proper IPython configuration object structure (accessing c.InteractiveShell and related trait objects).
Provides the interactive Python environment and configuration system. Use the traitlets-based configuration to control IPython behavior.
Input: Generate a development profile
config = ProfileConfig(
max_display_items=100,
color_scheme='Linux',
auto_suggestions=True,
history_enabled=True,
history_length=10000,
autoindent=True,
confirm_exit=False,
automagic=True
)
generate_profile('profile_dev', config, '/tmp/test_profiles')Expected Output:
/tmp/test_profiles/profile_dev is created/tmp/test_profiles/profile_dev/ipython_config.py existsInput: Generate a production profile with minimal features
config = ProfileConfig(
max_display_items=20,
color_scheme='NoColor',
auto_suggestions=False,
history_enabled=False,
autoindent=False,
confirm_exit=True,
automagic=False
)
generate_profile('profile_prod', config, '/tmp/test_profiles')Expected Output:
/tmp/test_profiles/profile_prod is createdInput: Generate a testing profile for reproducible test runs
config = ProfileConfig(
max_display_items=50,
color_scheme='Neutral',
auto_suggestions=False,
history_enabled=False,
autoindent=True,
confirm_exit=False,
automagic=False
)
generate_profile('profile_test', config, '/tmp/test_profiles')Expected Output:
/tmp/test_profiles/profile_test is createdCreate a test file test_profile_generator.py that validates:
Run tests using pytest:
pytest test_profile_generator.py -vInstall with Tessl CLI
npx tessl i tessl/pypi-ipythondocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10