Saravanan666/pypi-org huggingface dataset:
Package: sbatchpy
SbatchPyA python package that allows easysbatchjob script creation and submissions onhpc clusters, directly frompython.Installation# to install latest PyPI releasepipinstallsbatchpy# to install latest GitHub commitpipinstall--upgradegit+https://github.com/killiansheriff/sbatchpyUsageAn example on how to run a python script calledmy_script.pytaking 2 argumentsvar1andvar2as inputs, and using thebaseenvironement is provided below. A complete example with outputs can be foundhere.fromsbatchpyimportrunconfig={"mem":"1gb","time":"00:01:00","account":"myaccount","cpus-per-task":"5","partition":"shared","ntasks-per-node":"1","nodes":"1",}forvar1,var2inzip([1,2,3],["A","B","C"]):config["job-name"]=f"myjob_{var1}var1_{var2}var2.sh"config["output"]=f"out/myjob_{var1}var1_{var2}var2.out"run(config,code=f"source activate base\npython my_script.py{var1}{var2}",)By default, sbatchpy will check thatconfig["output"]'s directory folder exists. If it doesn't, you will be notified and the job will not run.Additionally, each sbatch submission script is saved inside thef"{os.getcwd()}/.job"folder. Another saving folder can be chosen by passingjob_directory=my_saving_directory_pathto therunfunction which is responsible of creating the submission script and running it usingsbatch job_directory/config["job-name"].
Package: sbb-binarization
sbb_binarizationDocument Image Binarization using pre-trained modelsExamplesInstallationPython versions3.7-3.10are currently supported.You can either install viapip install sbb-binarizationor clone the repository, enter it and install (editable) withgit clone git@github.com:qurator-spk/sbb_binarization.git
cd sbb_binarization; pip install -e .ModelsPre-trained models can be downloaded from the locations below. We also provide the models andmodel cardon 🤗VersionFormatDownload2021-03-09SavedModelhttps://github.com/qurator-spk/sbb_binarization/releases/download/v0.0.11/saved_model_2021_03_09.zip2021-03-09HDF5https://qurator-data.de/sbb_binarization/2021-03-09/models.tar.gz2020-01-16SavedModelhttps://github.com/qurator-spk/sbb_binarization/releases/download/v0.0.11/saved_model_2020_01_16.zip2020-01-16HDF5https://qurator-data.de/sbb_binarization/2020-01-16/models.tar.gzWithOCR-D, you can use theResource Managerto deploy models, e.g.ocrd resmgr download ocrd-sbb-binarize "*"Usagesbb_binarize\-m<pathtodirectorycontainingmodelfiles>\<inputimage>\<outputimage>Note:the output image MUST use either.tifor.pngas file extension to produce a binary image. Input images can also be JPEG.Images containing a lot of border noise (black pixels) should be cropped beforehand to improve the quality of results.Examplesbb_binarize -m /path/to/model/ myimage.tif myimage-bin.tifTo use theOCR-Dinterface:ocrd-sbb-binarize -I INPUT_FILE_GRP -O OCR-D-IMG-BIN -P model defaultTestingFor simple smoke tests, the following willdownload modelsdownload test datarun the OCR-D wrapper (on page and region level):make models
  make test
