Saravanan666/pypi-org huggingface dataset:
Package: hutils
HUtils, a charming python web util-library.本项目为我司@zaihui在后端开发中，
积攒的比较好用的各类基类函数。
除了基础的类型变换，
还有 django 相关的一系列功能。让我们简单看一段用上了 hutils 以后的效果：importhutils# 使用前defcreate_user(data):try:uid,age,phone,created_at=data["uid"],data["age"],data["phone"],data["created_at"]# 此处做一系列类型验证，或者用个 marshmallow 之类的库来验证 :)returnUser(uid=uid,age=age,phone=phone,created_at=created_at)exceptExceptionasex:logger.exception(ex)# 使用后@hutils.mutes(log=True)defcreate_user(data):uid,age,phone,created_at=hutils.get_data(data,"uid","age","phone","created_at")created_at=created_atorhutils.yesterday()ifnotall([hutils.is_uuid(uid),hutils.is_int(age),hutils.is_phone(phone)]):returnNonereturnUser(uid=uid,age=age,phone=phone,created_at=created_at)详细的文档可以参见下方。
总而言之，hutils库的目标就是：Let coding in python be a pleasure!InstallationpipinstallhutilsDocument# 在本节文档用法中，# 我们会从具体的使用场景来介绍 hutils 里的基类函数库。# 详尽的参数可以读源码，# 我们尽最大努力保持着源码的可读性。# 使用了尽可能短的包名，# 就是为了直接 `import hutils` 的，# 切记不要 `from hutils import *`importhutils# 有时你想把一些 bytes/str 的变量统一转成 strx=b'bytes'or'string'print(hutils.bytes_to_str(x))# 在计算金额时，你需要做两位小数的算数# 而在返给前段时，又要去掉最末的 0interest=hutils.quantize(98.0*0.05)print(f'利息为¥{hutils.normalize(interest)}元')# 你可能需要给前端返回两个字典的合集，# 并转换成 jsonprint(hutils.format_json(hutils.merge_dicts({'a':1,'b':2},{'a':1,'c':[]},)))# 有时从前端的数据中，你要取值request_data={'key1':'value','key2':'value2','key3':'value3'}print(hutils.get_data(request,'key1','key2','key3'))# 前端会传性别进来，# 对应后端要有常量的验证classGenders(hutils.TupleEnum):MALE=0,'男性'FEMALE=1,'女性'UNKNOWN=2,'未知'print(Genders.chinese_choices())withhutils.catches(raises=HTTP400Error):gender=Genders(request_data['gender'])# 以及各种无副作用的短函数start,end=hutils.yesterday(),hutils.tomorrow()start_morning,end_evening=hutils.datetime_combine(start,end)print(f'有效期起始日为昨日凌晨({hutils.datetime_to_str(start_morning)})')关于更多的文档，
请直接在源码里查看吧 :)Contribution假如你想增加新的基类函数，
请先提交一个 issue 说明一下。本项目的代码需要符合以下标准：必须:单元测试必须要通过依赖第三方库时(比如django), 不能因为缺少依赖而导致整个import hutils都挂了。必须:基础语法风格检查必须要通过推荐:每个函数都要有对应的单元测试LicenseMIT LicenseOthers欢迎各位大佬提 PR/Issue 把你们觉得 好用的/写得不够完善的/缺少单元测试 的功能也提交进来~最后献上一首The Zen of Python:The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Package: huTools
=======huTools=======huTools is a small collection of helpful tools we use. Containing helppers for calendar calculations, bankingtools, checksummming, decorators, local unique IDs (luids), Netstrings, obfuscation (encription defendingagainst your little brother), printing, a ReReadingConfigParser, robust typecasts, access dicts like anobject and the other way arround, unicode processing country codes, file system operations and xmlstuff.It also installs the famous reindent.py code quality checker. Try`reindent.py .` to fix your current source tree.See http://hudora.github.com/huTools/overview.html for Details.Installation------------The easiest way to get huTools is if you have setuptools_ installed::easy_install huToolsWithout setuptools, it's still pretty easy. Download the huTools.tgz file from`huTools's Cheeseshop page`_, untar it and run::python setup.py install.. _huTools's Cheeseshop page: http://pypi.python.org/pypi/huTools/.. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstallHelp and development====================If you'd like to help out, you can fork the projectat http://github.com/hudora/huTools and report any bugsat http://github.com/hudora/huTools/issues.See `CHANGES <http://github.com/hudora/huTools/blob/master/CHANGES>`_for version differences.License=======This distribution includes `_jsonlib.py <http://pypi.python.org/pypi/jsonlib/>`_Copyright (c) 2008-2009 John Millikin <jmillikin@gmail.com>Distributed under the GNU General Public LicenseThis distribution contains `_decorator.py <http://pypi.python.org/pypi/decorator>`_Copyright (c) 2005, Michele SimionatoDistributed under a MIT-like License.This distribution contains `poster_encode.py <http://atlee.ca/software/poster/>`_Copyright (c) 2008-2010 Chris AtLee <chris@atlee.ca>Distributed under a MIT-like License.This distribution contains `cache.py <https://raw.github.com/mitsuhiko/werkzeug/b1f382c4eac19338c57526fa609a23034ba5055b/werkzeug/contrib/cache.py>`_copyright (c) 2010 by the Werkzeug Team, BSD licensed
Package: huunq
huunq: DBAPI2 Interface for kdb+Overviewhuunqis an experimental Python package providing a DBAPI2-compliant interface for interacting with kdb+ databases.The project was designed as a learning tool to understandPython's DBAPI2 specificationand KX Systems new Python-first interface for theqlanguage and its time-series vector database kdb+:pykx.It's a lightweight, easy-to-use solution for Python developers looking to integrate kdb+ into their applications.FeaturesDBAPI2 compliant interface for kdb+.Context management for connection objects.Error handling and custom exceptions.Type hinting for improved readability and maintainability.Installationhuunqis installable from PyPI usingpip.$pipinstallhuunqUsageHere's a quick start quide on usinghuunqto interact with akdb+database:fromhuunqimportconnect# Establish a connectionwithconnect(host="localhost",port=12345)asconn:# Create a cursor objectcur=conn.cursor()# Execute a querycur.execute("SELECT * FROM mytrades WHERE price > 0.5")# Fetch resultsresults=cur.fetchall()(Remember to replacelocalhostand12345with your kdb+ database host and port)DocumentationFor more detailed documentation, please refer to the docstrings within the code. Each exposed function, class, and method is documented to explain its purpose and usage.Disclaimerhuunqis an experimental project and is not recommended for production use. It's designed primarily as a learning tool.huunqis an independant effort and is not officially affiliated with KX SystemsLicenseMIT
Package: huvr-client
HUVR ClientA Python client (with examples) to connect to HUVRdata.You must be an active customer of HUVRdata.com for this library to be useful.The client is a thin wrapper around the Pythonrequestslibrary. It is provided as
a convenience to help customers access their data.See thehttps://docs.huvrdata.appfor detailed specs on specific API endpoints.  Along with guides for most common use cases.UsageInstallationUse pip to install the client.   See pip/python installation best practices:https://docs.python-guide.org/starting/installation/pipinstallhuvr-clientClient InitializationYou will need a service account in the HUVRdata platform to use this client.  Please contact your HUVRdata representative to get your credentials.fromhuvr_clientimportget_huvr_client# Create a client with your credentialsclient=get_huvr_client(base_url="https://demo.huvrdata.app",client_id="my-company.service-account@demo.huvrdata.app",client_secret="my-secret")AuthenticationThe client will be authenticated for 1 hour.  After that, you will need to re-authenticate.client.authenticate(client_id="my-company.service-account@demo.huvrdata.app",client_secret="my-secret")Fetch Data Examplepassparamsto specify filtersfor full list of available filters - seeAPI docspagination_data=client.projects.list(params={"asset_search":"my-site/my-asset"})# some responses will contain pagination info {next, previous, count, results}projects=pagination_data["results"]# result data will be raw python dicts/lists etcforprojectinprojects:print(project["name"])Post Data Examplepassjsonto request when creating/updating datafor full list of expected json data - seeAPI docsproject=client.projects.create(json={"name":"My Project","asset":24,# asset id"type":36,# project type id})# result data will be raw python dicts/lists etcprint(project["id"])Raw Request Exampleif requesting a non-json or "internal" endpoint, can make a raw request.this will return a standard pythonrequests.Responseobjectresponse=client.request(method="GET",path="/api/.../",# params={...},# json={...},# headers={...},# data={...},)response.content# access raw bytes, or .json(), etcContributing / InternalsDocker Required:https://www.docker.comRun CodegenAll API endpoints are generated from the OpenAPI spec.To regenerate the client code, first, obtain a link to the latest OpenAPI spec athttps://docs.huvrdata.app/openapi/. Then run the following command:makegenerate_clientopen_api_url="https://docs.huvrdata.app/openapi/<version>"If a newmoduleis added to the spec, you will need to add it to thehuvr_client/client.pyfile.Testcreate atests/.env.yamlfile based on thetests/.example.env.yamlfile.maketestcan also open a shell in the test containermakeipythonthen:client=get_huvr_client(...)PublishGenerate a Release on GitHub.  This will trigger a GitHub Action to publish the package to PyPi.
Package: hu-wiwi-grades
Table of Contenthu_wiwi_gradesBackgroundInstallationRequirementsUsageLicensehu_wiwi_gradeshu_wiwi_gradesis a Python library for searching, viewing and scraping published students' grading of the Faculty of Economics and Business Administration of the Humboldt University of Berlin.Please note: The functionality maybe interrupted in case any changes in the publication occur or in case the website is not available.BackgroundThis library was primarily created for testing/training purposes, such as extracting information from PDF files, writing and publishing of code. It nevertheless aims to offer a use-case. Current and historical grading information may be of interest for (prospective) students, examiners or potentially even employers.InstallationAvailable as soon as the package has been added to The Python Package Index (PyPI) (not supported yet!):Use the package managerpipto install hu_wiwi_gradespipinstallhu_wiwi_gradesor through the author's Github repositorypipinstallgit+https://github.com/NDelventhal/hu_wiwi_gradesRequirementsThe following libraries are required:tabulapandasnumpyrequestsbeautifulsoup4These libraries can be installed via the package managerpip.pipinstalltabulanumpypandasrequestsbs4Usageimporthu_wiwi_gradesashuhu.list_sources()# scrapes URL sources that list grading overviews and returns a dictionary containing the semesters as keys and the URLs as values.df=hu.scrape_overview(exam="Economics")# Scrapes the latest grading overview and returns the overview or a subset based on the entered exam specification.# In this example solely "Finance" exams are returned. The exam arguments defaults to "" (no filtering).df=hu.scrape_all_overviews(exam="Valuation")# Same as above, but instead of solely the latest overview all historical overviews are pulled. Typically, a few semesters are available.df=hu.get_grading(exam="",only_current_semester=True)# Scrapes the grades from the URLs listed in the overview pages of either only the latest semester (only_current_semester = True) or all (only_current_semester = False).# An exam filter may be specified as in the examples above or not.# Returns a dataframe listing the number of participants, the examiner and all grades as variables.df2=hu.prepare_for_analysis(df)# Prepares the dataframe output of get_grading() for further analysis, such as visualisations, descriptive statistics or regression analysis.Further usuage examples are listedhereLicenseThis project is licensed under theMIT License.
Package: huygens
huygensThis is a python package for drawing diagrams.
Intended to have multiple backends, currently the only
backend implemented usescairo.
Hopefully there will also be aPyXbackend.It can also include text from TeX via pdftex, pdflatex, xetex or xelatex.Diagrams are able to be composed in various ways, based
on a linear constraint solver. Therefore, this system becomes
a declarative graphics layout package.This package is at an early stage of development, so expect
things to change drastically and without warning.User guideRead it onlinehere.
The documentation is distributed inhuygens/doc.
Package: huzzer
A very-simple-subset-of-haskell fuzzer. With the ability to generate lexical tokens as well as plain code.```module Generated (function0,function1,function2) wherefunction0 :: Int -> Bool -> Bool -> Bool -> Bool -> Int -> Intfunction0 a b c d e f = (function1 (2 /= 7) False False)function1 :: Bool -> Bool -> Bool -> Intfunction1 a b c = (8 * 0)function2 :: Bool -> Intfunction2 a = 1```it's available on pip by `pip install huzzer` (python3+ only)## Using `huzzer`The easiest way to use `huzzer` is from the command line:```>>>>> huzzmodule Generated (function0,function1,function2) wherefunction0 :: Bool -> Boolfunction0 a = ((function2 4 (0 >= 5)) <= ((mod 8 9) + (1 - (function2 0 a))))function1 :: Bool -> Int -> Int -> Bool -> Boolfunction1 a b c d = ((a && a) && (function0 (function1 True b c d)))function2 :: Int -> Bool -> Intfunction2 a b = (div (function2 (max a a) b) 3)```There are some options to vary the complexity of programs:```bash>>>>> huzz -hHuzz.Usage:huzz [--seed=<randomseed>] [--max-args=<maxarglen>] [--expr-depth=<exprdepth>]huzz -h | --helpOptions:-h --help                    Show this screen.-s --seed=<randomseed>       Use <randomseed> to initialise RNG.-a --max-args=<maxarglen>    Maximum number of arguments a function can have [default: 8].-e --expr-depth=<exprdepth>  Maximum expression depth [default: 6].```### Using From Inside Python```pythonfrom huzzer.huzz import huzzerfrom huzzer.tokenizing import tokenizeseed = 1337random_haskell_code = huzzer(seed,max_expression_depth=4,max_type_signiature_length=5,max_number_of_functions=3,)tokens = tokenize(random_haskell_code)non_whitespace_token_ids = [x.type for x in tokens if x.channel == 0]print(random_haskell_code)print('======================')print(non_whitespace_token_ids)``````shmodule Generated (function0,function1,function2) wherefunction0 :: Bool -> Int -> Bool -> Bool -> Boolfunction0 a b c d = ((function1 9) && (function0 d 1 d (function0 c b d d)))function1 :: Int -> Boolfunction1 a = (False || True)function2 :: Bool -> Int -> Bool -> Bool -> Boolfunction2 a b c d = (function2 True 9 False c)======================[1, 2, 51, 16, 4, 17, 4, 18, 52, 3, 53, 16, 5, 37, 6, 38, 6, 37, 6, 37, 6, 37, 53, 16, 8, 9, 10, 11, 7, 51, 51, 17, 48, 52, 36, 51, 16, 11, 40, 11, 51, 16, 10, 9, 11, 11, 52, 52, 52, 53, 17, 5, 38, 6, 37, 53, 17, 8, 7, 51, 50, 35, 49, 52, 53, 18, 5, 37, 6, 38, 6, 37, 6, 37, 6, 37, 53, 18, 8, 9, 10, 11, 7, 51, 18, 49, 48, 50, 10, 52]```## SetupMake sure you have python3 on your machine (`which python3` should print a path to it).Set up a `virtualenv` with `virtualenv -p \`which python3\` env`Activate the environment with `source env/bin/activate`Install requirements `pip install -r requirements.txt`Then you should be good to go. To leave the virtualenv, type `deactivate`## TestingTo run all of the tests, run `nosetests`.To run larger acceptance tests (against the ghc compiler), you will need `ghc` and `parallel` installed.run `./large_acceptance_test.sh <number of tests>`## TODOs* multiple definitions for functions### Distribution```python setup.py sdist bdist_wheeltwine upload dist/*```
Package: hv4gha
HashiCorp Vault for GitHub AppsPython library for usingHashiCorp Vault'sTransit Engineto
manage a GitHub App's private RSA key. More precisely, the library
provides the following pieces of functionality.Perform initial import of the App's private key into VaultHave Vault sign the needed JWT and then request a GitHub Access TokenSeeAuthenticating as a GitHub App installation (GitHub Docs)for context.Installationpipinstallhv4ghaUsageIn addition to the examples below see also thehv4gha/entry.pydocstrings.Import App keyfromhv4ghaimportimport_app_keywithopen("/path/to/github-app.private-key.pem","r")asakh:my_app_key=akh.read()import_app_key(pem_key=my_app_key,key_name="my-github-app",vault_addr="https://vault.example.com:8200",vault_token="...",)Issue Access Tokenfromhv4ghaimportissue_access_tokenresponse=issue_access_token(key_name="my-github-app",vault_addr="https://vault.example.com:8200",vault_token="...",app_id=368468,account="andreaso",)access_token=response["access_token"]token_expiry=response["expires_at"]Issue scoped Access Tokenfromhv4ghaimportissue_access_tokenresponse=issue_access_token(key_name="my-github-app",vault_addr="https://vault.example.com:8200",vault_token="...",app_id=368468,account="andreaso",permissions={"contents":"read"},repositories=["world-domination"],)access_token=response["access_token"]token_expiry=response["expires_at"]Vault requirementsSomewhat simplified, this is what's required Vault wise.Transit secrets engineFirst of all, theTransit Engineneeds to be enabled.vaultsecretsenabletransitHere we are sticking to the defaulttransit/mount point.Import policypath"transit/wrapping_key"{capabilities=["read"]}path"transit/keys/my-github-app/import"{capabilities=["update"]}Issue policypath"transit/sign/my-github-app"{capabilities=["update"]}Vault TokenFor obtaining the initial Vault Token, see thehvacPython
library and itsAuth Methodsdocumentation.
Package: hvac
hvacHashiCorpVaultAPI client for Python 3.xTested against the latest release, HEAD ref, and 3 previous minor versions (counting back from the latest release) of Vault.
Current official support covers Vault v1.4.7 or later.NOTE:Support for EOL Python versions will be dropped at the end of 2022.  Starting in 2023, hvac will track
with the CPython EOL dates.Installationpip install hvacIf you would like to be able to return parsed HCL data as a Python dict for methods that support it:pip install "hvac[parser]"DocumentationAdditional documentation for this module available at:hvac.readthedocs.io:Getting StartedUsageAdvanced UsageSource Reference / AutodocContributingChangelog
Package: hvae-backbone
hVAE - backboneThis repository contains:customizable backbone implementation of hVAEreuseable hVAE components such as blocks, layers, losses, etc.training, evaluation and analyzation scriptscheckpoint handling (usingWeights & Biases)Installationpipinstallhvae_backboneUsageThis repository is intended to be used as a backend package.Please refer tohvae templaterepository for usage instructions.Project Structure├── hvae_backbone
│   ├── elements
│   │   ├── __init__.py             
│   │   ├── data_preproc.py         # Modules for data preprocessing
│   │   ├── dataset.py              # Base dataset class
│   │   ├── distributions.py        # Distributions, distributions generation
│   │   ├── layers.py               # Layers for building models
│   │   ├── losses.py               # Loss functions
│   │   ├── nets.py                 # Network architectures
│   │   ├── optimizers.py           # Optimizers
│   │   ├── schedules.py            # Schedules e.g. LR, KL weight
│   ├── __init__.py                 # package level scripts
│   ├── analysis.py                 # Analysis tools for trained models
│   ├── block.py                    # Blocks for building hierarchical models
│   ├── checkpoint.py               # Checkpoint handling (save, load)
│   ├── functional.py               # Functional scripts (training, loss, etc.)
│   ├── hvae.py                     # General hVAE class
│   ├── sequence.py                 # General sequential hVAE class
│   ├── utils.py                    # Utility functionsTODO:callbackspreprocessingsample vs rsmaple blokkoknál (SimpleGenBlock)weight initialization
Package: hvalidation
hehey-hvalidation介绍hehey-hvalidation 是一个python 全面的验证器工具类.
其主要特点有:支持常用验证器验证器易扩展支持验证字典以及对象属性示例全面依赖以及版本要求python >= 3.5安装直接下载:命令安装：pip install hehey-hvalidation基础文件以目录参数配置# 验证器规则参数# 验证器参数基本示例快速使用from接入hehey 组件多个验证器验证多个属性多个验证器支持与或 or,and,&,|设置验证规则错误消息设置验证器错误消息设置验证规则使用场景设置验证规则的前置条件添加自定义验证器验证器直接为方法或函数直接使用验证器验证装饰器注册验证器装饰器注册验证规则默认验证器
验证器 | 说明 | 基础示例
----------|-------------|------------required| 要求此字段/属性是必须的(不为空的)。关于为空|['tagId, userId', 'required' ]int/integer| 验证是否是 int支持范围检查|['userId', 'int']['userId', 'int', 'min'=>4, 'max'=>16]
Package: hveto
Hveto is a python implementation of the HierarchicalVeto algorithm. It is
a package designed for gravitational-wave detector characterisation and
data quality.The Hveto algorithm is fully described inSmith et al. 2011(Classical and Quantum Gravity).https://hveto.readthedocs.ioInstallationHveto is best installed withconda:condainstall-cconda-forgehvetobut can also be installed withpip:python-mpipinstallhvetoContributingAll code should follow the Python Style Guide outlined inPEP 0008;
users can use theflake8package to check their code for style issues
before submitting.Seethe contributions guidefor the recommended procedure for
proposing additions/changes.
Package: h-vialib
h-vialibLibrary functions for use with Via.UsageThis is an internal library, mostly of interest to maintainers ofViaand related components.Some items of interest:Configuration- Configuration parameter managementSetting up Your h-vialib Development EnvironmentFirst you'll need to install:Git.
On Ubuntu:sudo apt install git, on macOS:brew install git.GNU Make.
This is probably already installed, runmake --versionto check.pyenv.
Follow the instructions in pyenv's README to install it.
TheHomebrewmethod works best on macOS.
TheBasic GitHub Checkoutmethod works best on Ubuntu.
Youdon'tneed to set up pyenv's shell integration ("shims"), you canuse pyenv without shims.Then to set up your development environment:git clone https://github.com/hypothesis/h-vialib.git
cd h-vialib
make helpReleasing a New Version of the ProjectFirst, to get PyPI publishing working you need to go to:https://github.com/organizations/hypothesis/settings/secrets/actions/PYPI_TOKENand add h-vialib to thePYPI_TOKENsecret's selected
repositories.Now that the h-vialib project has access to thePYPI_TOKENsecret
you can release a new version by justcreating a new GitHub release.
Publishing a new GitHub release will automatically triggera GitHub Actions workflowthat will build the new version of your Python package and upload it tohttps://pypi.org/project/h-vialib.Changing the Project's Python VersionsTo change what versions of Python the project uses:Change the Python versions in thecookiecutter.jsonfile. For example:"python_versions":"3.10.4, 3.9.12",Re-run the cookiecutter template:make templateCommit everything to git and send a pull requestChanging the Project's Python DependenciesTo change the production dependencies in thesetup.cfgfile:Change the dependencies in the.cookiecutter/includes/setuptools/install_requiresfile.
If this file doesn't exist yet create it and add some dependencies to it.
For example:pyramid
sqlalchemy
celeryRe-run the cookiecutter template:make templateCommit everything to git and send a pull requestTo change the project's formatting, linting and test dependencies:Change the dependencies in the.cookiecutter/includes/tox/depsfile.
If this file doesn't exist yet create it and add some dependencies to it.
Use tox'sfactor-conditional settingsto limit which environment(s) each dependency is used in.
For example:lint: flake8,
format: autopep8,
lint,tests: pytest-faker,Re-run the cookiecutter template:make templateCommit everything to git and send a pull request