Saravanan666/pypi-org huggingface dataset:
Package: clark-cli
AboutThis repository contains the Command Line Client (CLI) for Clark which was produced byElio.earth.
We aim to simpify researcher's documentation and execution processes with Clark. The CLI is a tool which researchers
use to document their workflows. This enables the researcher to definitively understand the end-to-end process of their
research and creates a system of record with versioning for their research (similar to Github).Pre-requisitesLinux or MacOSPython 3.xMacOS only:sudoaccess to your machine (We useDTraceto trace system calls)InstallThe CLI is available from PyPI.pipinstallclark-cliUseBelow is a basic usage example from start to finish.RegisterSign-up for an account athttps://www.clarknest.com/register.Remember to check your email to confirm your account. You will need to confirm your account before using the CLI.Once you are registered, and you have confirmed your accountyou will be ready to issue commands with the CLI.Create a WorkflowFirst login to the CLI using the credentials you registered with.clarkloginTo view all the possible commands run:clark--helpThe next step is to create directories and workflows. Just like a filesystem, you can organize your workflows into directories.
You initially start with an emptyvirtualfilesystem.Create a directory in the root folder (post login you always start in the root of yourvirtualfilesystem)clarkadddirectoryprojectAChange into the directory you just created.clarkcdprojectANow you are ready to execute a script.clarkupload--message"A message to attach to this version of your workflow"pythonmy_script.pyThe CLI will run your script and auto-detect the inputs and outputs of the script. You will be asked to
confirm the inputs and outputs before they are stored in the workflow. We upload the inputs, outputs and script to
our servers.If you made a mistake you can re-run the workflow and "replace" the previous run of the script.clarkupload--message"A different message for this run"--replacepythonmy_script.pyDon't worry, you will have access to both versions of your workflow in the UI (described below). We create a version for each
upload.You can then go to another directory or workflow. You can back out of the workflow by:clarkcd..View a WorkflowYou can then go to theClark Nestto view your workflows, add notes to the nodes or workflows.ExamplesThere some execution examples in the examples folder.ContributingIf you have a bug-fix or small improvement we welcome pull requests. If unsure, please reach out to us attech@elio.earth.Setup Local Dev EnvironmentThese instructions are intended for developers to set up their location development environment.InstallpyenvInstall Python 3.10.0pyenvinstall3.10.0Download repocd~/workspace/
gitclonegit@github.com:Elio-Earth/clark-cli.gitCreate virtual envpyenvvirtualenv3.10.0clark-cliUpdate pippython-mpipinstall--upgradepipInstall requirementspipinstall-rrequirements.txtInstall cli in development mode.pipinstall--editable~/workspace/clark-cliUpgrade buildpython-mpipinstall--upgradebuildTestingTo run the test suitecd~/workspace/clark-cli
pytest.
Package: clarmy02
clarmy02clarmy02如何开发一个开源的 Python 扩展包基本步骤本地功能调通添加测试用例$pytest./tests/测试本地安装成功$pythonsetup.pyinstall&&python-c"import clarmy02"构建、上传到 pypi.org$ rm -rf ./dist
$ python setup.py sdist
$ twine upload dist/*测试用 pip 从 pypi.org 安装自己的包$pipinstall-ihttps://pypi.org/simple/clarmy02==0.0.1构建、上传到 anaconda.org
编写 meta.yaml，定义元信息。$condabuild.
$anacondaupload<path>
Package: clashapi
ClashAPIUsing your developer account's login email and password, update the IP address of all your existing Clash of Clans and/or Clash Royale API keys to the current one, and obtain their tokens.Getting StartedInstallingpipinstallclashapiUsageimportclashapi# Clash of Clanstokens=clashapi.coc("email","password")# Clash Royaletokens=clashapi.cr("email","password")# tokens is a list of api key token strings that you can now use to access the COC/CR APIsQuick Exampleimportrequestsimportclashapitokens=clashapi.coc("email","password")response=requests.get(url="https://api.clashofclans.com/v1/clans/%23208GJG2J",headers={"Accept":"application/json","authorization":f"Bearer{tokens[0]}"})print(response.json())
Package: clashbyte
ClashByteClash & Clash.Meta 外部控制的 Python 实现Get startedInstall packagepipinstall-Uclashbytehello worldfromclashbyteimportClashMetaAPICONTROLLER_URL="http://127.0.0.1:9090"if__name__=='__main__':clash=ClashMetaAPI()ifclash.is_alive:print(f"{clash.version=}")
Package: clashgap
ClashgapA per-character diff/compression algorithm implementation in pythonHow it worksIn case if you have two strings:"This is a sentence..." and "This is a word..."you could "clash" both of them together and find their gap, to get an array loking something like:["This is a", ["sentence", "word"], "..."]As you can the clashgap algorithm looks for collisions in the two strings to find the gap. The clashgaped string maybe used for compression or as the diff of the input strings
Package: clashofclans-api
ClashofClans-API is an easy to use API for the mobile game ClashofClansInstallingInstall and update usingpip:$ pip install clashofclans-apiCreate an API tokenAn API token is required to execute the script. You can create onehere.A Simple ExamplefromClashofClansimportClashofClanscoc=ClashofClans("your API token")response=coc.players.get_player_info("e.g. #9Q8QYQ20Q or 9Q8QYQ20Q")print(response)$ python3 file.py
    (200, <Response [200]>, {'tag': '#9Q8QYQ20Q', 'name': 'Orange', 'townHallLevel': 15, 'townHallWeaponLevel': 4, 'expLevel': 244, ...DisclaimerThis content is not affiliated with, endorsed, sponsored, or specifically approved by Supercell and Supercell is not responsible for it.
For more information seeSupercell’s Fan Content Policy.
Package: clashroyale
clashroyaleThis library is currently an (a)sync wrapper forhttps://royaleapi.comand the official Clash Royale API with
great functionality.InstallationDevelopment buildpipinstallgit+https://github.com/cgrok/clashroyaleStable buildpipinstallclashroyaleDocumentationHosted on readthedocs.io (https://clashroyale.readthedocs.io)Docstrings are written using theNumpyDocspecification
Package: clask
ClaskGithub:https://github.com/mouday/Clask简介Clask: a http client based on requests just like Flask对比：-描述运行环境Flask路由映射到方法服务端Clask方法映射到路由客户端安装pipinstallclask使用示例1、Flask作为服务器代码# -*- coding: utf-8 -*-fromflaskimportFlask,jsonifyapp=Flask(__name__)@app.route("/get")defget():data={"name":"Tom","age":23}returnjsonify(data)if__name__=='__main__':app.run(debug=True)2、Clask作为客户端的代码# -*- coding: utf-8 -*-fromclaskimportClaskapi=Clask(base_url="http://127.0.0.1:5000")# 发送get请求@api.route("/get")defget():passif__name__=='__main__':get()# '{"name": "Tom", "age": 23}'其他示例# 发送get请求@api.get("/get")defget():pass# 发送get请求@api.post("/post")defpost():pass# 前置处理器@api.before_requestdefbefore_request(options):print('before_request::',options)returnoptions# 后置处理器@api.after_requestdefafter_request(response):print('after_request',response.status_code)returnresponse.json()# 异常处理器@api.error_handlerdeferror_handler(e):print(e)returnNone
Package: clasp-segmentation
ClaSP - Time Series SegmentationInstallationYou can also install  the project from source.Build from SourceFirst, download the repository.git clone https://github.com/patrickzib/clasp_segmentation.gitChange into the directory and build the package from source.pip install .Example Codefromclasp.annotation.claspimportClaSPSegmentation,find_dominant_window_sizesX=...# load datasetdominant_period_size=find_dominant_window_sizes(X)*2clasp=ClaSPSegmentation(dominant_period_size,n_cps=1)found_cps=clasp.fit_predict(X)profiles=clasp.profilesscores=clasp.scoresSee also the notebooks-folder for a Jupyter-NotebookCitingIf you use this algorithm or publication, please cite:@inproceedings{clasp2021,title={ClaSP - Time Series Segmentation},author={Sch"afer, Patrick and Ermshaus, Arik and Leser, Ulf},booktitle={CIKM},year={2021}}
Package: claspy
ClaSPy: A Python package for time series segmentationTime series segmentation (TSS) tries to partition a time series (TS) into semantically meaningful segments. It's an important unsupervised learning task applied to large, real-world sensor signals for human inspection, change point detection or as preprocessing for classification and anomaly detection. This python library is the official implementation of the accurate and domain-agnostic TSS algorithm ClaSP.InstallationYou can install ClaSPy with PyPi:python -m pip install claspyUsageLet's first import the ClaSP algorithm and TS data from the"Time Series Segmentation Benchmark"(TSSB) to demonstrate its utility.>>>fromclaspy.segmentationimportBinaryClaSPSegmentation>>>fromclaspy.data_loaderimportload_tssb_datasetAs an example, we choose theCricketdata set that contains motions of different umpire signals caputured as wrist acceleration. ClaSP should automatically detect semantic changes between signals and deduce their segmentation. It is parameter-free, so we just need to pass the time series as a numpy array.>>>dataset,window_size,true_cps,time_series=load_tssb_dataset(names=("CricketX",)).iloc[0,:]>>>clasp=BinaryClaSPSegmentation()>>>clasp.fit_predict(time_series)[712128119332581]ClaSP is fully interpretable to human inspection. It creates a score profile (between 0 and 1) that estimates the probability of a "change point" in a TS, where one segment transitions into another. We visualize the segmentation and compare it to the pre-defined human annotation.clasp.plot(gt_cps=true_cps,heading="Segmentation of different umpire cricket signals",ts_name="ACC",file_path="segmentation_example.png")ClaSP accurately detects the number and location of changes in the motion sequence (compare green vs red lines) that infer its segmentation (the different-coloured subsequences). It is carefully designed to do this fully autonomously. However, if you have domain-specific knowledge, you can utilize it to guide and improve the segmentation. See itsparametersfor more information.ExamplesCheckout the following Jupyter notebooks that show applications of the ClaSPy package:ClaSP evaluation on the "Time Series Segmentation Benchmark" (TSSB)Hyper-parameter Tuning and Configuration of ClaSPWindow Size Selection for Unsupervised Time Series AnalyticsCitationThe ClaSPy package is actively maintained, updated and intended for application. If you use ClaSP in your scientific publication, we would appreciate the followingcitation:@article{clasp2023,
  title={ClaSP: parameter-free time series segmentation},
  author={Arik Ermshaus and Patrick Sch{\"a}fer and Ulf Leser},
  journal={Data Mining and Knowledge Discovery},
  year={2023},
}TodosHere are some of the things we would like to add to ClaSPy in the future:Future research related to ClaSPExample and application Jupyter notebooksMore documentation and testsIf you want to contribute, report bugs, or need help applying ClaSP for your application, feel free to reach out.
Package: class-argparse
Class-ArgparseClass based argument parser to simplify writing CLIs that have lots of optionsHow to usefromtypingimportLiteralclassMain(ClassArgParser):def__init__(self)->None:super().__init__(name="Class ArgParser")defno_args(self):print("no_args")defsome_args(self,arg:str):print("some_args",arg)defdefault_values(self,arg:str,default:int=0):print("default_values",arg,default)deflist_values(self,values:List[str]):print("list_values",values)defuntyped_arg(self,untyped):print("untyped_arg",untyped)asyncdefasync_func(self,arg:str):print("async_func",arg)defliteral_options(self,arg:Literal["a","b"]):print("literal_options",arg)if__name__=="__main__":Main()()How this worksThe classClassArgParserextendsArgumentParserThe initialization function finds add adds all the methods on child classes that are public i.e. their names don't start with__The object of the class is called and after identifying whether the function being called it is async or sync it runs the function accordingly
Package: class-arguments
Class-Argumentsa new written style for argparse一种新的argparser写法样例代码# example.pyfromargumentsimportArgument,OptionclassComputeArg(Argument):"""THIS IS A DESCRIPTION ! ! ! !a compute program"""x=Option("x",type=int,help="variable x")y=Option("y",type=int,help="variable y")opt=Option("--operator","-opt",type=str,required=True,help="operator")if__name__=="__main__":args=ComputeArg()ifargs.opt=="x":print(args.x*args.y)elifargs.opt=="+":print(args.x+args.y)elifargs.operator=="-":print(args.x-args.y)elifargs.operator=="/":print(args.x/args.y)样例输出❯ python example.py --help
usage: example.py [-h] --operator OPERATOR x y

THIS IS A DESCRIPTION ! ! ! ! a compute program

positional arguments:
  x                     variable x
  y                     variable y

options:
  -h, --help            show this help message and exit
  --operator OPERATOR, -opt OPERATOR
                        operator❯ python example.py 1 2 -opt + 
3❯ python example.py 1 2 --operator /
0.5❯ python example.py           
usage: example.py [-h] --operator OPERATOR x y
example.py: error: the following arguments are required: x, y, --operator/-opt安装pip install class-arguments说明开发动机纯粹为了取悦自己而对 argparser 模块进行了包装Option 的__init__参数与 argparser 模块的add_argument的参数完全一致,不改变原有编写习惯
Package: classattr
classattr packageThis package provides tools to manage objects attributes.It has been made tu be used as a parent class in order to deal with default values for some attributes.Installationpip install classattrClass and object attibutesFor example, you'd like to program a Dot class.
Dots attributes arexandycoordinates,diameterandcolorof the dot.Most of the time,xandycoordinates depend of the dot butdiameterandcolorare the same.You can program it in python this way:classDot:diameter=2color='blue'def__init__(self,x,y):self.x=xself.y=ydef__repr__(self):returnf'x ={self.x}, y ={self.y}, diameter ={self.diameter}, color ={self.color}'>>>d1=Dot(2,3)>>>d2=Dot(-1,4)>>>d3=Dot(6,11)>>>d1x=2,y=3,diameter=2,color=blueIf you want to change d2 color:>>>d2.color='yellow'>>>d2x=-1,y=4,diameter=2,color=yellow>>>d3x=6,y=11,diameter=2,color=blueAnd if you want to turn default color from blue to black:>>>Dot.color='black'>>>d1x=2,y=3,diameter=2,color=black>>>d2x=-1,y=4,diameter=2,color=yellow>>>d3x=6,y=11,diameter=2,color=blackWith classattrTo program the above example with classattr, you can do it this way:fromclassattrimportClassAttr,RAISE,FORCEclassDot(ClassAttr):## class atribute, can be default valuex=0y=0radius=2color='blue'def__init__(self,attr={},mode=RAISE,**kwargs):ClassAttr.__init__(self,attr,mode,**kwargs)Then to create new dots, you can use syntax below:>>>d1=Dot(x=2,y=3)>>>d2=Dot(x=-1,y=4,color='yellow')>>>d3=Dot(x=6,y=11)or use a dictionary>>>d1=Dot({'x':2,'y':3})>>>d2=Dot({'x':-1,'y':4,'color':'yellow'})>>>d3=Dot({'x':6,'y':11})To change an attribute's value :>>>d1.set(x=8)or>>>d1.set({'x':8})To change an attribute's default value :>>>Dot.set_default(color='lightblue')or>>>Dot.set_default({'color':'lightblue'})To get attributes values :>>>d1.get(){'x':8,'y':3,'radius':2,'color':'lightblue'}>>>d2.get(){'x':-1,'y':4,'radius':2,'color':'yellow'}>>>d3.get(){'x':6,'y':11,'radius':2,'color':'lightblue'}To get only one attribute :>>>d1.get('color')'lightblue'And to get some :>>>d1.get(['color','radius']){'color':'lightblue','radius':2}To get attributes list :d1.get_keys()['color','radius','x','y']To create a new attribute, use mode :MODE :RAISE (default value) raise an exception error if attribute doesn't already exist
IGNORE ignore attribute doesn't already exist
FORCE create the new attribute>>>d1.set({'z':8},mode=FORCE)>>>d1.get(){'x':8,'y':3,'radius':2,'color':'lightblue','z':8}
Package: classcard-dataclient
DataClientIntroductionthis is a tool which save data to class card serverUsage1. installpipinstallclasscard-dataclient2. init client# init instanceclient=DataClient()# set the configclient.set_config_module("config")3. call methoddata=Model(**{"xxx":"xxx"})code,msg=client.create_section(data)Notice:when data is model instance , code is integer, msg is string,when data is instance list, the code is list, msg is also list.
Package: classcharts
ClassCharts APIDependenciesThis package requires requests to workpip install requestsCompletedClientsSupports Student clientsSupport Parent ClientsAuto log back in after 3 minutesInformationUnchecked boxes means utilities to make accessing them easier have not been createdAnnouncementsHomeworkHomework StatusesBehaviour PointsRewardsStudent InformationTimetable LessonDay Timetable
Package: classcharts.py
classcharts.pyAn unofficial API wrapper for the ClassCharts homework and student API.
It is work-in-progress.ExamplesExamples are using the asyncio REPL.>>>importasyncio>>>importdatetime>>>importclasscharts>>>hc=classcharts.HomeworkClient("Your_School_Here")>>>awaithc.request(datetime.datetime.now(),7)[<Homework...>,<Homework...>]>>>importasyncio>>>importdatetime>>>importclasscharts>>>sc=classcharts.StudentClient("MYC0D3",datetime.datetime(year=1970,month=1,day=1))>>>awaitsc.detentions()[<Detention...>,<Detention...>]Requirementsaiohttpbeautifulsoup4lxmlInstall$python-mpipinstall-Uclasscharts.py
Package: classcli
# ClassCLICommand Line Interfaces from class definitions.[![PyPI version](https://badge.fury.io/py/classcli.svg)](https://badge.fury.io/py/classcli) [![PyPI version](https://img.shields.io/badge/python-%3E%3D%203.5-blue.svg)](https://pypi.org/project/classcli/) [![Build Status](https://travis-ci.org/Hrabal/ClassCLI.svg?branch=master)](https://travis-ci.org/Hrabal/ClassCLI) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/ece6dfe1a5774a5992061515b36db0d4)](https://app.codacy.com/app/federicocerchiari/ClassCLI?utm_source=github.com&utm_medium=referral&utm_content=Hrabal/ClassCLI&utm_campaign=Badge_Grade_Dashboard) [![Maintainability](https://api.codeclimate.com/v1/badges/d281ff92c2d45c4f2e75/maintainability)](https://codeclimate.com/github/Hrabal/ClassCLI/maintainability) [![Coverage Status](https://coveralls.io/repos/github/Hrabal/ClassCLI/badge.svg?branch=master)](https://coveralls.io/github/Hrabal/ClassCLI?branch=master) [![Downloads](https://pepy.tech/badge/classcli)](https://pepy.tech/project/classcli) [![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/Hrabal/ClassCLI/master/LICENSE)Very similar to [Fire](https://github.com/google/python-fire), this is a Python module that let you build command line interfaces directly from collection of classes, saving you from writing boilerplate code.ClassCLI is built on top of argparse, it create arguments of the cli by inspecting the classes in a given list or in a module. Each compatible class is transformed in a first-level argument, each function in a second-level argument, each function's argument in a third level argument.ClassCLI uses docstrings to build the CLI's help, kwargs defaults to set CLI's pars defaults and type hints to infer CLI's pars types.ClassCLI can be used to build CLI interfaces on top of existing APIs, or can be used to write scripts with a full-featured CLI writing commands and arguments as classes and functions.Example code:```pythonfrom classcli import CliBuilderclass NonCommandClass:passclass MainCommand:"""Docstring are used for help."""callable_cls = Truecommand = 'foo'def _base(self):"""Docstring are used for help in methods too."""print('This script is running as a foo.')def with_args(self,first_arg: int,  # Type annotations are used to add a type check on the CLI argsecond_arg):print('This script is running as a foo with %s %s.' % (first_arg, second_arg))class SecondCommand:callable_cls = Truecommand = 'bar'def _base(self):print('This script is running in a bar.')def order(self,order='Beer'  # method kwargs are translated to optiona args in the form of "--arg"):print('You ordered a %s' % order)if __name__ == '__main__':CliBuilder(locals()).run_cli()```This projects's goals:* this project should let fast CLI prototyping* this project should stay lightweight
Package: classconfig
classconfigPackage for creating (yaml) configuration files automatically and loading objects from those configuration files.InstallationYou can install it using pip:pip install classconfigUsageAt first we need a class that is configurable it means that it hasConfigurableAttributeclass members. Such asConfigurableValueorConfigurableFactory. Let's create two simple classes where one of them will have the other
instance as a member:fromclassconfigimportConfigurableValue,ConfigurableFactory,ConfigurableMixinclassInventory(ConfigurableMixin):size:int=ConfigurableValue(desc="Size of an inventory",user_default=10,validator=lambdax:x>0)classCharacter(ConfigurableMixin):lvl:int=ConfigurableValue(desc="Level of a character",user_default=1,validator=lambdax:x>0)name:str=ConfigurableValue(desc="Name of a character")inventory:Inventory=ConfigurableFactory(desc="Character's inventory",cls_type=Inventory)You can see that the usage is similar to dataclasses as it also uses descriptors. You can omit theConfigurableMixininheritance but then you will have to write your own__init__method e.g.:classInventory:size:int=ConfigurableValue(desc="Size of an inventory",user_default=10,validator=lambdax:x>0)def__init__(self,size:int):self.size=sizeCreating configuration fileNow let's create a configuration file for ourCharacterclass. You can do it by callingsavemethod ofConfigclass:fromclassconfigimportConfigConfig(Character).save("config.yaml")You will get a file with the following content:lvl:1# Level of a charactername:# Name of a characterinventory:# Character's inventorysize:10# Size of an inventoryValidationAs you have seen in the previous example, it is possible to add a validator.
A validator could be any callable that takes one argument and returnTruewhen valid.
You can also raise an exception if the argument is invalid to specify the reason for the failure.There are various predefined validators inclassconfig.validatorsmodule.TransformationIt is possible to specify a transformation (transformattribute) that will transform user input. The transformation
is done before the validation. Thus, it can be used to transform input into valid form.It can be any callable that takes one argument and returns the transformed value, but there also exist some predefined
transformations inclassconfig.transformsmodule.LoadingNow let's load the configuration file we just created and create an instance ofCharacterclass:fromclassconfigimportConfig,ConfigurableFactoryconfig=Config(Character).load(path)# load configuration fileloaded_obj=ConfigurableFactory(Character).create(config)# create an instance of Character classWhy YAML?YAML is a human-readable data serialization language. It is easy to read and write. It is also easy to parse and
generate.It supports hierarchical data structures, which are very useful when you need to represent configuration
of a class that has other configurable classes as members.It supports comments, unlike e.g. json, which is also a big advantage.