Package: sbc
sbc介绍sbc: struct convert binary.C语言格式结构体和二进制转换库.本软件包已上传到pypi,可输入命令直接安装:pipinstallsbcPython和C对应类型本软件包封装了ctypes,支持cytpes所有类型,对应表如下:cyteps typeCtypePython typec_bool_Boolbool (1)c_charchar1-character bytes objectc_wcharwchar_t1-character stringc_bytecharintc_ubyteunsigned charintc_shortshortintc_ushortunsignedshort	intc_intintintc_uintunsigned intintc_longlongintc_ulongunsigned longintc_longlong__int64 or long longintc_ulonglongunsigned __int64 or unsigned long longintc_size_tsize_tintc_ssize_tssize_t or Py_ssize_tintc_floatfloatfloatc_doubledoublefloatc_longdoublelong doublefloatc_char_pchar * (NUL terminated)bytes object or Nonec_wchar_pwchar_t * (NUL terminated)string or Nonec_void_pvoid *int or None使用说明软件包支持4种C语言结构：类名说明LEFormat1字节对齐的小端结构体LEFormatAlign44字节对齐的小端结构体LEFormatAlign88字节对齐的小端结构体BEFormat1字节对齐的大端结构体BEFormatAlign44字节对齐的大端结构体BEFormatAlign84字节对齐的大端结构体定义C语言结构体需继承对应的结构体,然后在_fields_中定义对应的成员。示例:classTStruct1(sbc.LEFormat):_fields_=[# (字段名, c类型)('a',sbc.c_uint32),('b',sbc.c_int16),('c',sbc.c_uint8),]C结构体转换为二进制字节流使用方法encode,二进制字节流转换为C语言结构体使用方法decode.API:"""C语言格式结构体转换成二进制:return: 返回二进制字节流"""defstruct_to_bytearray(self)->bytearray"""二进制转换成C语言结构体:return: 返回True表示转换成功,False表示转换失败"""defbytearray_to_struct(self,data:bytearray)->bool"""读取结构体字节数"""defsize(self)->int示例importsbcimportunittestclassTStruct1(sbc.LEFormat):_fields_=[# (字段名, c类型)('a',sbc.c_uint32),('b',sbc.c_int16),('c',sbc.c_uint8),]classTStruct2(sbc.LEFormatAlign4):_fields_=[# (字段名, c类型)('a',sbc.c_uint32),('b',sbc.c_int16),('c',sbc.c_uint8),]classTStruct3(sbc.BEFormat):_fields_=[# (字段名, c类型)('a',sbc.c_uint16),('b',sbc.c_uint8*5),('c',sbc.c_uint32),]class_UnitTest(unittest.TestCase):deftest_case1(self):"""测试小端1字节对齐,C语言结构体转换为二进制"""ts=TStruct1()ts.a=0x12345678ts.b=0x2345ts.c=0x67data=ts.struct_to_bytearray()self.assertEqual(len(data),7)self.assertEqual(data,bytearray([0x78,0x56,0x34,0x12,0x45,0x23,0x67]))deftest_case2(self):"""测试小端1字节对齐,二进制转换为C语言结构体"""ts=TStruct1()ts.bytearray_to_struct(bytearray([0x78,0x56,0x34,0x12,0x45,0x23,0x67]))self.assertEqual(ts.a,0x12345678)self.assertEqual(ts.b,0x2345)self.assertEqual(ts.c,0x67)deftest_case3(self):"""测试小端4字节对齐,C语言结构体转换为二进制"""ts=TStruct2()ts.a=0x12345678ts.b=0x2345ts.c=0x67data=ts.struct_to_bytearray()self.assertEqual(len(data),8)self.assertEqual(data,bytearray([0x78,0x56,0x34,0x12,0x45,0x23,0x67,0x00]))deftest_case4(self):"""测试小端4字节对齐,二进制转换为C语言结构体"""ts=TStruct2()ts.bytearray_to_struct(bytearray([0x78,0x56,0x34,0x12,0x45,0x23,0x67,0x00]))self.assertEqual(ts.a,0x12345678)self.assertEqual(ts.b,0x2345)self.assertEqual(ts.c,0x67)deftest_case5(self):"""测试小端4字节对齐,二进制转换为C语言结构体"""ts=TStruct2()err=ts.bytearray_to_struct(bytearray([0x78,0x56,0x34]))self.assertEqual(err,False)deftest_case6(self):"""测试大端1字节对齐,C语言结构体转换为二进制"""ts=TStruct3()ts.a=0x2345foriinrange(5):ts.b[i]=its.c=0x12345678data=ts.struct_to_bytearray()self.assertEqual(len(data),11)self.assertEqual(data,bytearray([0x23,0x45,0x00,0x01,0x02,0x03,0x04,0x12,0x34,0x56,0x78]))defprint_hex(data):foriindata:print('%x'%i,end=' ')print()if__name__=='__main__':suite=unittest.TestSuite()runner=unittest.TextTestRunner()runner.run(suite)
Package: sbc-classification
Demand Patterns SBC (Syntetos Boylan Croston) method of CategorizationsDescriptionThis method helps classify different demand patterns (time-series patterns) into groups in order to fit the most appropriate model. More info could be foundhereandhereThis is a Python version of the tsintermittent package in R. At the moment, only the SBC method is available.Installationpip install sbc-classificationExampleTest DataTest data is the clean version of the data from M5 Forecasting Challenge competition on Kaggle. Details can be foundhere. The dataset was processed to make it easier to test the function.TestingNote:This function will not treat NA values. All the null values in the time-series should be treated separately.fromsbcimportsbc_class.sbc_classdf=pd.read_csv("./tests/data/sales_train_clean.csv")## multiple targetsout=sbc_class.(df.iloc[:,1:],plot_type='summary')## 1 targetout1=sbc_class.(df.iloc[:,1],plot_type='summary')print(out)print(out1)If plot_type is not None, output would be a plot and a dataframe of target_name, p, CV squared and classified model type for multiple targetsIf plot_type issummarythen the plot would be a matrix diagram of numbers of time-series in each categoryIf plot_type isbarthen the plot would be bar chart of numbers of time-series in each demand patternsPlease give the package a star if you find it helpful :)
Package: sbc-drf
Copyright (c) 2020 Stickboy Creative PythonPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: UNKNOWN
Keywords: djangorestframework,drf
Platform: Independant
Classifier: Development Status :: 1 - beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Package: sbc-drf-authtoken
Copyright (c) 2020 Stickboy Creative PythonPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: UNKNOWN
Keywords: djangorestframework,drf,auth,authentication
Platform: Independant
Classifier: Development Status :: 1 - beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Package: sbc-drf-notification
Copyright (c) 2020 Stickboy Creative PythonPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: UNKNOWN
Keywords: djangorestframework,drf,notification
Platform: Independant
Classifier: Development Status :: 1 - beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Package: sbc-drf-user
Copyright (c) 2020 Stickboy Creative PythonPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: UNKNOWN
Keywords: djangorestframework,drf,user
Platform: Independant
Classifier: Development Status :: 1 - beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Package: sbclassifier
This package contains a stripped down version of the SpamBayes classifier, with
the following changes:The classifier and tokenizer code has been kept. All other code has been
removed.The tokenizer has been stripped down and simplified. In particular all code
designed specifically for email parsing has been removed.The ClassifierDb class has been reduced to a simple dict subclass. The custom
pickling code has been removed, as have all database backends.The remaining code has been updated and made compatible with Python 3.An orthogonalsparse bigram (OSB) transformation has been added.Unicode handling has been improved.What’s it good for?I use sbclassifier to protect websites against contact form spam.With a training set of a handful each of spam and non-spam messages it is
already useful. Once the training data set gets above about 20 messages of each
type I am happy to let it filter out the most obvious spam.UsageThe above script will print out:0.902
[('*H*', 0.104), ('*S*', 0.908), ('can', 0.155), ('for', 0.845), ('service', 0.845), ('traffic', 0.845), ('and', 0.908)]sbclassifier assigns 90% probability to this unknown message being spam.
It can also produce a sequence of (word, probability) pairs that reveals the
tokens that were important in this calculation.More informationThespambayes source repositorycontains a wealth of information on how and why the classifier works as it
works, as does theSpamBayes wiki.CopyrightCopyright (C) 2002-2013 Python Software Foundation; All Rights ReservedThe Python Software Foundation (PSF) holds copyright on all material
in this project.  You may use it under the terms of the PSF license;
see LICENSE.txt.
Package: sbclient
sbclient - CLI Splunkbase clientsbclient is a command-line client for interacting with the officially unofficial Splunkbase API.Installationsbclient can be installed using pip3:pip3 install sbclientOr, if you're feeling adventurous, can be installed directly from
github:pip3 install git+https://github.com/HurricaneLabs/sbclient.gitUsageUsage: sbclient [OPTIONS] COMMAND [ARGS]...

Options:
  -U, --username TEXT  [required]
  -P, --password TEXT
  --help               Show this message and exit.

Commands:
  check-app-for-update
  download-app
  get-latest-versionsbclient is broken into several smaller commands. Credentials for Splunkbase can be passed as
parameters, or can be set as environment variablesexport SPLUNKBASE_USERNAME="doug.merritt"
export SPLUNKBASE_PASSWORD="spLunk1sc00l"check-app-for-updatecheck-app-for-updatewill parse an app directory for details, and check for updates on
Splunkbase for that app. It will also output the current version of the app, and details of the
update if one is available.Usage: sbclient check-app-for-update [OPTIONS] APP_DIR

Options:
  --splunk-version TEXT  Restrict to app versions compatible with a given
                         Splunk version
  --help                 Show this message and exit.download-appdownload-appwill download an app from Splunkbase, either a specific version or the latest
available.Usage: sbclient download-app [OPTIONS] APP_NAME

Options:
  --output-path TEXT  Path and filename location to save the app
  --version TEXT      Version of app to download, default is latest
  --help              Show this message and exit.get-latest-versionget-latest-versionwill check Splunkbase and output information on the latest version of an app
available. Optionally, you can restrict the latest version to the latest version compatible with a
specific Splunk version.Usage: sbclient get-latest-version [OPTIONS] APP_NAME

Options:
  --splunk-version TEXT  Restrict to app versions compatible with a given
                         Splunk version
  --help                 Show this message and exit.
Package: sbcloud
Swimbundle CloudPackage provides reusable provider-agnostic cloud integrations for SwimbundlesProvides a CLI to generate new swimbundles, and can be installed as a dependency in swimbundles to extend all default
cloud integrations functionalityBuilt usingApache LibcloudCurrently support COMPUTE providers onlyInstallationInstall from public repositorypip install sbcloudCLIScaffold new cloud swimbundle with all supported integrations for the chosen providerSeehttps://libcloud.readthedocs.io/en/latest/supported_providers.html#computefor available providerssbcloud generate --vendor "Amazon Web Services" --product "EC2" --provider "EC2" --logo-path "./path/to/logo.png"Manifests will be generated based on expected arguments for chosen provider, but asset and integration inputs may need
adjustedSwimbundle UsageList indist_requirements.txtfile in swimbundlesImport and extend base classes provided by package and configure with provider informationfrom sbcloud.integrations.compute import ComputeListNodesIntegration


class SwMain(ComputeListNodesIntegration):

    provider = 'ec2'
Package: sbcommons
sbcommonsPackages shared between different lambda functions0.85Update requirements0.84Remove changes made in 0.83 and split Klaviyo timestamp on multiple tokens instead0.83- DeprecatedParametized the delimiter in getting next timestamp from the Klaviyo client0.82Modify get_global_exclusions in KlaviyoClient so that we can filter based on exclusion reason or acquire all exclusions regardless of type."Added KlaviyoClientError class.0.81Fixed method in KlaviyoClient for getting all the members of a list. The method should use pagination but it did not.0.80Fixed method in KlaviyoClient for getting global exclusions. The method was previously not using pagination which could potentially result in missing some unsubscribes.0.79Added function in s3 that can move objects from one bucket to another but it also has an option to only move objects that satisfy a certain condition.0.78Fix warnings and cover corner cases in evaluate_recursively.0.77Fix bug in KlaviyoEvent.events_to_df() so that a missing value for an event does not result in the whole dataframe missing the column.0.76Fixed bug in KlaviyoClient.get_events() in how we paginate through the event results.Fixed bug in KlaviyoEvent.events_to_df() so that order of columns is preserved in the generated dataframe.0.75Added subscription related events under klaviyo sub-module.Added KlaviyoClient method for getting all metrics and added an <end_ts> argument in the get_events() method, enabling to extract data from <since_ts> up to <end_ts> (i.e. extracting data for a specific time period).0.74Bug fixes in aws secrets0.73Added a new UDF to the utils for all functions. To be able to evaluate to python objects.Also added to the secrets module to evaluate all return secrets from AWS0.72Added decorator function that posts to SNS topic if the decorated function raises an exception.0.71Added new functionality to CRM client to be able to post events for a metric and also use translation entries0.70Added a new function to get secrets from AWS.https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html0.69Added utility class for sending messages to slack.0.68Added new function to update events in a metric for Klayiyo Client0.67Added abstract class crm.client and made Klaviyo and Symplify clients inherit from it.Added metric and event class under crm.klaviyo.Changed typing import in parse_utils, importing OrderedDict instead of MutableMapping.0.66Fixed issue with RotatingFileHandler appending wrong suffixes to log file names.0.65- DeprecatedAdded the RotatingFileHandler class for time-rotating logging files.0.64Minor bug fixes to allow for package dependencies0.63Upgraded all the packages to python 3.9 packages0.62Added parse_utils sub-module for parsing configuration files and other text files.Added an execute_query method to aws.redshift.RedshiftClient for performing select statements given a string parameter.Making teams into a utility class instead of a client0.61- DeprecatedAdded teams client
Package: sbcontrast
Authors-------Michael Alan Keim, Pieter van Dokkum, and Jiaxuan Li.Email-----michael [dot] keim [at] yale [dot] eduDescription-----------The sbcontrast code is a method to obtain surface brightness limits thataccurately reflect an images depth at a given spatial scale. Rather thanrelying on the naive Poisson expectation, this code will estimate limitationspresented by large scale variations. A full description of this method is givenin Keim et al. 2022 (https://arxiv.org/pdf/2109.09778.pdf).Usage-----sbcontrast may be run from the command line. Enter 'sbcontrast -h' for help. Itrequires only an image fits file to run, however users should also specify afits file containing masks for genuine sources (via -masks), otherwise no maskswill be applied and the reported limit will not be as deep as the true value.Note that if the header does not contain the pixel size and photometriczeropoint as expected, the user will need to provide these (via -pix and -zp).Moreover, sbcontrast defaults to a 1sigma, 60 arcsec scale, though other limitsmay also be specified (via -N and -s). Additional commands (-binmap and-fluctmap) to save the binned image map and the final fluctuation map used todetermine the limit are also available.sbcontrast may also be run within python scripts, using numpy arrays ratherthan fits files. Simply import the sblimit function from sbcontrast.Note that the specified scale may be rounded so that the binning factors areintegers. Note also that the accuracy of this limit is limited by datareduction - for scales exceeding that of background subtraction, genuinefeatures above the calculated limit may have been removed. Moreover, at thesingle pixel scale sbcontrast may diverge from the true rms due tocorrelations introduced by re-sampling.Citation--------We ask that users utilizing this tool please cite Keim et al. 2022(https://arxiv.org/pdf/2109.09778.pdf).
Package: sbcrawler
sbcrawlerlight weight crawler轻量级的爬虫框架sbcrawler写这个框架的动机平时写爬虫过程中，发现通常不需要什么高大上的异步、并发、分布式等功能。小需求对防止被封，中断继续，日志进度等方面有更多重复性的代码。sbcrawler就是实现一个最简单的爬虫框架，让你可以专注于写内容抽取逻辑。特点单进程，非异步断点续爬错误日志记录用法示例# -*- coding: utf-8 -*-fromsbcrawlerimportCrawlerclassMyCrawlerExample(Crawler):start_url="https://xxx.xxx.com/xxx/"# 起始种子urlallowed_domain="https://xxx.xxx.com/"# 限制域,要带httpdefextract_links(self,html,task):# 抽取链接 加到爬取任务列表iftask.depth==0ortask.depth==1:html=html.find('.module_summary',first=True)iftask.depth==2:html=html.find("#in_list_main > table > tr:nth-child(6)",first=True)iftask.depth==3:returnsuper().extract_links(html,task)defextract_content(self,html,task):iftask.depth==3:title=html.find('#title',first=True)article=html.find('#article',first=True)return{'title':title.full_text,'article':article.full_text}if__name__=="__main__":crawler=MyCrawlerExample()crawler.start()安装pip install git+https://github.com/ffteen/sbcrawler.git