Saravanan666/pypi-org huggingface dataset:
Package: sgui
# sguiA simple GUI library for PythonCurrently, sgui is just simple a wrapper around [Tkinter](https://wiki.python.org/moin/TkInter). (Python's de-facto standard GUI) In the future, backends for other languages like [pyside2](http://wiki.qt.io/Qt_for_Python) may be added.sgui aims to be a simple and consistent tool for creating basic graphical user interfaces in python.sgui is currently under development. Basic usage of the library should not change much. But as it is still in early development, newer versions may break scripts written for older versions.[sgui on github](https://github.com/DGriffin91/sgui)### rot13 Code Example```pythonimport sgui, codecs#Update the rotatedTextBox when the normal text changesdef encode(textBox):rotatedTextBox.string = codecs.encode(textBox.string, 'rot_13')#Start windowwindow = sgui.Tk()#Vertical Layout framemainBox = sgui.VBox(window)sgui.Label(mainBox, string = "Normal Text:")normalTextBox = sgui.TextBox(mainBox, string = "Some normal text", command = encode)sgui.Label(mainBox, string = "Rotated Text:")rotatedTextBox = sgui.TextBox(mainBox)window.startGUI()```### Currently Supported Widgets* Textbox* Textentry* Button* Label* Checkbox* Listbox* Radiobuttons* Canvas* VBox* HBox##### Most widgets support:* `.string` for text manipulation* `.command` for call back function* `.enabled` can be True or False for enabling/disabling control* `.tooltip` for hover over tool tips##### For example:```pythonimport sguiwindow = sgui.Tk()def foo(btn):print(btn.string, "foo!")testButton = sgui.Button(window)testButton.string = "I'm a button!"testButton.command = footestButton.enabled = FalsetestButton.tooltip = "This button is disabled, it will never foo!"window.startGUI()```##### `.string` and `.command` can be declared when the widget is created:```pythontestButton = sgui.Button(window, string = "I'm a button!", command = foo)```
Package: sgwc
Sgwc搜狗微信文章、公众号爬虫接口。安装pip3 install sgwc --upgrade使用from sgwc import get_official, search_officials, search_articles, get_hot_articles

official = get_official(official_id='official_id')  # 通过微信号获取指定公众号
officials = search_officials(keyword='keyword')  # 通过关键字搜索公众号
articles = search_articles(keyword='keyword')  # 通过关键字搜索文章
articles = get_hot_articles()  # 获取热门文章从 Article、Official 实例对象提取相关信息article.url
article['url']  # 可以像字典类型一样, 提取信息(但不是字典类型)
article.items()  # 返回可遍历的(键, 值) 元组数组settingfrom sgwc import setting

# 自定义设置获取session对象函数, 返回: Session对象
# 详见: https://2.python-requests.org//en/master/user/advanced/#session-objects
setting.get_session = get_session

# 自定义搜狗验证码回调函数, 参数: 验证码图片(pillow Image 对象), 返回: 验证码
setting.sougo_captcha_callback = sougo_captcha_callback

# 自定义微信验证码回调函数, 参数: 验证码图片(pillow Image 对象), 返回: 验证码
setting.wechat_captcha_callback = wechat_captcha_callback

# 微信链接异常回调函数(系统出错/链接过期), 参数: 链接
self.wechat_link_error_callback = _wechat_link_error_callback

# 验证码/代理错误(代理不可用或超时)重复次数, 超过重复次数将跳过
setting.repeat_times = 3

# 自定义获取代理函数
# 返回格式: {'http': 'http://127.0.0.1:80', 'https': 'http://127.0.0.1:80'}
# 详见: https://2.python-requests.org//en/master/user/advanced/#proxies
setting.get_proxy = get_proxy 

setting.proxy_timeout = 10  # 代理超时设置

