asottile / pyupgrade

A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
MIT License
3.5k stars 177 forks source link

Is there a python API to call pyupgrade? #922

Closed dazza-codes closed 9 months ago

dazza-codes commented 9 months ago

Is there a python API to call pyupgrade? The project README doesn't document one (unless I missed it).

dazza-codes commented 9 months ago

In https://github.com/asottile/pyupgrade/blob/main/tests/main_test.py is uses a private pyupgrade._main() entry point. Must it be private? Is there no public API to run it programmatically? Is it preferred to run it as a CLI, MUST it be run as a CLI (e.g. subprocess.run)

asottile commented 9 months ago

there intentionally is not. there are duplicates please search next time