Saravanan666/pypi-org huggingface dataset:
Package: pylake
PyLakeThis work present methods used to compute meaningful physical properties in aquatic sciences.The methods are based on Xarray.
Multi-dimensional large time-series array are compatible if an xarray is passed as input.Algorithms and documentation are sometimes inspired by LakeAnalyzer in R (https://github.com/GLEON/rLakeAnalyzer)Implemented methods:ThermoclineMixed layerMetalimnion extent (epilimnion and hypolimnion depth)Wedderburn NumberSchmidt stabilityHeat contentSeiche periodeLake NumberBrunt-Vaisala frequencyAverage layer temperatureMonin-ObhukovInstallationPylake use Dask which require a python version >=3.8pip install pylakeUsageHave a look in the notebooks, an example is providedimportpylakeimportnumpyasnpTemp=np.array([14.3,14,12.1,10,9.7,9.5,6,5])depth=np.array([1,2,3,4,5,6,7,8])epilimnion,hypolimnion=pylake.metalimnion(temp,depth)Work in progressWarning messages
Lake metabolizer is being implemented.
Package: pylama2codeclimate
Converts the (parsable) pylama output to codeclimate.json format.
This was written with the intention of using pylama to analyse python programs and report the output to gitlab ci code quality feature:https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.htmlIt can be used in a gitlab-ci.yml stage like:codequality:
  stage: test
  script:
    - pip3 install pylama2codeclimate pylama
    - pylama --format parsable | pylama2codeclimate > codeclimate.json
  artifacts:
    when: always
    paths: [codeclimate.json]
Package: pylama-dmypy
A linter plugin for pylama that makes it aware of dmypyhttps://mypy.readthedocs.io/en/stable/mypy_daemon.htmlInstallationInstall it into your environment:> python -m pip install pylama-dmypyThen configure your pylama to use thedmypylinter.Changelog0.4 - 4 December 2022Increase speed using a results cache. Now dmypy runs only once and each
file will get warnings/errors from that cached result0.3 - 2 April 2022Updated pylama and mypy0.2 - 27 January 2022fixed the setup.py0.1 - 27 January 2022Creation
Package: pylama_gjslint
Pylama_gjslint#############pylama_gjslint -- Support gjslint for Pylama (https://github.com/klen/pylama)... contents::Requirements=============- python >= 2.6Installation=============**Pylama_gjslint** should be installed using pip: ::pip install pylama_gjslintLicense=======Licensed under a `BSD license`_... _BSD license: http://www.linfo.org/bsdlicense.html
Package: pylama_pylint
pylama-pylint – SupportPylintinPylama.ContentsRequirementsInstallationUsageBug trackerContributingContributorsLicenseRequirementspython >= 2.7InstallationPylama_pylintshould be installed using pip:pip install pylama-pylintUsagepylama -l pylint,pep8See pylama docs for configure pylint with pylama.Bug trackerIf you have any suggestions, bug reports or
annoyances please report them to the issue tracker
athttps://github.com/klen/pylama_pylint/issuesContributingDevelopment of starter happens at github:https://github.com/klen/pylama_pylintContributorsklen(horneds@gmail.com)Serg Baburin (https://github.com/gmist)LicenseLicensed under aBSD license.
Package: pylambda
Easily test and deploy your AWS Lambda function.RequirementsPython 2.7.xpipAWS CLIAWS Account (For deploying)Since AWS currently only supports Python 2.7, you must ensure your function is tested and working in Python 2.7 before deploying.InstallationInstallation should be done using pip:pip install pylambdaOnce installed, make sure you setup the AWS CLI by following:http://docs.aws.amazon.com/cli/latest/userguide/installing.htmlGetting StartedOnce installed you can run pylambda from the console.Runpylambda-hto see help options.Running Your LambdaTo run your lambda function, use the following command:pylambda run my_lambda_function.py-eevent.json-nhandlermy_lambda_function.py = The python file containing your lambda function.event.json = The json event sent to your python function. Seehttp://docs.aws.amazon.com/lambda/latest/dg/python-programming-model-handler-types.htmlhandler = The name of the function that lambda should call. The event.json is passed to this function if provided.Arguments:file : the name of the python file that contains the lambda function. REQUIRED-e, –event : the json file that contains the event data. Must be a parsable json file. OPTIONAL-n, –name : the name of the function that should be called by lambda. Default ‘handler’. OPTIONALDeploying to S3To deploy your code as a zip to S3 navigate to the folder where your lambda function is contained and run:pylambda deploy my_lambda_directory_paths3://mybucket-nmy_lambda_functionmy_lambda_directory_path = The path to the directory that contains your lambda function and requirements.txt file.s3://mybucket = The location of your S3 bucket. This should follow the AWS CLI for S3 locations.my_lambda_function = The name of the zip file.NOTE: you must have a proper requirements.txt within the same folder as your lambda function if you are using external libraries installed with pip. The deploy functionality will automatically bundle in these dependencies before uploading.Arguments:directory : the directory path that contains your lambda.s3_bucket : the location of your S3 bucket. Must follow the AWS CLI format. REQUIRED-n, –name : the name of the zip file that will be uploaded to S3.
Package: pylambdarest
pylambdarestpylambdarest is a lightweight opinionated framework for building REST API usingAWS LambdaandAPI Gateway.MotivationWhy another framework ?When using API Gateway and python Lambda functions, the most common pattern is to have a unique Lambda function triggered by a proxy API Gateway resource. The Lambda then uses a framework likeFlaskto do all the routing. In an API Gateway + Lambda context, I feel likethe routing should be handled by API Gateway itself, then forwarding the request to specific Lambda functions for each resource or endpoint.FeaturesNo routing. Yes, this is a feature. Routing should be handled by API Gateway.API Gateway event parsing (including request body and path parameters).Cleaner syntax.Optional body schema and query parameters validation.InstallationInstall the package from PyPI using pip:$ pip install pylambdarestpylambdarest should also be included in the deployment package of your Lambda functions.Getting startedpylambdarest provides a@routedecorator to parse the API Gateway event into aRequestobject available in the handler function as an argument. It also formats the handler's output to the expected Lambda + API Gateway format seamlessly.Turning this:importjsondefhandler(event,context):body=json.loads(event["body"])query_params=event["queryStringParameters"]path_params=event["pathParameters"]return{"statusCode":200,"body":json.dumps({"message":f"Hello from AWS Lambda{body['name']}!!"})}Into this:frompylambdarestimportroute@route()defhandler(request):body=request.jsonquery_params=request.query_paramspath_params=request.path_paramsreturn200,{"message":f"Hello from AWS Lambda{body['name']}!!"}You can still access the originaleventandcontextarguments from the handler:frompylambdarestimportroute@route()defhandler(request,event,context):print(event)body=request.jsonreturn200,{"message":f"Hello from AWS Lambda{body['name']}!!"}Path parameters defined in API Gateway can also be accessed directly as function argument:frompylambdarestimportroute@route()defget_user(user_id):print(user_id)# get user from dbuser={"id":user_id,"name":"John Doe"}return200,userSchema Validationpylambdarest optionally provides schema validation usingjsonschema:frompylambdarestimportrouteuser_schema={"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":False}@route(body_schema=user_schema)defcreate_user(request):# If the request's body does not# satisfy the user_schema,# a 400 will be returned# Create user herereturn201query_params_schema={"type":"object","properties":{# Only string types are allowed for query parameters.# Types casting should be done in the handler."page":{"type":"string"}},"additionalProperties":False}@route(query_params_schema=query_params_schema)defget_users(request):page=int(request.query_params.get("page",1))# request users in dbusers=[{"userId":i}foriinrange((page-1)*50,page*50)]return200,usersExampleYou can look at thesamplefor a minimal pylambdarest API.In this sample, we use theserverlessframework to declare the API Gateway -> Lambda routingThe packaging of the Lambda functions is done using theserverless-python-requirementsplugin.
Package: py-lambda-simulator
py-lambda-simulatorpy-lambda-simulator is a Python library for running aws-lambda functions locally.InstallationUse the package managerpipto install py-lambda-simulator.pipinstallpy-lambda-simulatorUsageimportasyncioimportjsonfromasyncioimportrunfrompy_lambda_simulator.lambda_simulatorimportAwsSimulatorfrompy_lambda_simulator.sqs_lambda_simulatorimportSqsLambdaSimulator,SqsEvent,LambdaSqsFuncasyncdefexample(simulator,aws_simulator):queue=aws_simulator.create_sqs_queue("queue-name")defsqs_handler(event:SqsEvent,context):print(event["Records"][0]["body"])simulator.add_func(LambdaSqsFunc(name="test-sqs-lambda",queue_name="queue-name",handler_func=sqs_handler))asyncdefsend_msg():whileTrue:aws_simulator.get_sqs_client().send_message(QueueUrl=queue["queue_url"],MessageBody=json.dumps({"test":123}))awaitasyncio.sleep(1)awaitasyncio.gather(simulator.start(),send_msg())if__name__=='__main__':_simulator=SqsLambdaSimulator()_aws_simulator=AwsSimulator()run(example(_simulator,_aws_simulator))For more examples see the tests.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: pylambder
pylambderEasy way to run your python code as asynchronous tasks in AWS LambdaGetting StartedThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.PrerequisitesPython 3.7AWS CLISAM CLIGive examplesInstallingA step by step series of examples that tell you how to get a development env runningSay what the step will beGive the exampleAnd repeatuntil finishedEnd with an example of getting some data out of the system or using it for a little demoRunning the testsmaketestUnit testsUnit tests are created using python's unitttest. They are intest/directory
and should be in files namedtest_*.py. This allows their autodiscovery.LinterInstall withpip install -r dev-requirements.txtorpip install .[dev](this installs wholepylambder).Run:wgslr/pylambder$pylintpylambderThe linter is configured inpylintrc. Filetox.iniis also provided to configurepep8linter, used e.g. by Visual Studio Code.DeploymentAdd additional notes about how to deploy this on a live systemBuilt WithDropwizard- The web framework usedMaven- Dependency ManagementROME- Used to generate RSS FeedsContributingPlease readCONTRIBUTING.mdfor details on our code of conduct, and the process for submitting pull requests to us.VersioningWe useSemVerfor versioning. For the versions available, see thetags on this repository.AuthorsArtur Jopek-ajopekWojciech Geisler-wgslrSee also the list ofcontributorswho participated in this project.LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsAcknowledgmentsHat tip to anyone whose code was usedInspirationetc
Package: pylambdic
pylambdicpylambdic is a Python package that simplifies the process of validating input and output for AWS Lambda handlers using Pydantic. It automatically validates the input and output types of your Lambda function using Pydantic models, making it easier to ensure your function is working with the correct data.FeaturesAutomatic input and output validation using Pydantic models.Simplified error handling for invalid input and output data.Support for AWS Lambda context object.Easy integration with existing AWS Lambda functions.InstallationInstall pylambdic using pip:pipinstallpylambdicUsageTo use pylambdic, simply import thehandlerdecorator and apply it to your AWS Lambda function. You should also define your input and output types using Pydantic models.Here's an example of how to use pylambdic:frompydanticimportBaseModelimportpylambdicclassInputModel(BaseModel):name:strage:intclassOutputModel(BaseModel):message:str@pylambdic.handlerdefmy_lambda_handler(input_data:InputModel)->OutputModel:returnOutputModel(message=f"Hello{input_data.name}, you are{input_data.age}years old.")In this example, themy_lambda_handlerfunction expects an input event withnameandagefields, and returns a response with amessagefield. pylambdic will automatically validate the input and output data against theInputModelandOutputModelPydantic models.If the input data is invalid, the Lambda function will return a 400 status code with a descriptive error message. If the output data is invalid, it will return a 500 status code with a descriptive error message.You can also use the context object provided by AWS as follows:frompydanticimportBaseModelimportpylambdicclassInputModel(BaseModel):name:strage:intclassOutputModel(BaseModel):message:strrequest_id:str@pylambdic.handlerdefmy_lambda_handler(input_data:InputModel,context)->OutputModel:message=f"Hello{input_data.name}, you are{input_data.age}years old."request_id=context.aws_request_idreturnOutputModel(message=message,request_id=request_id)ContributingContributions are welcome! Please feel free to submit issues and pull requests for consideration.
Package: py-lamina
Welcome to LaminaThis library adds a new layer ("lâmina") to AWS lambda functions, integrating synchronous and asynchronous code in a
single function, which use Pydantic models to validate input and output data.Install$pipinstallpy-laminaThis library is compatible with Python 3.9, 3.10 and 3.11.UsageCreate the models for Input and Output data:# schemas.pyfrompydanticimportBaseModelclassExampleInput(BaseModel):name:strage:intclassExampleOutput(BaseModel):message:strCreate your AWS Lambda handler:# main.pyfromtypingimportAny,Dict,Tuple,Unionfromlaminaimportlamina,Requestfrom.schemasimportExampleInput,ExampleOutput@lamina(schema=ExampleInput,schema_out=ExampleOutput)defhandler(request:Request)->Dict[str,Any]:response={"message":f"Hello{request.data.name}, you are{request.data.age}years old!"}returnresponseYou can also use an async handler:# main.pyimportasyncio@lamina(schema=ExampleInput,schema_out=ExampleOutput)asyncdefhandler(request:Request)->Dict[str,Any]:awaitasyncio.sleep(1)response={"message":f"Hello{request.data.name}, you are{request.data.age}years old!"}returnresponseThe Response Status CodeDefault value is 200. You can change it by returning a tuple with the response and the status code:@lamina(schema=ExampleInput,schema_out=ExampleOutput)defhandler(request:Request)->Tuple[Dict[str,Any],int]:response={"message":f"Hello{request.data.name}, you are{request.data.age}years old!"}returnresponse,201The Response Content TypeDefault content type isapplication/json; charset=utf-8. You can change it by defining thecontent_typeparameter:@lamina(schema=ExampleInput,content_type=Lamina.HTML)defhandler(request:Request)->Tuple[str,int]:html_404="""<html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1></body></html>"""returnhtml_404,404The Response HeadersDefault header contains the Content Type defined in decorator or{"Content-Type": "application/json; charset=utf-8"}by default.
You can add more headers it by returning a dict in the function return tuple:@lamina(schema=ExampleInput,content_type=Lamina.HTML)defhandler(request:Request)->str:returnNone,403,{"Location":"https://www.example.com"}This dict will be merged with the default header.The Request objectTheRequestobject has the following attributes:data: The input data, already validated by the schema.event: The original event received by the lambda function.context: The original context received by the lambda function.You can use lamina without one or both schemas, if you like:# main.pyimportjsonfromtypingimportAny,Dictfromlaminaimportlamina,Request@lamina()defhandler(request:Request)->Dict[str,Any]:body=request.event["body"]data=json.loads(body)response={"message":f"Hello{data.name}, you are{data.age}years old!"}returnresponsePlease note, if you do not define a SchemaIn, thedataattribute will contain theoriginalbody from event. You
need to validate it yourself and convert it to a dict, bytes, etc... you need before using the data received.LicenseThis project is licensed under the terms of the MIT license.
Package: pylammpstrj
PyLammpstrjThis module gives several utilities for LAMMPS trajectory files (i.e. files output with thedumpcommand) processing.Usage exampleThe first module method to use ispylammpstrj.readto generate apylammpstrj.PyTrajectoryobject. Astartstep can optionally be given to skip configurations untilstart.This trajectory object holds the informations about: the atoms (as a list of lists ofpylammpstrj.PyAtomobjects), the simulation boxes (as a list ofpylammpstrj.PyBoxobjects), thedump_formatof the file, thefields_namesof the file, theadditional_fields(see details below), the number of atoms in each configurations (N_atoms), the number of configurations (N_configurations).Then, processings can be issued on this trajectory:atoms can be selected with thePyTrajectory.select_atomsmethod, when the selection is provided as three arguments: astrmatching a field name, a comparison operator (one ofpylammpstrj.LESS_THAN,pylammpstrj.LESS_THAN_EQUAL_TO, ...,pylammpstrj.GREATER_THAN), and a value (either afloat,int, orstrdepending on the target field).By default, this method returns a newpylammpstrj.PyTrajectory, but this behavior can be changed with theinplaceboolean argument) in which case the method returnsNone.an atom property can also be averaged over the atoms at each configuration withPyTrajectory.average_property. This method takes only a field name (asstr) to return a list offloatof lengthPyTrajectory.N_configurationsrepresenting the average of the property at each configuration.CopyrightCopyright 2024 Heiarii Lou Chao.
Package: pylamport
PylamportA python library for producing lamport signatures.Lamport signatures can be constructed with any secure one-way function (usually
a hash).Anything in hashlib (for example,hashlib.sha256) is supported.Example usageGenerating keys:keys=pylamport.Lamport().gen()Signing a message:identity=pylamport.Lamport()signature=identity.sign("Hello, world!")Verifiying a signature:identity=pylamport.Lamport()identity.verify(signature)Exporting keys:identity=pylamport.Lamport()keys=identity.export()WarningsThis project was written in less than a few hours, so it may contain mistakes
and/or bugs.
Package: pylana
PyLanaPyLana is Python API forLANA Process Mining. It focuses on resource management, but provides methods that can be used to access the processed data as well.This package is still in initial development state. Anything may change at any time. The public API should not be considered stable.InstallationYou can install PyLana directly from PyPi with e.g.$pipinstallpylanaHow to get startedTo connect with an api at e.g. 'https:://cloud-backend.lanalabs.com', first create an API withfrompylanaimportcreate_apiapi=create_api('https','cloud-backend.lanalabs.com',<APIKey>)You will require an API key that is valid for your LANA deployment. The returned api stores the url for a LANA Process Mining api as well as your authentication. After creation you can us it to manage the LANA process mining resources. Among other things you can upload data from python pandas data frames directly or connect logs and shiny dashboard resources referencing them by their names.To upload a new log called "new-event-log" and shiny-dashboard named "new-shiny-dashboard", and connect them with each other, you can use the following codeupload_response=api.upload_event_log_df('new-event-log',df_event_log,time_format='YYYY-mm-dd',df_case=df_case_attributes)shiny_dashboard=api.create_shiny_dashboard('new-shiny-dashboard')connection_response=api.connect_shiny_dashboard(upload_response.json()['id'],shiny_dashboard['id'])We also provide basic methods for direct http requests to LANA API endpoints, for exampleresponse_list=api.get('/api/v2/dashboards')will return a response with a list of dashboard metadata. For details about the endpoints refer to the swagger documentation of the LANA API.How to contributeSee the details inCONTRIBUTING.md.LicenseApache License 2.0
Package: py-lancer
LancerEver heard of Black? This is the opposite.
A tool to turn your clean python code into a hideous (working) mess.FeaturesTurn all comments into Pitbull lyrics 💃Turn all your variable names into a mixture of animal sounds and horribly similar looking characters like "bark_bark_0OO0O". 🐶Add irritating white spaces.Code still compiles after all theseimprovements! 👷ExampleBefore:# function that adds two numbersdefaddition(a:int,b:int)->int:# find sumresult=a+b# return the sumreturnresultif__name__=='__main__':print("Sum of 1 and 3 is%s"%addition(1,3))After:# there's nothing like Miami's heatdefquack_Il1Ι1l(squeak_squeak_IIΙΙlI:int,honk_honk_honk_aaαaα:int)->int:# Bada bing, bada boomgrowl_growl_growl_ααaaα=squeak_squeak_IIΙΙlI+honk_honk_honk_aaαaα# Hey baby, givin' it your all when you're dancin' on mereturngrowl_growl_growl_ααaaαif__name__=='__main__':print("Sum of 1 and 3 is%s"%quack_Il1Ι1l(1,3))Installation and UsageSimply runpip install py-lancerand then use thelancecommand line tool.usage: lance [-h] [--version] -f ./FILE_PATH.py [-y]