# 代理使用失败回调函数(当代理失败达到重复次数将会调用), 参数: 链接
setting.proxy_error_callback = proxy_error_callback当设置了get_proxy函数，将不会执行验证码回调函数APIget_official(official_id)official_id: 微信号返回Official对象或Nonesearch_officials(keyword, pages=1, begin_page=1)keyword: 搜索关键字pages: 获取页面数量begin_page: 起始页返回Official-Generator对象search_articles(keyword, pages=1, begin_page=1)keyword: 搜索关键字pages: 获取页面数量begin_page: 起始页返回Article-Generator对象get_hot_articles(pages=2, article_type=0)pages: 获取页面数量article_type: 文章类型返回Article-Generator对象article_type 对照表数值类型0热门1搞笑2养生堂3私房话4八卦精5科技咖6财经迷7汽车控8生活家9时尚圈10育儿11旅游12职场13美食14历史15教育16星座17体育18军事19游戏20萌宠Article属性返回类型说明urlstr链接titlestr标题datestr发布日期image_urlstr图片链接digeststr文章概述official_urlstr公众号链接official_namestr公众号名称save_article(save_path='.')None保存文章为 Markdown 文件(save_path: 保存路径)items()list返回可遍历的(键, 值) 元组数组get_html()str返回文章htmlOfficial属性返回类型说明urlstr链接official_idstr微信号namestr公众号名称avatar_urlstr公众号头像链接qr_code_urlstr公众号二维码链接profile_descstr公众号简介statustuple公众号每月状态, (每月发文数, 每月访问数)recent_articleArticle最新文章 Article 实例articles[Article]公众号文章 Article 实例数组authenticatestr认证from_url(url)Official类方法, 通过公众号链接生成 Official 实例items()list返回可遍历的(键, 值) 元组数组
Package: sgx
TheSelfish Gene Algorithmis a population-less evolutionary optimizer loosely inspired by the dashing interpretation of the Darwinian theory popularized in the scientific blockbusterThe Selfish Gene. It enables a user to efficiently find the list parameters, either discrete symbols or real numbers, that maximizes a given target functionSince 1998, theSelfish Genewasexploitedby different researchers, and a few brand new approaches derived from it. For celebrating (almost) a quarter century mark, it has been  rewritten from scratch in Python 3, with improved usability and tons of new features.
Package: sgx-dcap-quote-verify-python
SGX DCAP quote verify for PythonThis package provides a Python binding to theSGX Quote Verification Library(QVL), which is the reference implementation of ECDSA-based SGX quote verification. It allows you to verify ECDSA-based quotes generated by the Intel provided Quoting Enclave in Python.Usageimportsgx_dcap_quote_verifyfrompathlibimportPathfromdatetimeimportdatetime# You can download the trusted root CA in PEM format directly from Intel at :# <https://certificates.trustedservices.intel.com/Intel_SGX_Provisioning_Certification_RootCA.pem>trusted_root_ca_certificate=Path("path/to/root_ca_certificate.pem").read_text()# Get the quote and the collateral from the service you want to attestpck_certificate=Path("path/to/pck_certificate.pem").read_text()pck_signing_chain=Path("path/to/pck_signing_chain.pem").read_text()root_ca_crl=Path("/path/to/root_ca_crl.pem").read_text()intermediate_ca_crl=Path("/path/to/intermediate_ca_crl.pem").read_text()tcb_info=Path("/path/to/tcb_info.json").read_text()tcb_signing_chain=Path("/path/to/tcb_signing_chain.pem").read_text()quote=Path("/path/to/quote.dat").read_bytes()qe_identity=Path("/path/to/qe_identity.json").read_text()# Set the date used to check if the collateral (certificates,CRLs...) is still valid# Except for test purposes it should be set to the current time as is done belowexpiration_date=datetime.now()# Use the package to check the validity of the quoteattestation_result=sgx_dcap_quote_verify.verify(trusted_root_ca_certificate,pck_certificate,pck_signing_chain,root_ca_crl,intermediate_ca_crl,tcb_info,tcb_signing_chain,quote,qe_identity,expiration_date,)assertattestation_result.okassert(attestation_result.pck_certificate_status==sgx_dcap_quote_verify.VerificationStatus.STATUS_OK)assert(attestation_result.tcb_info_status==sgx_dcap_quote_verify.VerificationStatus.STATUS_OK)assert(attestation_result.qe_identity_status==sgx_dcap_quote_verify.VerificationStatus.STATUS_OK)assert(attestation_result.quote_status==sgx_dcap_quote_verify.VerificationStatus.STATUS_OK)# The attestation result contains the report data, which includes the MR_ENCLAVEprint("mr_enclave =",attestation_result.enclave_report.mr_enclave)Disclaimer: This package is not endorsed by Intel Corporation. It is provided as is, use it at your own risk.LicenseThe source code of the binding is provided under Apache-2.0 license.This software also uses the SGX Quote Verification Library, which is licensed underBSD license.
Distribution of the software as a whole, including the external library, may be subject to the terms of the external library's license.
Package: sgx-ias-structs
sgx-ias-structsConstants and structures related to the Intel SGX ISA extension.Getting startedJavaScript / TypeScriptAdd the package from folderjs/pkgas dependency to thepackage.jsonin your project:"dependencies": {
    "sgx-ias-structs": "file:sgx-ias-structs-[version].tgz"
  }PythonInstall the wheel from folderpy/pkgby runningpip3 install sgx_ias_structs.whland then justimport sgx_ias_structsat the top of your python script🎁 Build & PackageJavaScript / TypeScriptTo build the wasm code and the js/ts binding run in thejsfolder:npm run build-nodefor nodejsnpm run build-bundlerfor browser / webpacknpm run buildfor one compatible with bothThen package the dependency by runningnpm packin the correspondingpkgdir.PythonTo build the python bindings you'll needmaturin. Run in thepyfolder:pip3 install maturinto install maturin./build.shto build the wheel for the current platform in the pkg folder🛠️ TestWe have four different test stages.RustRegular tests written in Rust. Just callcargo test.WASMSome test can be specified to run in the node wasm interpreter. They are defined using the[wasm_bindgen_test]attribute.  In order to run them go execute the following command in thejsfolder:npmrunwasm-testJavaScript / TypeScriptThere also are some tests for the JavaScript bindings usingmochaandchai.They are defined in the folderjs/testsand can be run  using the following command:npmruntestPythonThere also are some tests for the Python bindings usingtox.They are defined in the folderpy/testsand can be run  using the following command:tox
