用于导入语句的python文件格式化程序

ImportDoctor的Python项目详细描述


#安装 PIP安装导入器 #用法 从导入器导入导入器 ###基本 importdoctor.run(文件名) ###高级的 此示例创建一个医生并将设置更改为符合pep8[readaucky]。 然后它分析一个文件,将所有信息拉到类中。最后,我们对导入进行排序,并将所有数据写入目标文件。 ` doc = ImportDoctor() doc.order_alphabetically = True doc.wrap_depth = 79 doc.wrap_strict = True doc.comment_names = False doc.analyze(filename) doc.sort_imports() doc.remap(destination_filename) ` ###控件 以下是打算在外部使用的所有控件的列表。 我已经包括了它们的默认值(参见regex模式的代码)以及一个简短的描述。最终会有更多。 ` ignore_indented = True      # Grabs indented imports if false group_by_module_type = True # Separates system modules from local ones descending = True           # Primary order on sort: True => BIG to small one_import_per_line = True  # Separates grouped imports onto their own lines exclude_from = True         # Sort on string before 'import' for 'from' imports import_ontop = True         # Place all 'from' imports below standard imports wrap_strict = False         # If true, wrap_depth will be strictly enforced wrap_depth = 0              # If > 25, lines will be wrapped using a backslash comment_names = True        # If true, groups will be named in comments above group order_alphabetically = False# If true, imports are sortend alphabetically, not on length regex_find_import = ...     # The compiled regular expression for finding lines like 'import A' regex_find_from = ...       # The compiled regular expression for finding like 'from A import B' isolated_groups = []        # A list of modules that will be grouped and sorted separately from other imports `

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java将多个线程中的函数放入单个队列   数组在Java中,如何在不改变整数顺序的情况下找到整数组的顺序?   java控制器属于表示层?   java Apache Ivy和本地Maven repo如何处理使用Maven 3构建的快照   Java可与泛型类型进行比较   java这个表达式在泛型中是什么意思   JavaEclipse和TeamCity插件   java检测构造函数中的final是否为空   java如何在StanfordCoreNLP管道中同时使用词汇化和依赖性解析器?   java在AntUnit控制台日志中显示完整异常堆栈跟踪   lambda如何与Java 8供应商建立连锁关系   如何让GRPC的重试机制在Kubernetes集群中使用grpcjava工作?   如何使用openjdk:7 Docker映像和Gradle包装器避免“EC参数错误”?   java将集合映射扩展为一维映射新的“无法推断函数接口类型”