Uber is going to court seeking to block San Francisco from forcing it to provide the names and addresses of its drivers.

The city wants the information so it can notify drivers that they are required to get business licenses, just like all other small enterprises in the city, from nail salons to freelance writers. But Uber, which previously has provided the information for city audits, says it wants to protect its drivers’ privacy.

“The tax collector’s office is asking us to give them personal information of drivers — including their home address — without their consent and will put that information on a public website,” Wayne Ting, general manager of Uber Northern California, said in a statement. “We’ve asked the city to allow us to get the consent of drivers and to remove their personal information from the public website, but they have refused.”

Uber filed a petition in San Francisco Superior Court on Monday, and said it plans to file a motion to quash a subpoena on Tuesday.

“Uber’s suit against the City and County is nothing but an attempt to circumvent the tax laws that apply to all businesses in San Francisco,” José Cisneros, San Francisco treasurer, said in a statement. “I will continue to fairly enforce the law and collect taxes — and I look forward to our day in court.”

According to the motion, San Francisco’s tax collector served Uber with a subpoena in February demanding that it provide contact information for all drivers who used its service in the last six months of 2016. After some back-and-forth with Uber, the tax collector modified the subpoena to cover drivers who worked in San Francisco for at least seven days between July 2016 and March 2017.

The treasurer’s office set off a firestorm of controversy a year ago when it said that Uber and Lyft drivers, as independent contractors, must pay $91 a year for business licenses. Uber and Lyft subsequently revealed that they provided the office with driver information as part of city audits.

Over the past year, the treasurer has sent letters to some 57,000 Uber and Lyft drivers. About 20,000 have registered with the city. Another 12,000 or so said they are no longer driving, had already registered or considered themselves employees. That leaves about 25,000 unaccounted for.

Lyft, which was not a party to the petition, did not respond to a request for comment.

There are some steps drivers can take to keep their personal information from public view on the website of registered businesses, according to Amanda Kahn Fried, a spokeswoman for the treasurer. Drivers and other small businesses can shield their addresses by using post office boxes when they register with the city, and can shield their names by registering through a business name. However, both those steps require a level of knowledge and sophistication that many drivers may lack.

“When I went to the website (to register for a business license) I stopped dead in my tracks because they wanted me to put my home address down and disclosed it would be made publicly available on a website,” said Amber Scott, a Vallejo resident who drives about 60 hours a week for Uber, about half of it in San Francisco.

In the Bay Area, San Jose also requires a business license from drivers. Scott worries that other cities like Oakland might also impose a registration fee on drivers, seeing this as a handy new source of revenue.

“I don’t mind paying for a business license, but definitely not for every single city I end up in,” she said. “It could become cost-prohibitive. The number of cities I do pickups or drop-offs in during even one particular shift could be more than I can count on one hand.”

A bill pending before the state Legislature, SB182, would alleviate such fears by allowing ride-hail drivers to obtain a single business license to operate in all cities and counties statewide. Drivers could choose where they want to get that license.

San Francisco and other cities say the bill would undermine their authority. “These drivers add to the wear and tear on city streets as well as require additional law enforcement and other on-street enforcement staff due to the high volume of infractions,” the city wrote in a letter opposing it.

But Mike Montgomery, executive director of CALinnovates, a technology advocacy coalition that counts Uber among its members, said his group supports it.

“SB182 starts to look at simplifying and solving the problem for gig-economy entrepreneurs,” he said. “Maybe it should be expanded for plumbers and graphic designers and dog walkers.”

Carolyn Said is a San Francisco Chronicle staff writer. Email: csaid@sfchronicle.com Twitter: @csaid