Ever heard of Black? This is the opposite.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -f ./FILE_PATH.py, --file ./FILE_PATH.py
                        Python file to be lance'd.
  -y, --yolo            Overwrite original file, lol.So if you have a python file at./test.py, you simply runlance -f ./test.pyHow does it workThe key tool we use it thetokenizerstandard module in python. It allows us to tokenize any python script which then in turn makes substituting comments and variable names fairly simple.
Check out the source code for more details.ContributeBug reports, fixes and additional features are always welcome! Make sure to run the tests withpython setup.py testand write your own for new features. Thanks.
Package: py-lance-util
[基于FastApi的python项目，封装常用工具（持续集成中......)]步骤构建Dockerfile基础镜像构建python运行基础镜像DockerfileFROMamazonlinux:latestLABELmaintainer=“Lance”RUNyumupdate-y&&yuminstall-ypython3python3-develvim具体服务镜像DockerfileFROMregistry.cn-hangzhou.aliyuncs.com/lance0515/lance-test:base_pythonLABELmaintainer="Lance"COPYrequirements.txt.RUNpip3install-rrequirements.txt# 配置默认放置 App 的目录RUNmkdir-p/appWORKDIR/appEXPOSE28000-28004COPY..ENVPYTHONPATH/appENTRYPOINT["python3","/app/main.py"]推送到阿里云# 登录， 输入密码dockerlogin--username=****registry.cn-hangzhou.aliyuncs.com# 对镜像打标签dockertag[ImageId]registry.cn-hangzhou.aliyuncs.com/****/lance-test:[镜像版本号]# 发布dockerpushregistry.cn-hangzhou.aliyuncs.com/****/lance-test:[镜像版本号]服务器下载# 登录dockerlogin--username=****registry.cn-hangzhou.aliyuncs.com

