Repository navigation
Kian Kyars edited this page Jul 8, 2025
·
3 revisions
Python Packaging Interface Summary for FLE
- Users:
uv add factorio-learning-environment - Then:
import gym; env = gym.make("Lab"); env.run() - All config, Docker, and setup handled automatically—no FLE codebase knowledge needed.
-
CLI Bootstrapping
- Add
fle initto scaffold configs and.env. - Add
fle docker-setupfor Docker automation. - Print clear next steps after CLI commands.
- Add
-
Config & .env Handling
- Auto-load
.env(withpython-dotenv). - Allow all config via env vars as fallback/override.
- Fail with clear, actionable errors if required config/env vars are missing.
- Auto-load
-
Config (
fle/config.py):- Use Pydantic for config models and validation.
- Use
python-dotenvto load.env. - Provide
validate_for_experiment()for FLE-specific checks.
uv add factorio-learning-environment
fle init # Scaffold configs and .env
fle cluster # Setup Docker
fle eval # Run experimentor
from fle.core import FLECore
fle = FLECore() # Loads config, validates setup
fle.run_experiment(...) # Run directly in Python- Current config/.env setup requires FLE codebase knowledge—this will be fixed by packaging all needed files and providing CLI scaffolding.
- All config validation and loading will use Pydantic + python-dotenv (no custom code).
- CLI and Python API will share the same core logic for config, validation, and running experiments.
- After these changes, FLE will be truly "pip install and go" for both CLI and Python users.