API¶
- class eu5.Building(*, building_id: int, data: dict[str, Any], save: Save)¶
- property base_cost: float¶
- property base_production_efficiency: float¶
- calculate_production_efficiency(method_ids: set[str] | None = None, level: int | None = None) float¶
- property current_methods: set[str]¶
- property employment: float¶
- property level: int¶
- property methods: dict[str, ProductionMethod]¶
- property methods_groups: tuple[set[str], ...]¶
- property name: str¶
- property pop_type: str¶
- property slug: str¶
- property template: BuildingTemplate¶
- class eu5.BuildingTemplate(slug: 'str', category: 'str | None', pop_type: 'str', build_time: 'str | None', employment_size: 'float', expensive: 'bool', increase_per_level_cost: 'float | None', allow: 'dict[str, Any]', construction_demand: 'str | None', modifiers: 'Mapping[str, float]', min_age: 'int', method_groups: 'tuple[set[str], ...]', methods: 'dict[str, ProductionMethod]', supports_country: 'Callable[[Country], bool]', supports_location: 'Callable[[Location], bool]', get_max_level: 'Callable[[Location], int]')¶
- property advance: str | None¶
- property base_cost: float¶
- classmethod from_data(data: dict[str, Any], building_type: str, min_age: int) BuildingTemplate¶
- classmethod from_slug(building_id: str) BuildingTemplate¶
- property name: str¶
- slug: str¶
- category: str | None¶
- pop_type: str¶
- build_time: str | None¶
- employment_size: float¶
- expensive: bool¶
- increase_per_level_cost: float | None¶
- allow: dict[str, Any]¶
- construction_demand: str | None¶
- modifiers: Mapping[str, float]¶
- min_age: int¶
- method_groups: tuple[set[str], ...]¶
- methods: dict[str, ProductionMethod]¶
- class eu5.Character(character_id: 'int', data: 'dict[str, Any]', save: 'Save')¶
- property adm: int¶
- property dip: int¶
- property mil: int¶
- class eu5.Construction(save: Save, data: dict[str, Any])¶
- classmethod from_save(save: Save, data: dict[str, Any]) Construction¶
- class eu5.Country(country_id: int, is_great_power: bool, data: dict[str, Any], save: Save)¶
-
- property advances: set[str]¶
- property expected_army_size: int¶
- property gold: float¶
- property government_type: str¶
- property institutions: set[str]¶
- property laws: dict[str, str]¶
- property monthly_income: float¶
- property name: str¶
- property population: float¶
1.0 represents 1 000 people.
- property prestige: float¶
- property privileges: set[str]¶
- property reforms: set[str]¶
- property societal_values: SocietalValues¶
- property stability: float¶
- property tax_rates: dict[str, float]¶
- class eu5.Good(id: 'str', base_price: 'float', method: 'str | None', category: 'str | None')¶
-
- property name: str¶
- id: str¶
- base_price: float¶
- method: str | None¶
- category: str | None¶
- class eu5.Location(location_id: int, data: dict[str, Any], save: Save)¶
- average_literacy(pop_type: str) float¶
Calculate the average literacy for pops of a given type.
- Args:
pop_type: The pop type to filter by (e.g., “laborers”, “clergy”, “nobles”, “peasants”)
- Returns:
The weighted average literacy, or None if no pops of that type exist or pops is not available.
- property building_cost_multiplier: float¶
- property buildings: dict[str, Building | BuildingTemplate]¶
- property constructions: dict[int, Construction]¶
- property control: float¶
- property development: float¶
- property estate_tax: dict[str, float]¶
Get the tax contribution from each estate.
- Returns:
Dictionary mapping estate names (e.g., “nobles”, “clergy”, “burghers”, “peasants”) to their tax contribution value, truncated to 4 decimal places.
- property good: MarketGood | None¶
- property has_river: bool¶
- property is_capital: bool¶
- property market_access: float¶
- property name: str¶
- property population: float¶
- property proximity: float¶
- property rank: str¶
- property slug: str¶
- supports_building_template(building_template: BuildingTemplate) bool¶
- property tax_cut: float¶
Share of a location’s tax base that reaches the crown.
- property vegetation: str | None¶
- class eu5.Market(market_id: int, data: dict[str, Any], save: Save)¶
-
- property goods: dict[str, MarketGood]¶
- property name: str¶
- class eu5.MarketGood(good_id: str, data: dict[str, Any], save: Save, market: Market)¶
- classmethod calculate_target_price(good_id: str, *, effective_supply: float, effective_demand: float) float¶
- property demand: float¶
- property effective_demand: float¶
- property effective_supply: float¶
- property name: str¶
- property price: float¶
- property supply: float¶
- property target_price: float¶
- good_id: str¶
- class eu5.Pop(pop_id: int, data: dict[str, Any], save: Save)¶
-
- property literacy: float¶
- property satisfaction: float¶
- property size: float¶
- property type: float¶
- class eu5.Production(supply: float = 0.0, demand: float = 0.0)¶
- demand: float = 0.0¶
- supply: float = 0.0¶
- class eu5.ProductionMethod(id: 'str', produced_good: 'str | None', output: 'float', inputs: 'Mapping[str, float]', category: 'str | None')¶
- classmethod from_data(method_id: str, payload: Mapping[str, object]) ProductionMethod¶
- id: str¶
- produced_good: str | None¶
- output: float¶
- inputs: Mapping[str, float]¶
- category: str | None¶
- class eu5.Rgo(location: Location, data: dict[str, Any])¶
- property income_multiplier: float¶
- property level_cost: float¶
Calculate the cost to build one more RGO level.
The cost is based on lumber price (or tools price for lumber RGOs) in the location’s market, with a base cost of 50 ducats.
Formula: - If current_price == base_price: return 50 - If current_price > base_price: return 50 * (1 + (current_price / base_price - 1) / 3), truncated to 4 decimals - Otherwise: return min(50 * (1 + (base_price - current_price_truncated_to_3_decimals) * 3), 33.5)
- property level_income: float¶
- property output_multiplier: float¶
- property output_per_level: float¶
- class eu5.Save(save_path: str)¶
-
- property constructions: dict[int, Construction]¶
- property constructions_by_location: dict[int, dict[int, Construction]]¶
- property last_modified: datetime¶
- location_slug_from_id(location_id: int) str¶
- property name: str¶
- class eu5.SocietalValues(data: dict[str, float])¶