dockerpullregistry.cn-hangzhou.aliyuncs.com/****/lance-test:[镜像版本号]docker-compose 实例化容器docker-compose.yml通过docker-compose启动容器version: "3"
services:
  py-server:
    image: registry.cn-hangzhou.aliyuncs.com/lance0515/lance-test:${BASE_VERSION}
    container_name: py-server
    ports:
      - 28000:8000
      - 28004:8004
    volumes:
      - ${BASE_PROJECT_PATH}:/app.envBASE_VERSION=v1.0            # 打tag时镜像实际版本号
BASE_PROJECT_PATH=/data/app  # 项目在服务器实际地址## 自动拉取代码并重启服务通过脚本自动拉取代码auto_pull.sh#! /bin/bashecho"--------------------------------"echo"----------开始执行脚本----------"date
pwd;echo"切换到git目录"##切换到放置git代码的目录绝对路径cd/home/lance/python/python-server;path=`pwd`echo$pathif["$path"=="/home/lance/python/python-server"]thenecho"目录切换成功，准备拉取最新代码"elseecho"目录切换失败，退出程序"exit0;figitpull;echo"准备重启容器"# npm run build;sleep30dockerrestartpy-serverecho"成功"结合github push自动拉取代码通过github设置webhook，回调执行auto_pull.sh脚本