re-common 0.2.53__tar.gz → 0.2.54__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {re_common-0.2.53 → re_common-0.2.54}/PKG-INFO +1 -5
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/image_to_pdf.py +61 -61
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseboto3.py +102 -8
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/core/requests_core.py +103 -103
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/my_abc/better_abc.py +32 -32
- {re_common-0.2.53 → re_common-0.2.54}/re_common.egg-info/PKG-INFO +2 -6
- {re_common-0.2.53 → re_common-0.2.54}/setup.py +3 -2
- {re_common-0.2.53 → re_common-0.2.54}/LICENSE +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/README.md +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/baseabs/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/baseabs/baseabs.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/database/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/database/mbuilder.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/database/moudle.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/database/msqlite3.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/database/mysql.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/database/sql_factory.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/mthread/MThreadingRun.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/mthread/MThreadingRunEvent.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/mthread/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/mthread/mythreading.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/pakge_other/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/pakge_other/socks.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/readconfig/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/readconfig/config_factory.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/readconfig/ini_config.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/readconfig/toml_config.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/temporary/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/temporary/envdata.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/all_requests/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/all_requests/aiohttp_request.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/all_requests/httpx_requet.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/all_requests/mrequest.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/all_requests/requests_request.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/batch_compre/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/batch_compre/bijiao_batch.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/contrast_db3.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/copy_file.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/db3_2_sizedb3.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/foreachgz.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/get_attr.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/java_code_deal.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/javacode.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mdb_db3.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/merge_file.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/merge_gz_file.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mhdfstools/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mhdfstools/down_hdfs_files.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mhdfstools/hdfst.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mhdfstools/up_hdfs_files.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mongo_tools.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/move_file.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/move_mongo/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/move_mongo/mongo_table_to_file.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/move_mongo/move_mongo_table.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/move_mongo/use_mttf.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/move_mongo/use_mv.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mpandas/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mpandas/mpandasreadexcel.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/mpandas/pandas_visualization.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/myparsel.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/rename_dir_file.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/sequoiadb_utils.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/split_line_to_many.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/stringtodicts.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/tools/workwechant_bot.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseaiohttp.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseaiomysql.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseallstep.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseavro.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basecsv.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basedict.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basedir.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseencode.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseencoding.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseesdsl.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseexcel.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseexcept.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basefile.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseftp.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basegzip.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basehdfs.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basehttpx.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseip.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basejson.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baselist.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basemotor.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basemssql.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseodbc.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basepandas.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basepeewee.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basepika.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basepydash.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basepymongo.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basequeue.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baserar.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baserequest.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseset.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basesmb.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basestring.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basetime.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basetuple.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/baseurl.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/basezip.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/core/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/core/bottomutils.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/core/mdeprecated.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/core/mlamada.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/core/msginfo.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/fateadm.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/importfun.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/mfaker.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/my_abc/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/mylogger.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/myredisclient.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/pipupgrade.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/ringlist.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/version_compare.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/baselibrary/utils/ydmhttp.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/lazy_import.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/loggerfacade.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/mysqlfacade.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/now.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/sqlite3facade.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/use/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/use/mq_use_facade.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/facade/use/proxy_use_facade.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/base_dict_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/baseavro_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/basefile_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/basemssql_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/baseodbc_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/basepandas_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/get_attr_test/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/get_attr_test/get_attr_test_settings.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/get_attr_test/settings.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/idencode_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/iniconfig_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/ip_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/merge_file_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/mfaker_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/mm3_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/mylogger_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/myparsel_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/mysql_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/pymongo_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/split_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/sqlite3_merge_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/sqlite3_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/tomlconfig_test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/use_tools_test/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/libtest/user/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/assignment_expressions.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/mydash/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/mydash/test1.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/pydashstudio/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/pydashstudio/first.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/streamlitstudio/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/streamlitstudio/first_app.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/streamlitstudio/uber_pickups.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/studio/test.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/base_step_process.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/baseencodeid.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/changetaskname.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/core_var.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/mmh3Hash.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/allproxys.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/allproxys_thread.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/cnki_proxy.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/kuaidaili.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/proxy_all.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/update_kuaidaili_0.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/wanfang_proxy.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/proxy/wp_proxy_all.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/read_rawid_to_txt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/TransformBookTitleToZt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/TransformConferenceTitleToZt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/TransformCstadTitleToZt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/TransformJournalTitleToZt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/TransformPatentTitleToZt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/TransformRegulationTitleToZt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/TransformStandardTitleToZt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/TransformThesisTitleToZt.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common/vip/title/transform/__init__.py +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common.egg-info/SOURCES.txt +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common.egg-info/dependency_links.txt +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/re_common.egg-info/top_level.txt +0 -0
- {re_common-0.2.53 → re_common-0.2.54}/setup.cfg +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: re_common
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.54
|
|
4
4
|
Summary: a library about all python projects
|
|
5
5
|
Home-page: https://gitee.com/xujiangios/re-common
|
|
6
6
|
Author: vic
|
|
7
7
|
Author-email: xujiang5@163.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Classifier: Programming Language :: Python :: 3
|
|
11
9
|
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
10
|
Classifier: Operating System :: OS Independent
|
|
@@ -16,5 +14,3 @@ License-File: LICENSE
|
|
|
16
14
|
|
|
17
15
|
|
|
18
16
|
这是一个基础类,依赖很多的第三方包,是一个用得到的第三方库的封装,可以在此基础上迅速构建项目
|
|
19
|
-
|
|
20
|
-
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
# coding = UTF-8
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# 导入Python标准库
|
|
5
|
-
import os
|
|
6
|
-
from io import BytesIO
|
|
7
|
-
|
|
8
|
-
# 导入第三方库
|
|
9
|
-
from PIL import Image
|
|
10
|
-
|
|
11
|
-
# 防止中文乱码
|
|
12
|
-
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
|
|
13
|
-
|
|
14
|
-
# 支持的图片文件格式
|
|
15
|
-
SUPPORT_SUFFIX = ["jpg", "jpeg", "png"]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def pic_to_pdf(image_bytes: bytes) -> bytes:
|
|
19
|
-
"""将单个图片转换为单张PDF
|
|
20
|
-
|
|
21
|
-
:param image_bytes: 图片的bytes对象
|
|
22
|
-
:return: PDF的bytes对象
|
|
23
|
-
"""
|
|
24
|
-
# 将bytes对象转换为BytesIO对象
|
|
25
|
-
image_bytes_io = BytesIO(image_bytes)
|
|
26
|
-
# 从内存中读取图片
|
|
27
|
-
image_object = Image.open(image_bytes_io)
|
|
28
|
-
# 打开内存中的文件用于保存PDF
|
|
29
|
-
with BytesIO() as result_bytes_io:
|
|
30
|
-
# 将图片保存为单张PDF
|
|
31
|
-
image_object.save(result_bytes_io, "PDF", resolution=100.0)
|
|
32
|
-
# 获取内存中的文件
|
|
33
|
-
data = result_bytes_io.getvalue()
|
|
34
|
-
# 返回PDF的bytes对象
|
|
35
|
-
return data
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def batch_convert(image_path: str, pdf_path: str) -> None:
|
|
39
|
-
"""批量将图片转换为单张PDF
|
|
40
|
-
|
|
41
|
-
:param image_path: 图片的文件夹
|
|
42
|
-
:param pdf_path: PDF文件保存的文件夹
|
|
43
|
-
"""
|
|
44
|
-
# 遍历文件夹下所有文件
|
|
45
|
-
for root, dirs, files in os.walk(image_path, topdown=False):
|
|
46
|
-
for name in files:
|
|
47
|
-
# 提取文件的后缀名
|
|
48
|
-
file_suffix = os.path.splitext(name)[-1].lstrip(".").lower()
|
|
49
|
-
# 检测该文件格式是否受到支持
|
|
50
|
-
if file_suffix not in SUPPORT_SUFFIX:
|
|
51
|
-
continue
|
|
52
|
-
# 拼接出图片文件的绝对路径
|
|
53
|
-
source_file_path = os.path.join(root, name)
|
|
54
|
-
# 拼接出PDF文件的绝对路径
|
|
55
|
-
target_file_path = os.path.join(pdf_path, f"{os.path.splitext(name)[0]}.pdf")
|
|
56
|
-
# 将图片文件转换为PDF文件
|
|
57
|
-
with open(source_file_path, "rb") as source:
|
|
58
|
-
with open(target_file_path, "wb") as target:
|
|
59
|
-
target.write(pic_to_pdf(source.read()))
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
# coding = UTF-8
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# 导入Python标准库
|
|
5
|
+
import os
|
|
6
|
+
from io import BytesIO
|
|
7
|
+
|
|
8
|
+
# 导入第三方库
|
|
9
|
+
from PIL import Image
|
|
10
|
+
|
|
11
|
+
# 防止中文乱码
|
|
12
|
+
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
|
|
13
|
+
|
|
14
|
+
# 支持的图片文件格式
|
|
15
|
+
SUPPORT_SUFFIX = ["jpg", "jpeg", "png"]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def pic_to_pdf(image_bytes: bytes) -> bytes:
|
|
19
|
+
"""将单个图片转换为单张PDF
|
|
20
|
+
|
|
21
|
+
:param image_bytes: 图片的bytes对象
|
|
22
|
+
:return: PDF的bytes对象
|
|
23
|
+
"""
|
|
24
|
+
# 将bytes对象转换为BytesIO对象
|
|
25
|
+
image_bytes_io = BytesIO(image_bytes)
|
|
26
|
+
# 从内存中读取图片
|
|
27
|
+
image_object = Image.open(image_bytes_io)
|
|
28
|
+
# 打开内存中的文件用于保存PDF
|
|
29
|
+
with BytesIO() as result_bytes_io:
|
|
30
|
+
# 将图片保存为单张PDF
|
|
31
|
+
image_object.save(result_bytes_io, "PDF", resolution=100.0)
|
|
32
|
+
# 获取内存中的文件
|
|
33
|
+
data = result_bytes_io.getvalue()
|
|
34
|
+
# 返回PDF的bytes对象
|
|
35
|
+
return data
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def batch_convert(image_path: str, pdf_path: str) -> None:
|
|
39
|
+
"""批量将图片转换为单张PDF
|
|
40
|
+
|
|
41
|
+
:param image_path: 图片的文件夹
|
|
42
|
+
:param pdf_path: PDF文件保存的文件夹
|
|
43
|
+
"""
|
|
44
|
+
# 遍历文件夹下所有文件
|
|
45
|
+
for root, dirs, files in os.walk(image_path, topdown=False):
|
|
46
|
+
for name in files:
|
|
47
|
+
# 提取文件的后缀名
|
|
48
|
+
file_suffix = os.path.splitext(name)[-1].lstrip(".").lower()
|
|
49
|
+
# 检测该文件格式是否受到支持
|
|
50
|
+
if file_suffix not in SUPPORT_SUFFIX:
|
|
51
|
+
continue
|
|
52
|
+
# 拼接出图片文件的绝对路径
|
|
53
|
+
source_file_path = os.path.join(root, name)
|
|
54
|
+
# 拼接出PDF文件的绝对路径
|
|
55
|
+
target_file_path = os.path.join(pdf_path, f"{os.path.splitext(name)[0]}.pdf")
|
|
56
|
+
# 将图片文件转换为PDF文件
|
|
57
|
+
with open(source_file_path, "rb") as source:
|
|
58
|
+
with open(target_file_path, "wb") as target:
|
|
59
|
+
target.write(pic_to_pdf(source.read()))
|
|
60
|
+
|
|
61
|
+
|
|
62
62
|
batch_convert(r"C:\Users\Administrator\Desktop\上传\zhuanhuan\20230404\新建文件夹 (5)",r"C:\Users\Administrator\Desktop\上传\zhuanhuan\20230404\pdf")
|
|
@@ -70,6 +70,7 @@ class BaseBoto3(object):
|
|
|
70
70
|
# 按名称创建资源服务客户端
|
|
71
71
|
self.client = self.session.resource('s3', endpoint_url=self.endpoint_url)
|
|
72
72
|
print(type(self.client))
|
|
73
|
+
return self
|
|
73
74
|
|
|
74
75
|
def get_all_buckets(self):
|
|
75
76
|
"""
|
|
@@ -116,6 +117,8 @@ class BaseBoto3(object):
|
|
|
116
117
|
if self.is_low_level is False:
|
|
117
118
|
self.bucket = self.client.Bucket(bucket_name)
|
|
118
119
|
return self.bucket
|
|
120
|
+
else:
|
|
121
|
+
raise Exception("无实现方法")
|
|
119
122
|
|
|
120
123
|
def get_all_obs_filter(self, Prefix):
|
|
121
124
|
"""
|
|
@@ -182,16 +185,107 @@ class BaseBoto3(object):
|
|
|
182
185
|
|
|
183
186
|
def check_exist(self, bucket_name, key):
|
|
184
187
|
"""
|
|
188
|
+
if self.is_low_level:
|
|
189
|
+
{'ResponseMetadata': {'RequestId': '17E6A65A2B299D3B', 'HostId': '', 'HTTPStatusCode': 200, 'HTTPHeaders': {'accept-ranges': 'bytes', 'content-length': '117', 'content-security-policy': 'block-all-mixed-content', 'content-type': 'binary/octet-stream', 'etag': '"2237a934f176003e41abf3d733291079"', 'last-modified': 'Thu, 25 Jul 2024 05:49:43 GMT', 'server': 'MinIO', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'vary': 'Origin, Accept-Encoding', 'x-amz-request-id': '17E6A65A2B299D3B', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'date': 'Mon, 29 Jul 2024 09:53:33 GMT'}, 'RetryAttempts': 0}, 'AcceptRanges': 'bytes', 'LastModified': datetime.datetime(2024, 7, 25, 5, 49, 43, tzinfo=tzutc()), 'ContentLength': 117, 'ETag': '"2237a934f176003e41abf3d733291079"', 'ContentType': 'binary/octet-stream', 'Metadata': {}}
|
|
185
190
|
判定文件是否存在,
|
|
186
191
|
:param bucket_name: 桶名
|
|
187
192
|
:param key: 文件key
|
|
188
193
|
:return:
|
|
189
194
|
"""
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
|
|
196
|
+
if self.is_low_level:
|
|
197
|
+
try:
|
|
198
|
+
obj_info = self.client.head_object(
|
|
199
|
+
Bucket=bucket_name,
|
|
200
|
+
Key=key
|
|
201
|
+
)
|
|
202
|
+
return obj_info
|
|
203
|
+
except:
|
|
204
|
+
return None
|
|
205
|
+
else:
|
|
206
|
+
# 获取指定存储桶
|
|
207
|
+
bucket = self.client.Bucket(bucket_name)
|
|
208
|
+
# 检查 key 是否存在
|
|
209
|
+
objs = list(bucket.objects.filter(Prefix=key))
|
|
210
|
+
if len(objs) > 0 and objs[0].key == key:
|
|
211
|
+
# [s3.ObjectSummary(bucket_name='crawl.dc.cqvip.com', key='foreign/organ/parsel_organ_log.txt')]
|
|
212
|
+
return objs[0]
|
|
213
|
+
else:
|
|
214
|
+
return None
|
|
215
|
+
|
|
216
|
+
def get_prefix_obj(self, bucket, prefix, delimiter):
|
|
217
|
+
"""
|
|
218
|
+
Bucket="crawl.dc.cqvip.com",
|
|
219
|
+
Prefix="foreign/organ/ei/",
|
|
220
|
+
Delimiter='/'
|
|
221
|
+
|
|
222
|
+
Returns:
|
|
223
|
+
|
|
224
|
+
"""
|
|
225
|
+
if self.is_low_level:
|
|
226
|
+
# for common_prefix in response.get('CommonPrefixes', []): 获取子目录
|
|
227
|
+
return self.client.list_objects_v2(Bucket=bucket,
|
|
228
|
+
Prefix=prefix,
|
|
229
|
+
Delimiter=delimiter) # 设置 Delimiter='/' 可以确保只列出目录而不是所有对象。
|
|
230
|
+
else:
|
|
231
|
+
# 该方法只能列出文件 没办法列出目录
|
|
232
|
+
# bucket_resource = self.client.Bucket(bucket)
|
|
233
|
+
# objects = bucket_resource.objects.filter(Prefix=prefix, Delimiter=delimiter)
|
|
234
|
+
# return list(objects)
|
|
235
|
+
|
|
236
|
+
bucket_resource = self.client.Bucket(bucket)
|
|
237
|
+
return bucket_resource.meta.client.list_objects_v2(Bucket=bucket,
|
|
238
|
+
Prefix=prefix,
|
|
239
|
+
Delimiter=delimiter)
|
|
240
|
+
|
|
241
|
+
def get_object_value(self, bucket_name, file_key, encoding='utf-8'):
|
|
242
|
+
"""
|
|
243
|
+
读取文本数据
|
|
244
|
+
Returns:
|
|
245
|
+
|
|
246
|
+
"""
|
|
247
|
+
if self.is_low_level:
|
|
248
|
+
obj = self.client.get_object(Bucket=bucket_name, Key=file_key)
|
|
249
|
+
body = obj['Body'].read().decode(encoding)
|
|
250
|
+
return body
|
|
251
|
+
else:
|
|
252
|
+
bucket_resource = self.client.Bucket(bucket_name)
|
|
253
|
+
obj = bucket_resource.Object(file_key)
|
|
254
|
+
body = obj.get()['Body'].read().decode(encoding)
|
|
255
|
+
return body
|
|
256
|
+
|
|
257
|
+
def put_object(self, bucket_name, key, body):
|
|
258
|
+
"""
|
|
259
|
+
直接写内容到文件
|
|
260
|
+
Args:
|
|
261
|
+
bucket_name:
|
|
262
|
+
key:
|
|
263
|
+
body: 需要 编码 .encode('utf-8')
|
|
264
|
+
|
|
265
|
+
Returns:
|
|
266
|
+
|
|
267
|
+
"""
|
|
268
|
+
if self.is_low_level:
|
|
269
|
+
self.client.put_object(Bucket=bucket_name,
|
|
270
|
+
Key=key,
|
|
271
|
+
Body=body)
|
|
272
|
+
else:
|
|
273
|
+
# 获取 Bucket 对象
|
|
274
|
+
bucket_resource = self.client.Bucket(bucket_name)
|
|
275
|
+
|
|
276
|
+
# 将内容写入文件
|
|
277
|
+
bucket_resource.put_object(Key=key, Body=body)
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
bb = BaseBoto3(aws_access_key_id="UM51J2G5ZG0FE5CCERB9",
|
|
281
|
+
aws_secret_access_key="u+OEmhE2fahF2L+oXB+HXe8IJs22Lo38icvlF+Yq",
|
|
282
|
+
endpoint_url="http://192.168.31.135:9000"
|
|
283
|
+
)
|
|
284
|
+
bb.conn_session()
|
|
285
|
+
bb.set_is_low_level(False)
|
|
286
|
+
bb.get_client()
|
|
287
|
+
|
|
288
|
+
result = bb.check_exist("crawl.dc.cqvip.com",
|
|
289
|
+
"foreign/organ/parsel_organ_log.txt")
|
|
290
|
+
|
|
291
|
+
print(result)
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36'
|
|
2
|
-
|
|
3
|
-
USER_AGENTS = [
|
|
4
|
-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
|
5
|
-
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
|
6
|
-
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)",
|
|
7
|
-
"Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.35; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
|
8
|
-
"Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)",
|
|
9
|
-
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)",
|
|
10
|
-
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)",
|
|
11
|
-
"Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)",
|
|
12
|
-
"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)",
|
|
13
|
-
"Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6",
|
|
14
|
-
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070215 K-Ninja/2.1.1",
|
|
15
|
-
"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/20080705 Firefox/3.0 Kapiko/3.0",
|
|
16
|
-
"Mozilla/5.0 (X11; Linux i686; U;) Gecko/20070322 Kazehakase/0.4.5",
|
|
17
|
-
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Fedora/1.9.0.8-1.fc10 Kazehakase/0.5.6",
|
|
18
|
-
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11",
|
|
19
|
-
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20",
|
|
20
|
-
"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52",
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
INSIDE_HEADERS = {
|
|
24
|
-
"accept": "application/json",
|
|
25
|
-
"content-type": "application/json"
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def set_proxy(proxy):
|
|
30
|
-
Proxiesss = {
|
|
31
|
-
'http': proxy,
|
|
32
|
-
'https': proxy
|
|
33
|
-
}
|
|
34
|
-
return Proxiesss
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def set_proxy_aio(proxy):
|
|
38
|
-
if proxy:
|
|
39
|
-
return r"http://" + proxy
|
|
40
|
-
return None
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def set_proxy_httpx(proxy):
|
|
44
|
-
if proxy.find("socks") > -1:
|
|
45
|
-
return proxy
|
|
46
|
-
if proxy:
|
|
47
|
-
Proxiesss = {
|
|
48
|
-
'http://': "http://" + proxy,
|
|
49
|
-
'https://': "http://" + proxy
|
|
50
|
-
}
|
|
51
|
-
return Proxiesss
|
|
52
|
-
else:
|
|
53
|
-
return None
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class MsgCode(object):
|
|
57
|
-
SUCCESS_CODE: int = 200 # 成功状态码
|
|
58
|
-
|
|
59
|
-
NO_RESOURCE: int = 421 # 网页明确表明无资源
|
|
60
|
-
PAGE_BLANK: int = 420 # 网页空白页
|
|
61
|
-
END_STRING_ERROR: int = 210 # html结尾验证错误
|
|
62
|
-
MARK_ERROR: int = 211 # 验证html错误,验证没有通过
|
|
63
|
-
NOT_IS_JSON: int = 212 # 验证返回是否是json
|
|
64
|
-
VER_CODE: int = 213 # 需要验证码
|
|
65
|
-
NONE_HTML: int = 214 # html为空 空的html 在使用某些代理时 如果https 写成了http,会有这种情况
|
|
66
|
-
STATUS_ERROR: int = 215 # API接口内部执行错误
|
|
67
|
-
CODE_ERROR: int = 216 # data 状态码错误
|
|
68
|
-
URL_TIMEOUT: int = 217
|
|
69
|
-
|
|
70
|
-
SETTING_CONFIG_ERROR: int = 251 # 特定错误 更新taskinfo_save_setting的任务控制配置失败(switch参数错误,只能为0或1)
|
|
71
|
-
|
|
72
|
-
API_FAIL_CODE: int = 400 # api失败,但具体原因未知的状态码
|
|
73
|
-
TIME_OUT_ERROR: int = 408 # 超时错误
|
|
74
|
-
PROXY_ERROR: int = 422 # 代理错误
|
|
75
|
-
PAYLOAD_ERROR: int = 423 # 非法的压缩格式,错误的chunk编码,数据不足Content-length的大小。通常为Accept-Encoding:gzip, deflate, br ,也就是三种编码格式。但其实,aiohttp默认没有br解码,或者html编码格式错误
|
|
76
|
-
SERVER_ERROR: int = 530 # 服务器异常错误,被捕获发送
|
|
77
|
-
CHAOXIN_COOKIE_ERROR: int = 556 # 超星期刊获取cookie失败
|
|
78
|
-
|
|
79
|
-
DATABASE_CONFIG_IN_CODE: int = 998 # 在代码中配置数据库无对应错误码
|
|
80
|
-
|
|
81
|
-
ON_KNOW: int = 1000 # 未知错误
|
|
82
|
-
|
|
83
|
-
MONGO_ERROR: int = 1001 # mongodb 錯誤系列由1000 到 1100
|
|
84
|
-
MONGO_NO_ID: int = 1002 # 操作时由于没有该id的状态码,比如更新时ID不存在
|
|
85
|
-
|
|
86
|
-
PARE_STRUCTURE_ERROR: int = 1101 # 解析系列由1100 到 1200,解析结构错误
|
|
87
|
-
PARE_NO_DATA: int = 1102 # 没有数据,且认为是正常的没有数据的标识
|
|
88
|
-
PARE_NO_DATA_ERR: int = 1103 # 没有数据,且认为是非正常的没有数据的标识
|
|
89
|
-
PARE_NO_DATA_1: int = 1104 #
|
|
90
|
-
PARE_NO_DATA_2: int = 1105 # 预留几个无数据,在不同库不同意义
|
|
91
|
-
PARE_NO_DATA_3: int = 1106 # 预留几个无数据,在不同库不同意义
|
|
92
|
-
SQL_INSERT_ERROR: int = 1201 # sql错误 由 1200 到 1300 insert 错误
|
|
93
|
-
SQL_UPDATE_ERROR: int = 1202 # update 错误
|
|
94
|
-
SQL_SELECT_ALL_ERROR: int = 1203 # 执行fetchall 错误
|
|
95
|
-
SQL_EXECUTEMANY_ERROR: int = 1204 # executemany 执行错误
|
|
96
|
-
SQL_EXECUTE_ERROR: int = 1205 # execute 执行错误
|
|
97
|
-
SQL_REPLACE_ERROR: int = 1206 # replace 执行错误
|
|
98
|
-
|
|
99
|
-
GRPC_MESSAGE_DECODEERROR: int = 1301 # grpc服务编码错误
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
SUCCESS = "SUCCESS"
|
|
103
|
-
FAILED = "FAILED"
|
|
1
|
+
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36'
|
|
2
|
+
|
|
3
|
+
USER_AGENTS = [
|
|
4
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
|
|
5
|
+
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
|
6
|
+
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)",
|
|
7
|
+
"Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.35; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
|
8
|
+
"Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)",
|
|
9
|
+
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)",
|
|
10
|
+
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)",
|
|
11
|
+
"Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)",
|
|
12
|
+
"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)",
|
|
13
|
+
"Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6",
|
|
14
|
+
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070215 K-Ninja/2.1.1",
|
|
15
|
+
"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/20080705 Firefox/3.0 Kapiko/3.0",
|
|
16
|
+
"Mozilla/5.0 (X11; Linux i686; U;) Gecko/20070322 Kazehakase/0.4.5",
|
|
17
|
+
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Fedora/1.9.0.8-1.fc10 Kazehakase/0.5.6",
|
|
18
|
+
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11",
|
|
19
|
+
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20",
|
|
20
|
+
"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
INSIDE_HEADERS = {
|
|
24
|
+
"accept": "application/json",
|
|
25
|
+
"content-type": "application/json"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def set_proxy(proxy):
|
|
30
|
+
Proxiesss = {
|
|
31
|
+
'http': proxy,
|
|
32
|
+
'https': proxy
|
|
33
|
+
}
|
|
34
|
+
return Proxiesss
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def set_proxy_aio(proxy):
|
|
38
|
+
if proxy:
|
|
39
|
+
return r"http://" + proxy
|
|
40
|
+
return None
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def set_proxy_httpx(proxy):
|
|
44
|
+
if proxy.find("socks") > -1:
|
|
45
|
+
return proxy
|
|
46
|
+
if proxy:
|
|
47
|
+
Proxiesss = {
|
|
48
|
+
'http://': "http://" + proxy,
|
|
49
|
+
'https://': "http://" + proxy
|
|
50
|
+
}
|
|
51
|
+
return Proxiesss
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class MsgCode(object):
|
|
57
|
+
SUCCESS_CODE: int = 200 # 成功状态码
|
|
58
|
+
|
|
59
|
+
NO_RESOURCE: int = 421 # 网页明确表明无资源
|
|
60
|
+
PAGE_BLANK: int = 420 # 网页空白页
|
|
61
|
+
END_STRING_ERROR: int = 210 # html结尾验证错误
|
|
62
|
+
MARK_ERROR: int = 211 # 验证html错误,验证没有通过
|
|
63
|
+
NOT_IS_JSON: int = 212 # 验证返回是否是json
|
|
64
|
+
VER_CODE: int = 213 # 需要验证码
|
|
65
|
+
NONE_HTML: int = 214 # html为空 空的html 在使用某些代理时 如果https 写成了http,会有这种情况
|
|
66
|
+
STATUS_ERROR: int = 215 # API接口内部执行错误
|
|
67
|
+
CODE_ERROR: int = 216 # data 状态码错误
|
|
68
|
+
URL_TIMEOUT: int = 217
|
|
69
|
+
|
|
70
|
+
SETTING_CONFIG_ERROR: int = 251 # 特定错误 更新taskinfo_save_setting的任务控制配置失败(switch参数错误,只能为0或1)
|
|
71
|
+
|
|
72
|
+
API_FAIL_CODE: int = 400 # api失败,但具体原因未知的状态码
|
|
73
|
+
TIME_OUT_ERROR: int = 408 # 超时错误
|
|
74
|
+
PROXY_ERROR: int = 422 # 代理错误
|
|
75
|
+
PAYLOAD_ERROR: int = 423 # 非法的压缩格式,错误的chunk编码,数据不足Content-length的大小。通常为Accept-Encoding:gzip, deflate, br ,也就是三种编码格式。但其实,aiohttp默认没有br解码,或者html编码格式错误
|
|
76
|
+
SERVER_ERROR: int = 530 # 服务器异常错误,被捕获发送
|
|
77
|
+
CHAOXIN_COOKIE_ERROR: int = 556 # 超星期刊获取cookie失败
|
|
78
|
+
|
|
79
|
+
DATABASE_CONFIG_IN_CODE: int = 998 # 在代码中配置数据库无对应错误码
|
|
80
|
+
|
|
81
|
+
ON_KNOW: int = 1000 # 未知错误
|
|
82
|
+
|
|
83
|
+
MONGO_ERROR: int = 1001 # mongodb 錯誤系列由1000 到 1100
|
|
84
|
+
MONGO_NO_ID: int = 1002 # 操作时由于没有该id的状态码,比如更新时ID不存在
|
|
85
|
+
|
|
86
|
+
PARE_STRUCTURE_ERROR: int = 1101 # 解析系列由1100 到 1200,解析结构错误
|
|
87
|
+
PARE_NO_DATA: int = 1102 # 没有数据,且认为是正常的没有数据的标识
|
|
88
|
+
PARE_NO_DATA_ERR: int = 1103 # 没有数据,且认为是非正常的没有数据的标识
|
|
89
|
+
PARE_NO_DATA_1: int = 1104 # 数据不全,但可以接受
|
|
90
|
+
PARE_NO_DATA_2: int = 1105 # 预留几个无数据,在不同库不同意义
|
|
91
|
+
PARE_NO_DATA_3: int = 1106 # 预留几个无数据,在不同库不同意义
|
|
92
|
+
SQL_INSERT_ERROR: int = 1201 # sql错误 由 1200 到 1300 insert 错误
|
|
93
|
+
SQL_UPDATE_ERROR: int = 1202 # update 错误
|
|
94
|
+
SQL_SELECT_ALL_ERROR: int = 1203 # 执行fetchall 错误
|
|
95
|
+
SQL_EXECUTEMANY_ERROR: int = 1204 # executemany 执行错误
|
|
96
|
+
SQL_EXECUTE_ERROR: int = 1205 # execute 执行错误
|
|
97
|
+
SQL_REPLACE_ERROR: int = 1206 # replace 执行错误
|
|
98
|
+
|
|
99
|
+
GRPC_MESSAGE_DECODEERROR: int = 1301 # grpc服务编码错误
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
SUCCESS = "SUCCESS"
|
|
103
|
+
FAILED = "FAILED"
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
from abc import ABCMeta as NativeABCMeta
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class DummyAttribute:
|
|
5
|
-
pass
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def abstract_attribute(obj=None):
|
|
9
|
-
if obj is None:
|
|
10
|
-
obj = DummyAttribute()
|
|
11
|
-
obj.__is_abstract_attribute__ = True
|
|
12
|
-
return obj
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ABCMeta(NativeABCMeta):
|
|
16
|
-
|
|
17
|
-
def __call__(cls, *args, **kwargs):
|
|
18
|
-
instance = NativeABCMeta.__call__(cls, *args, **kwargs)
|
|
19
|
-
abstract_attributes = {
|
|
20
|
-
name
|
|
21
|
-
for name in dir(instance)
|
|
22
|
-
if getattr(getattr(instance, name), '__is_abstract_attribute__', False)
|
|
23
|
-
}
|
|
24
|
-
if abstract_attributes:
|
|
25
|
-
raise NotImplementedError(
|
|
26
|
-
"Can't instantiate abstract class {} with"
|
|
27
|
-
" abstract attributes: {}".format(
|
|
28
|
-
cls.__name__,
|
|
29
|
-
', '.join(abstract_attributes)
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
return instance
|
|
1
|
+
from abc import ABCMeta as NativeABCMeta
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DummyAttribute:
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def abstract_attribute(obj=None):
|
|
9
|
+
if obj is None:
|
|
10
|
+
obj = DummyAttribute()
|
|
11
|
+
obj.__is_abstract_attribute__ = True
|
|
12
|
+
return obj
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ABCMeta(NativeABCMeta):
|
|
16
|
+
|
|
17
|
+
def __call__(cls, *args, **kwargs):
|
|
18
|
+
instance = NativeABCMeta.__call__(cls, *args, **kwargs)
|
|
19
|
+
abstract_attributes = {
|
|
20
|
+
name
|
|
21
|
+
for name in dir(instance)
|
|
22
|
+
if getattr(getattr(instance, name), '__is_abstract_attribute__', False)
|
|
23
|
+
}
|
|
24
|
+
if abstract_attributes:
|
|
25
|
+
raise NotImplementedError(
|
|
26
|
+
"Can't instantiate abstract class {} with"
|
|
27
|
+
" abstract attributes: {}".format(
|
|
28
|
+
cls.__name__,
|
|
29
|
+
', '.join(abstract_attributes)
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
return instance
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name:
|
|
3
|
-
Version: 0.2.
|
|
2
|
+
Name: re_common
|
|
3
|
+
Version: 0.2.54
|
|
4
4
|
Summary: a library about all python projects
|
|
5
5
|
Home-page: https://gitee.com/xujiangios/re-common
|
|
6
6
|
Author: vic
|
|
7
7
|
Author-email: xujiang5@163.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Classifier: Programming Language :: Python :: 3
|
|
11
9
|
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
10
|
Classifier: Operating System :: OS Independent
|
|
@@ -16,5 +14,3 @@ License-File: LICENSE
|
|
|
16
14
|
|
|
17
15
|
|
|
18
16
|
这是一个基础类,依赖很多的第三方包,是一个用得到的第三方库的封装,可以在此基础上迅速构建项目
|
|
19
|
-
|
|
20
|
-
|
|
@@ -21,7 +21,8 @@ re_common
|
|
|
21
21
|
password = pypi-AgEIcHlwaS5vcmcCJDdlYTBjNzZjLTU2NDItNGExYy04NzY4LWIxM2IyMzgzZjFiYgACJXsicGVybWlzc2lvbnMiOiAidXNlciIsICJ2ZXJzaW9uIjogMX0AAAYgPjmPag7MzYc7m6hG5x5-RGYtOolOXPWtTb88iMdB3xE
|
|
22
22
|
# 请使用新的令牌
|
|
23
23
|
password_new = pypi-AgEIcHlwaS5vcmcCJGU4NzNiN2QyLWY3NDgtNGVhZC04YTM1LThhZDNlZThlY2E1NgACEVsxLFsicmUtY29tbW9uIl1dAAIsWzIsWyIwYWIzYjIzMy0zZTlmLTQ1ZjAtYWQ5OC03NjJhNDM5NjNiZmUiXV0AAAYgGvyJ9zFd7e-sy4JMScCo23eNGqKFLWIIZMSiKqDkV0g
|
|
24
|
-
|
|
24
|
+
# new 20250224
|
|
25
|
+
password_new = pypi-AgEIcHlwaS5vcmcCJDJkMzJhNWZkLTBkOTktNGE4Yi1iN2Q5LWU0ZjNjMGNiNzhjYwACEVsxLFsicmUtY29tbW9uIl1dAAIsWzIsWyIwYWIzYjIzMy0zZTlmLTQ1ZjAtYWQ5OC03NjJhNDM5NjNiZmUiXV0AAAYg0Pu6BqqupvhX7ad69d8e6XS8BmnLav6x6D9HJ-U3gko
|
|
25
26
|
python setup.py sdist bdist_wheel
|
|
26
27
|
python -m twine upload dist/*
|
|
27
28
|
|
|
@@ -31,7 +32,7 @@ long_description = """
|
|
|
31
32
|
"""
|
|
32
33
|
setuptools.setup(
|
|
33
34
|
name="re_common",
|
|
34
|
-
version="0.2.
|
|
35
|
+
version="0.2.54",
|
|
35
36
|
author="vic",
|
|
36
37
|
author_email="xujiang5@163.com",
|
|
37
38
|
description="a library about all python projects",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|