Package: sh
If you are migrating from 1.* to 2.*, please see MIGRATION.mdsh is a full-fledged subprocess replacement for Python 3.8 - 3.11, and PyPy
that allows you to callanyprogram as if it were a function:fromshimportifconfigprint(ifconfig("eth0"))sh isnota collection of system commands implemented in Python.sh relies on various Unix system calls and only works on Unix-like operating
systems - Linux, macOS, BSDs etc. Specifically, Windows is not supported.Complete documentation hereInstallation$> pip install shSupportAndrew Moffat- author/maintainerErik Cederstrand- maintainerDevelopersTestingTests are run in a docker container against all supported Python versions. To run, make the following target:$> make testTo run a single test:$> make test='FunctionalTests.test_background' test_oneCoverageFirst run all of the tests:$> SH_TESTS_RUNNING=1 coverage run --source=sh -m pytestThis will aggregate a.coverage.  You may then visualize the report with:$> coverage reportOr generate visual html files with:$> coverage htmlWhich will create./htmlcov/index.htmlthat you may open in a web browser.
Package: sh40-carmine
carmineThe no-boilerplate CLI library powered by Python's introspection.pip install sh40-carminethe contextCLIs (command line interfaces) are one of Python's longest standing issues. The builtin solution,argparse, is hard to understand & reason about, and doesn't even follow Python's own conventions in multiple places.Alternative solutions often feel redundant and force you to define arguments twice - once in the function's definition, and another time as an CLI option.Turns out, there's a better solutionthe solutioncarminereads your functions signaturesdirectly, removing the need to manually define option types. It also (optionally) uses type hints to automatically convert arguments given to the CLI to the types you expect them to be. All this is done with no modification to the syntax!"""My Carmine app."""importsysfromcarmineimportcarmine_cli,Choicedefhello(name:str,*,age:int)->None:"""Says hello!Args:name: Your name.age: Your age."""print(f"Hello{name}, are you{age}years old?")defgoodbye(name:str,duration:Choice("for now","forever"))->None:"""Says goodbye!Args:name: Your name.age: How long you're gonna leave for."""print(f"It's been nice knowing you,{name}!",end="")ifduration=="for now":print("See you soon!")else:print("Eh, you'll be back soon enough.")defmain(argv:list[str]|sys.argv)->None:"""Runs the application."""withcarmine_cli(__doc__,argv)asregister:register(hello,goodbye)single-command modeNot every app needs to have multiple commands. If your app only registers one thing,carminewill no longer require a command selection, which keeps things cleaner."""My (simple) Carmine app.This docstring won't be used in the help, as the sole command's overrules it."""importsysfromcarmineimportcarmine_cli,Choicedefmultiply(a:int,b:int,*,power:bool=False)->None:"""Multiplies two numbers.Args:a: The first number.b: The second number.power: Interpret `b` as a power, rather than a factor."""result=a**bifpowerelsea*bprint(result)defmain(argv:list[str]|sys.argv)->None:"""Runs the application."""withcarmine_cli(__doc__,argv)asregister:register(multiply)examples
Package: sh40-zenith
ZenithA markup language with a built-in color palette generator, made for the terminal.pip install sh40-zenithPurposeZenithis a fast markup language meant to be readable and maximally accessible. Its
syntax is inspired byBBCode, but it's meant to
be readable enough that anyone can work with it with no background knowledge.Feature highlightsExtensive color & styling support for the terminalZML (the Zenith Markup Language) has support for 16, 256 and true color palettes, and
supports both RGB triplets and HEX codes for the latter. A color can set the background
if prefixed by@.Zenithis implemented usingSlate's terminal APIs,
and as a result any color set in ZML will be backwards compatible for even the oldest
(xterm-based) terminals!If you only set a background but no foreground, ZML will choose either black or white
depending on which will be more readable, in accordance to the W3C color contrast guidelines.fromzenithimportzprintzprint("[bold 141]Purple & bold,[/] Reset, [@#212121 grey]code,[/bg] and now only grey.")Hyperlink supportZML has a simple syntax to define web-like hyperlinks, which are supported by your terminal!
Simply use the tilde symbol followed by a URI:fromzenithimportzprintzprint("This looks & functions like a terminal hyperlink: [blue underline ~https://google.com]Google[/]")Customizable macros & aliasesWe also support macros, which are python functions you can call to transform your
unstyled markup content while it's being parsed. Here is a simple localization system,
implemented using just one macro:fromzenithimportzml_macro,zprintLANG="en"LOCALIZATION={"welcome":{"en":"Welcome to the project","hu":"Üdv a projektben",}}@zml_macrodefloc(key:str)->str:"""Returns a localized string for the given key."""returnLOCALIZATION[key][LANG]zprint("This is localized: [!loc]welcome")If you find yourself often reusing the same set of styles (even including macros), you can
simply alias them:fromzenithimport,zml_alias,zprintzml_alias(title="!upper !gradient(72) bold")zprint("[title]This is a cool title.[/title]")Color palettesZenithsuperchargesSlate's 4-color palette generation by adding shades and
aliasing them for use in ZML.fromslateimportColorfromzenithimportPalette,zprintpalette=Palette(Color.from_hex("#4A7A9F"))palette.alias()zprint(palette.render())DocumentationOnce the library gets to a settled state (near 1.0), documentation will be hosted both online and as a celx
application. Until then peep theexperimentsfolder, or check out some of the references by usingpython3 -m pydoc <name>.See alsoThis library is mostly supposed topowersome higher level tools, so using it raw might
not be ideal. Thankfully, we have two projects that can help with that:Slate: The terminal management library at the core of many ofZenith's
features.Celadon: A TUI library that makes extensive use of ZML for widget
configuration, and uses the palette generator for quick and great looking UIs.celx: A hypermedia-driven TUI framework built on top ofCeladon.
Package: sh4dis
sh4disA python disassembler library for SH4Use>>> from sh4dis import sh4
>>> sh4.disasm(0x1234, 0)
'mov.l r3,@(16,r2)'Or, if you'd like access to the instruction internals, like opcode identifier and operands:>>> decoded = sh4.decode(0x1234, 0)
>>> decoded.op
<OP.MOV: 53>
>>> decoded.operands[0]
(<OPER_TYPE.GPREG: 10>, <REG.R3: 4>)
>>> decoded.operands[1]
(<OPER_TYPE.DEREF_REG_IMM: 7>, <REG.R2: 3>, 16)
2The decoded structure can still be made into a string:>>> sh4.disasm(decoded)
'mov.l r3,@(16,r2)'
Package: sha256
This is a SHA-256 implementation that allows for setting and getting
the mid-state information. This was needed to enable repeated hashing
against a (potentially large) fixed prefix.PerformanceThe original version of this was written in Python. While the Cython
version will be much faster, this is not a highly optimized library and
relies on the native C compiler for optimization.CythonizeThis repository does not contain the generated C code from Cython. To
recreate the C code run the cytnonize step via:python3 -m pip install --upgrade build
python3 -m buildAuthorsThe original author was Thomas Dixon for a python version of this code.
Sam Rushing added the midstate access and converted it toCython.
Nigel Drego added the context state setter/getter.LICENSEThis is licensed under theMIT licensebased on the original
license from Thomas Dixon.
Package: sha256bit
sha256bitCI/CDPackageMetaPure python implementation of SHA256 with features which are often lacking:bit granularity for message input lengthimport/export API to "persist" the state in the middle of a hash computationUser documentationis hosted on readthedocs.Installationpython3 -m pip install sha256bitUsageOne liner>>> from sha256bit import Sha256bit
>>> Sha256bit("abc".encode()).hexdigest()
'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'Bit length capability>>> from sha256bit import Sha256bit
>>> Sha256bit(b'\x00',bitlen=1).hexdigest()
'bd4f9e98beb68c6ead3243b1b4c7fed75fa4feaab1f84795cbd8a98676a2a375'Import/export>>> from sha256bit import Sha256bit
>>> h1 = Sha256bit("a".encode())
>>> state = h1.export_state()
>>> h2 = Sha256bit.import_state(state)
>>> h2.update("bc".encode())
>>> h2.hexdigest()
'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'Test withpytestpytest-3Test withoutpytestTests can run without creating/installing the package:python3 -m test.testyou can also run each test separately:python3 -m test.test_api
python3 -m test.test_cavp
python3 -m test.test_hardcoded
python3 -m test.test_vs_hashlibGenerate the doccd docs
pipenv shell
make clean doctest htmlUpdate pipenv for the doccd docs
pipenv shell
#use pip to update whatever ou want
pip freeze > requirements.txt
pipenv updateBuild the packageBuild is done usinghatchling. The scriptbuildallows to build for different version of python3:./build python3.9Create a new versionVersion is managed byhatch-vcs, you just need to create a tag in github.Launch lintersThey use the configuration frompyproject.toml./lint
Package: sha256-brandonodiwuor
The SHA-256 Project -PyPIPython package implementing of the SHA-256 Secure Hashing Algorithm defined inFIPS 180-4with a command-line interface.SHA-256 - An Implementation of Secure Hashing Algorithm 2 (SHA-2) with 256-bit digest.This implementation is based on the pseudocode algorithm fromWikipediaandThe SHA-256 ProjectUsage1. Hashing a stringpython sha256.py -s 'message string'Screenshot example - String hashing compared with Python's Hashlib sha256 result2. Hashing a filepython sha256.py -f input-file.txtScreesnhot example - File hashingTestingThe Application is tested usingPytestTo run the tests:pip install -r requirements.txt  
pytest
Package: sha256sumf
sha256sumfA simple command line utility for producing recursive SHA 256 checksums of folders using:Inner file contentsInner file pathsInner folder pathsProduces the same output as sha256sum when used with a single file.Installation and Usage$ pip install sha256sumf
$ sha256sumf folder
92f49e486823dbfbb514097761f8dbeebb997f6a5552180e057e454964224b15  folder
Package: sha3bit
sha3bitCI/CDPackageMetaPure python implementation of SHA3 with features which are often lacking:Bit granularity for message input lengthImport/export API to "persist" the state in the middle of a hash computationRealsqueezfunction in addition of hashlib'sdigestBuiltin logging to see compression function IOs or even internal stepsUser documentationis hosted on readthedocs.Installationpython3 -m pip install sha3bitUsageOne liner>>> from sha3bit import sha3_256
>>> print(sha3_256("abc".encode()).hexdigest())
'3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532'Bit length capability>>> from sha3bit import sha3_256
>>> print(sha3_256(b'\x00',bitlen=1).hexdigest())
'1b2e61923578e35f3b4629e04a0ff3b73daa571ae01130d9c16ef7da7a4cfdc2'Import/export>>> from sha3bit import sha3_256
>>> h1 = sha3_256("a".encode())
>>> state = h1.export_state()
>>> h2 = sha3_256.import_state(state)
>>> h2.update("bc".encode())
>>> print(h2.hexdigest())
'3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532'Test withpytestpytest-3Test withoutpytestTests can run without creating/installing the package:python3 -m test.testyou can also run each test separately:python3 -m test.test_api
python3 -m test.test_api_xof_absorb
python3 -m test.test_cavp
python3 -m test.test_cavp_xof
python3 -m test.test_hardcoded
python3 -m test.test_sha3_vs_hashlib
python3 -m test.test_shake_vs_hashlibGenerate the doccd docs
pipenv shell
make clean doctest htmlUpdate pipenv for the doccd docs
pipenv shell
#use pip to update whatever ou want
pip freeze > requirements.txt
pipenv updateBuild the packageBuild is done usinghatchling. The scriptbuildallows to build for different version of python3:./build python3.9Create a new versionVersion is managed byhatch-vcs, you just need to create a tag in github.Launch lintersThey use the configuration frompyproject.toml./lint
Package: sha512-crypt
sha512-cryptPython binding to Rustsha-cryptpassword hashing crate.Installationpipinstallsha512-cryptUsageimportsha512_cryptpassword='abc'hashed=sha512_crypt.encrypt(password)assertsha512_crypt.verify(password,hashed),'wrong password'LicenseThis work is released under the MIT license. A copy of the license is provided in theLICENSEfile.
Package: sha-accounts
sha-accountsCustomized Django Rest Framework Accounting AppInstallationpipinstallsha-accountsQuick Startset these variables onsettings.pyfromdatetimeimporttimedeltaSHA_ACCOUNTS={'DEFAULT_ACTIVATION':True,'AUTH_USER_PROFILE_MODEL':'examples.ExampleProfile','JWT_ACCESS_TOKEN_EXP':timedelta(days=1),'JWT_USER_ENCODED_FIELDS':['id'],'JWT_AUTH_RAELM':'sample_raelm'}
Package: shaapes
Shapes!Shapes is an award winninggraphical esolang that uses images with shapes!Shapes‽In short, a Shapes program consists of shapes and paths connecting them. Each shape does different things depending on the shape of the shape.For more Shapes Information, go to thewiki.Shapes?How to Shapes?????PIPMake surepipis up-to-date.python -m pip install pip --upgradeIt's shaapes with 2 Aspython -m pip install shaapesInterpret Shapes programs withpython -m shapes interpret "path\to\program.png"For more options and or thingies, dopython -m shapes --helpShapes!!!Hello, World!Truth machinemore...Shapes...Soon™:Better docsBetter shape classificationFunctionoid path enviornments...Shapes...?Consider contributing to Shapes!Star this repo if you like my esolang :)