The first week of school ended with some sunny financial news for the School District of Philadelphia.

The credit-rating agency Moody's upgraded the district's bond rating for the first time since 2010 — and shifted its long-term outlook on the district's financial health from "stable" to "positive."

The district's new bond rating, Ba2, still qualifies as "non-investment grade," known informally as a junk rating. But the upward revision suggests Moody's sees hope in the district after years of financial misery.

Analysts praised district leadership in its credit opinion.

"The upgrade of the underlying rating to Ba2 speaks to considerable improvement in the district's still strained financial position," analysts wrote. "Management is experienced, and though some are new to the district, the team has developed a detailed understanding not only of the district's finances but also of charter pressures and the complexities of managing a highly dynamic, large, urban school district."

The change in rating should help Pennsylvania's school system attract more buyers when it sells its debt in the future. More potential buyers would, theoretically, allow the district to get a lower interest rate on its loans. A lower interest rate would, in turn, allow the district to borrow more, potentially easing its long-term money woes.

"If we can maintain this positive direction it will enable us to borrow money at a cheaper rate," said district CFO Uri Monson.

As a matter of good fiscal planning, the district strives to dedicate about 10 percent of its spending to debt service, Monson said.

Perhaps more interesting than the rating adjustment was Moody's rationale for making the move.

Under "credit strengths," Moody's noted that the percent of student attending charter schools had held steady the last three years and that they expected a "continued flat trend" for 2017-18. Moody's also pointed to three years of operating surpluses, "improving" city demographics, and solid management.

Moody's did, however, underscore a number of financial weaknesses that will ring familiar to those who follow Philadelphia's education scene.

Analysts noted the district doesn't control its own revenues — relying instead on city and state lawmakers — and projects to have a deficit by 2018-19. Moody's also worries about the district's charter obligations, which it called a "significant fixed cost." This school year, Philly will send about $814 million to charter schools.

Last fall, Moody's revised the district's fiscal outlook from "negative" to "stable." It was the first time Moody's had upgraded the district's outlook since 2010, according to the district.

Appraising Philadelphia as a whole, analysts see good trends set against stubborn barriers.

Increasing development and a bumper crop of millennials signal economic hope. But the city's enduringly high poverty rate remains worrisome, analysts said.