This was basically in the starting square. Maybe I'm not as hardcore a player as other people here, but I was getting smashed by these fleets for quite awhile before I made a ship capable of defending myself.
I did eventually go digging around in pirateattack.lua myself and made some simple changes. I understand a lot of this is probably my preference and there's nothing necessarily wrong with these things:
I turned off the two hardest pirate attacks, the ones with the mothership bosses, completely (at least until I get closer to the center and would expect such attacks). Regardless of how beefy I made myself, those things along with the multitude of pirates/raiders were death sentences. The fact that they spawned every 1 in 5 attacks was a little much for me.
I removed about 1-3 generated ships from each attack type. I essentially wanted the first couple threat levels being no harder than the vanilla attacks, so I could at least start the game in relative peace.
I know this is a vanilla number, but I increased the updatetime by a hefty amount so I wouldn't get attacked so often. I'm not sure why pirates are so interested in shitty little iron ships. I think it could be cool to scale that number as you get closer to the center of the galaxy.
Lastly, I modified how the threatlvl was calculated. This I DO believe is something that is flawed. As you have it now, it simply multiplies rndscale by attacktype, meaning an attacktype of 1 with a rndscale of 10 is equivalent to an attacktype of 10 with a rndscale of 1. I think the pirate type contributes WAY more to how tough that pirate is instead of their scaling. Plus, there are a ton more ships at higher attack types. I changed the threatlvl to be 3 * rndscale + 7 * attacktype.
Anyway, I look forward to what you add in future versions.