Saravanan666/pypi-org huggingface dataset:
Package: dumbo-marek
Dumbo: Python Web Framework built for learning purposesDumbo is a Python web framework built for learning purposes.It's a WSGI framework and can be used with any WSGI application server such as Gunicorn.Installationpipinstalldumbo_marekHow to use itBasic usage:frombumbo.apiimportAPIapp=API()@app.route("/home")defhome(request,response):response.text="Hello from the HOME page"@app.route("/hello/{name}")defgreeting(request,response,name):response.text=f"Hello,{name}"@app.route("/book")classBooksResource:defget(self,req,resp):resp.text="Books Page"defpost(self,req,resp):resp.text="Endpoint to create a book"@app.route("/template")deftemplate_handler(req,resp):resp.body=app.template("index.html",context={"name":"Bumbo","title":"Best Framework"}).encode()Unit TestsThe recommended way of writing unit tests is withpytest. There are two built in fixtures
that you may want to use when writing unit tests with Bumbo. The first one isappwhich is an instance of the mainAPIclass:deftest_route_overlap_throws_exception(app):@app.route("/")defhome(req,resp):resp.text="Welcome Home."withpytest.raises(AssertionError):@app.route("/")defhome2(req,resp):resp.text="Welcome Home2."The other one isclientthat you can use to send HTTP requests to your handlers. It is based on the famousrequestsand it should feel very familiar:deftest_parameterized_route(app,client):@app.route("/{name}")defhello(req,resp,name):resp.text=f"hey{name}"assertclient.get("http://testserver/matthew").text=="hey matthew"TemplatesThe default folder for templates istemplates. You can change it when initializing the mainAPI()class:app=API(templates_dir="templates_dir_name")Then you can use HTML files in that folder like so in a handler:@app.route("/show/template")defhandler_with_template(req,resp):resp.html=app.template("example.html",context={"title":"Awesome Framework","body":"welcome to the future!"})Static FilesJust like templates, the default folder for static files isstaticand you can override it:app=API(static_dir="static_dir_name")Then you can use the files inside this folder in HTML files:<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"/><title>{{title}}</title><linkhref="/static/main.css"rel="stylesheet"type="text/css"/></head><body><h1>{{body}}</h1><p>This is a paragraph</p></body></html>MiddlewareYou can create custom middleware classes by inheriting from thebumbo.middleware.Middlewareclass and overriding its two methods that are called before and after each request:frombumbo.apiimportAPIfrombumbo.middlewareimportMiddlewareapp=API()classSimpleCustomMiddleware(Middleware):defprocess_request(self,req):print("Before dispatch",req.url)defprocess_response(self,req,res):print("After dispatch",req.url)app.add_middleware(SimpleCustomMiddleware)
Package: dumbo-scopus
Dumbo ScopusSimple CLI to search on Scopus and obtain the results in a XLSX file.PrerequisitesPython 3.10An API key fromElsevierChromeDriver(download and install the most appropriate version for your OS)InstallInstall usingpip:$pipinstalldumbo-scopusUsageGet help directly from the command:$python-mdumbo_scopus--help
$python-mdumbo_scopussearch--help
$python-mdumbo_scopuscitations--helpUse the following command line to perform a Scopus Search and obtain the result as a CSV file:$python-mdumbo_scopussearch"TITLE(magic sets)"--api-key=YOUR-API-KEYCheckthis web pagefor the format of the query.To download the citations of an article, given its Scopus ID as for example2-s2.0-84949895809, use the following command line:$python-mdumbo_scopuscitations2-s2.0-84949895809
Package: dumbpw
To create and remember passwords for online services, the best practice for
most folks online is to use a password management tool such asBitwardento generate long, cryptographically random
passwords. Then, a very strong passphrase is used to lock the password manager.Unfortunately, in a misguided attempt to encourage users to choose better
passwords, many websites and apps enforcerestrictive password policies.
These policies inhibit users from using cryptographically random
password generators: a long, high-entropy password is more likely to
violate such rules, which means a security-savvy user may have to attempt
several “random” passwords before one is accepted. This punishes users
who are trying to follow best practices.Enter dumbpw. dumbpw allows you to configure a set of rules, and then it will
generate a cryptographically secure password that conforms to those dumb rules.If all you need is a password generator,you should not use this.Installationpip3 install dumbpwUsage$dumbpw--helpUsage: dumbpw [OPTIONS] LENGTH

Options:
--version                       Show the version and exit.
--min-uppercase INTEGER         The minimum number of uppercase characters.
--min-lowercase INTEGER         The minimum number of lowercase characters.
--min-digits INTEGER            The minimum number of digit characters.
--min-specials INTEGER          The minimum number of special characters.
--blocklist TEXT                Characters that may not be in the password.
                                [default: '";]
--allow-repeating / --reject-repeating
                                Allow or reject repeating characters in the
                                password.  [default: reject-repeating]
--specials TEXT                 Non-alphanumeric characters that may be in
                                the password. Pass '-' to read from standard
                                input.
--help                          Show this message and exit.Known issuesdumbpw usessecretsto generate passwords. If the generated string doesn’t meet the given
requirements, dumbpw discards it and generates another, until one passes.
Therefore, if you ask dumbpw to generate a long password with high minimums,
it will run for a very long time before terminating.Likewise, if your minimums require characters that are banned in the
blocklist option, dumbpw will run forever.The author is neither a cryptographer, nor a security expert. There has
been no formal, independent, external security review of this software. As
explained in the LICENSE, the author assumes no responsibility or liability
for your use of this software.Related toolsApple’sPassword Rules Validation ToolDevelopmentTo install development dependencies, you will needpoetryandpre-commit.pre-commit install --install-hooks
poetry install && poetry shelldirenvis optional, but recommended for convenience.
Package: dumbtext
python-conda-package-templateTemplate for building Python packages that can be easily bundled as Anaconda packages, tooUsageTo use this package, when creating the new repository for your project, select this project as the template.
Then, replace all occurrences of "PACKAGENAME", "URL", "GIT_URL", and other filler values insetup.pyandmeta.yaml.
Set version numbers as needed inPACKAGENAME/__init__.pyandmeta.yaml, and add your code where applicable.Building your packagePyPIpythonsetup.pyinstallAnacondacondabuild--python{PYTHON_VERSION}meta.yamlUploading your packagePyPI# ensure `twine` is installpipinstalltwine# package source codepythonsetup.pysdist
twineuploaddist/*Anaconda# ensure conda-build and anaconda-client are installedcondainstallconda-buildanaconda-client# build package for a specific python versioncondabuild--python{PYTHON_VERSION}meta.yaml# upload to Anaconda Cloudcd$HOME/miniconda3/conda-bld/
anacondaupload*/PACKAGENAME-VERSION_*.tar.bz2Installing your packageAfter uploading to your repository of interest, you should be able to download and install your package according to the tools for that repository.PyPIpipinstallPACKAGENAMEAnacondacondainstallPACKAGENAME
Package: dumbtils
DumbtilsDumb Utilities.InstallationWith makefile:Install python3 (3.6+) and pip3 in your OS.Copy theMakefilein the repo.Runmakeon the folder with theMakefileor pass theMakefileexplicitely.With pip:Install python3 (3.6+) and pip3 in your OS.Runpip3 install dumbtils -U.Note: If new commands are not found after installing, try reloading shell or virtual environment.Commandsprocmax: Return max process per user.timeprog <prog> [arg1, arg2, ...]: Measure execution time in seconds of a command or program.ucp <bufsize> <src_path> <dst_path>: Copy a file with a custom buffer size.tictoc: Simulates a comunication between two subprocesses of C1 and C2.bingonacci [-t]: Sum a millions fibonacci numbers of the range [0, 19],-tflag to use threading mode.
Package: dumdum
Create fake HTTP servers with simple stanzas.This module allows you to easily create “dummy” servers from simple descriptive
text. Need a dummy server for testing, or maybe the service you’re trying to
test doesn’t have a “stage” environment? That’s what this is for.InstallationYou can install the extension withpiplikepip install dumdumUsagedumdumis both a command-line utility and a library. It takes a simple
_stanza_ format and generates a web server with endpoints from that. E.g. to do
“hello world” you could doprintf "
> GET
> /hello
< body world
.
" | dumdumThen you can test with% curl http://localhost:8001/hello

> GET /hello HTTP/1.1
> Host: localhost:8001
> User-Agent: curl/7.51.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Date: Wed, 17 May 2017 18:43:39 GMT
< Server: WSGIServer/0.1 Python/2.7.13
< Content-type: text/plain
< Content-Length: 7

worldThis will create a server listening on the default port (8001).Dumdumis a
WSGI compliant library, so you can easily serve it from your own code likefrom wsgiref.simple_server import make_server
from dumdum import Dumdum

dum = Dumdum("""
> GET
> /hello
< body world
.
""")
srv = make_server('', 5000, dum.server)
srv.serve_forever()Source and further details can be found athttps://github.com/jar-o/dumdum
Package: dummipy
Quickstart$pipinstalldummipyLet it out of the box…from sklearn.linear_model import LinearRegression
from dummipy import cereal

type(cereal)
# CategoricalDataFrame

cereal.head()
reg = LinearRegression()
reg.fit(cereal[['mfr', 'vitamins', 'fat']], cereal.calories)InstallationYou’ll need`pandas<http://pandas.pydata.org/>`__, but any old
version will do the trick. There is nopandasversion pegged in thesetup.pyfile so installingdummipywon’t mess up your existing
sci-py setup.$pipinstalldummipyUseJust use it like any old data frame. That’s really all there is to it.import dummipy as dp

df = dp.CategoricalDataFrame({
    "x": range(5),
    "y": ["a", "b", "c", "a", "b"]
})


df = pd.read_csv("foo.csv")
df = dp.CategoricalDataFrame(df)
Package: dummy-0532
Python SDK for UP42, the geospatial marketplace and developer platform.Documentation•UP42.com•SupportHighlightsPython package for easy access toUP42'sgeospatial datasets&processing workflowsUse UP42 functionality together with your preferred Python libraries!For geospatialanalysis&product builders!Interactive maps &visualizations, ideal with Jupyter notebooksInstallation & DocumentationSee thedocumentationforgetting started guides,examplesand thecode reference.The package requires Python > 3.6.pipinstallup42-py30-second ExampleThe UP42 Python package uses nine classes, representing thehierarchical structureof UP42:Project > Workflow > Job > JobTask|JobCollection|Catalog > Order|Storage > Asset.In this example anew workflowconsisting ofSentinel-2 dataandSharpening Filteris created.
The area of interest and workflow parameters are defined. Afterrunning the job,
the results aredownloadedand visualized.Try this example without installation!importup42up42.authenticate(project_id="12345",project_api_key="67890")project=up42.initialize_project()# Construct workflowworkflow=project.create_workflow(name="30-seconds-workflow",use_existing=True)#print(up42.get_blocks(basic=True))input_tasks=["Sentinel-2 L2A Visual (GeoTIFF)","Sharpening Filter"]workflow.add_workflow_tasks(input_tasks)# Define the aoi and input parameters of the workflow to run it.aoi=up42.get_example_aoi(as_dataframe=True)# Or use up42.draw_aoi(), up42.read_vector_file(), FeatureCollection, GeoDataFrame etc.input_parameters=workflow.construct_parameters(geometry=aoi,geometry_operation="bbox",start_date="2018-01-01",end_date="2020-12-31",limit=1)input_parameters["esa-s2-l2a-gtiff-visual:1"].update({"max_cloud_cover":5})# Price estimationworkflow.estimate_job(input_parameters)# Run a test job to query data availability and check the configuration.test_job=workflow.test_job(input_parameters,track_status=True)# Run the actual job.job=workflow.run_job(input_parameters,track_status=True)job.download_results()job.plot_results(figsize=(6,6))SupportFor any kind of issues or suggestions please see thedocumentation, open agithub issueor contact us via Emailsupport@up42.com
Package: dummy-app
dummy_appPlanningCreate model train + score api -- doneWrite training/test data to db -- doneupdate model train to read database -- doneto do:  need to figure how to pass large datasets through api - jsonify?create dash app that can visualise -- donetrain/test data scatter plot with linear model predictionsreturn predictionsto do: update to make prettier and include time stamps etc.....stand up ci/cd practices - doneset up git hooks - donelinting pre-hooks?pytest unit tests?github actions - doneStepsbuild simple testsrun on github actions on pushcreate docker file that can run and query data -- donedocker to create and publish dockerfilePackage pipeline - doneTest building + importing package -- donePublish package -- doneConvert env to poetry - doneHost App + serve dataset on cloud platformGet app to deploy to hosted servicehow to connect api to app -- doneUpdate Docker Appuse GunicornRun API + App in same env -- donehttps://docs.docker.com/config/containers/multi-service_container/Get deployment to use packageConnect deployments to github actionsUseful code# Poetry
poetry update
poetry install
poetry build
poetry config pypi-token.pypi  <token>
poetry publish -- build

# Run app
python  dummy_app/model_api_v2.py & 
sleep 5 
python dummy_app/app.py

# Docker commands
docker ps
docker run -d -it flask-api-image bash
docker exec -it ubuntu bash
docker exec -it flask-api-image bash
docker exec -it <container id or name> bash

# Other 
docker-compose down  # Stop container on current dir if there is a docker-compose.yml
docker rm -fv $(docker ps -aq)  # Remove all containers
sudo lsof -i -P -n | grep 8000 # List who's using the port
sudo lsof -i -P -n | grep python 

# Kill jobs
sudo lsof -i -P -n | grep python 
sudo lsof -i -P -n | grep python | awk '{print $2}'
sudo lsof -i -P -n | grep python | awk '{print $2}' | xargs sudo kill -9
Package: dummycache
INSTALLATION>>> pip install dummycacheUSAGE>>> from dummycache import Cache
>>> c = Cache()The basic interface isset(key, value, timeout=None)andget(key, default=None):>>> c.set('key_a', 'Good morning, today!', 60)    # Set value in cache for 60 seconds
>>> c.get('key_a')
'Good morning, today!'Wait 60 seconds:>>> c.get('key_a')
NoneIftimeoutis not provided, the value is saved forever or until it is overridden or explicitly deleted:>>> c.set('key_b', 'Good afternoon, forever!')    # Set value in cache foreverIftimeoutis zero or negative, the value is not saved. The value previously saved with the same key will also be
deleted:>>> c.set('key_b', 'Good bye', 0)    # The value is not set
>>> c.get('key_b')
Nonecache.get()can take a default argument. This specifies which value to return if the object doesn’t exist in the
cache:>>> c.get('key_a', 'has expired')
'has expired'To add a key only if it doesn’t already exist, use theadd()method. It takes the same parameters asset(), but
it will not attempt to update the cache if the key specified is already present:>>> c.set('key_c', 'Initial value')
>>> c.add('key_c', 'New value')
>>> c.get('key_c')
'Initial value'If you need to know whetheradd()stored a value in the cache, you can check the return value. It will returnTrueif the value was stored,Falseotherwise.You can delete keys explicitly withdelete(). This is an easy way of clearing the cache for a particular object:>>> c.delete('key_c')Finally, if you want to delete all the keys in the cache, useclear(). Be careful with this;clear()will removeeverything from the cache, not just the keys set by your application.>>> c.clear()
Package: dummyclicli
dummy cliDocumentation:https://dummyclicli.readthedocs.org/en/latestDevelopment WorkflowThe workflow supports the following stepslinttestbuilddocumentuploadgraphThese actions are supported out of the box by the corresponding scripts under _CI/scripts directory with sane defaults based on best practices.
Sourcing setup_aliases.ps1 for windows powershell or setup_aliases.sh in bash on Mac or Linux will provide with handy aliases for the shell of all those commands prepended with an underscore.The bootstrap script creates a .venv directory inside the project directory hosting the virtual environment. It uses pipenv for that.
It is called by all other scripts before they do anything. So one could simple start by calling _lint and that would set up everything before it tried to actually lint the projectOnce the code is ready to be delivered the _tag script should be called accepting one of three arguments, patch, minor, major following the semantic versioning scheme.
So for the initial delivery one would call$ _tag –minorwhich would bump the version of the project to 0.1.0 tag it in git and do a push and also ask for the change and automagically update HISTORY.rst with the version and the change provided.So the full workflow after git is initialized is:repeat as necessary (of course it could be test - code - lint :) )codelinttestcommit and pushdevelop more through the code-lint-test cycletag (with the appropriate argument)buildupload (if you want to host your package in pypi)document (of course this could be run at any point)Important InformationThis template is based on pipenv. In order to be compatible with requirements.txt so the actual created package can be used by any part of the existing python ecosystem some hacks were needed.
So when building a package out of thisdo notsimple call$ python setup.py sdist bdist_eggas this will produce an unusable artifact with files missing.Instead use the provided build and upload scripts that create all the necessary files in the artifact.Project FeaturesTODOHistory0.0.1 (27-10-2021)First code creation0.1.0 (27-10-2021)blabla
Package: dummy-clicli
dummy cliDocumentation:https://dummy-clicli.readthedocs.org/en/latestDevelopment WorkflowThe workflow supports the following stepslinttestbuilddocumentuploadgraphThese actions are supported out of the box by the corresponding scripts under _CI/scripts directory with sane defaults based on best practices.
Sourcing setup_aliases.ps1 for windows powershell or setup_aliases.sh in bash on Mac or Linux will provide with handy aliases for the shell of all those commands prepended with an underscore.The bootstrap script creates a .venv directory inside the project directory hosting the virtual environment. It uses pipenv for that.
It is called by all other scripts before they do anything. So one could simple start by calling _lint and that would set up everything before it tried to actually lint the projectOnce the code is ready to be delivered the _tag script should be called accepting one of three arguments, patch, minor, major following the semantic versioning scheme.
So for the initial delivery one would call$ _tag –minorwhich would bump the version of the project to 0.1.0 tag it in git and do a push and also ask for the change and automagically update HISTORY.rst with the version and the change provided.So the full workflow after git is initialized is:repeat as necessary (of course it could be test - code - lint :) )codelinttestcommit and pushdevelop more through the code-lint-test cycletag (with the appropriate argument)buildupload (if you want to host your package in pypi)document (of course this could be run at any point)Important InformationThis template is based on pipenv. In order to be compatible with requirements.txt so the actual created package can be used by any part of the existing python ecosystem some hacks were needed.
So when building a package out of thisdo notsimple call$ python setup.py sdist bdist_eggas this will produce an unusable artifact with files missing.Instead use the provided build and upload scripts that create all the necessary files in the artifact.Project FeaturesTODOHistory0.0.1 (27-10-2021)First code creation
Package: dummy-env-prep
It can be hard to manage shell-script style python in a build or automated environment.  Wrap up requirements easily in onepip installand place it at the front of a Bamboo, Jenkins, or Ansible script.This is meant as a demo.  Please fork for your own needs.Getting StartedFork this projectpip install cookiecuttercookiecutter cookiecutter_template/Answer the questionsFill outrequirements.txtandREADME.rstappropriatelypython setup.py sdist bdist_wheel clean--alluploadpip install [my project]where needed <3Includesplumbum==1.6.3
requests
cookiecutter
Package: dummyfilescreator
Dummy Files CreatorApplication to generate dummy files with random content and different checksums.File units are corresponding powers of 210(KiB, MiB, GiB).For a bash-based (more performant) solution, seethis project.UsageBoth GUI and CLI modes are available. Note that CLI mode is recommended for creating large datasets.GUI modeTo use the GUI mode, startdummyfilescreatorwithout arguments. This mode isnotrecommended for creating large datasets.CLI modeRecommended for creating large datasets. The parameters for CLI mode are listed below.KeyDescription--output / -oLocation where files will be created--n-files / -nNumber of files to be created--size / -fsSize of files to be created--unit / -fuSize unit (KiB, MiB, GiB)--chunk-size / -csChunk size--chunk-unit / -cuChunk size unit (KiB, MiB, GiB)--log / -lSaves log file.Affects performance--hash / -haIncludes md5 hash in log file.Affects performance--progressbar / -pShows progress bar.Affects performance--verbose / -vShows per-file progress bar.Affects performanceExample:Create 5 files of 80 MiB each, show the individual file creation progress, and save the log file with md5 hash to /tmp.$dummyfilescreator-o=/tmp-n=5-fs=80-fu=MiB-cs=1-cu=MiB-l=/tmp-ha-v5file(s)createdin/tmp
Logfilesavedto/tmp

$ls/tmp|grepdummy
71bfdea7-f701-40da-97c0-ff0331edd004.dummy
b2c97bc9-159d-41a7-ae8f-55c4d1d2c9ce.dummy
b853d34a-e38d-4f97-8648-9db937ce9a61.dummy
dummy-files-creator.csv
e7149851-0e3a-400f-a929-8ab84b0a0a25.dummy
e9658f26-eb5d-4547-b456-ca2020459f2f.dummy

$tail-n1/tmp/dummy-files-creator.csv"2022-06-12 22:59:52.213830","80MiB","/tmp/71bfdea7-f701-40da-97c0-ff0331edd004.dummy","442cc4ebbe37cad4025b4bb2049db497"
Package: dummy-kinematics
dummy_kinematicsDescriptionThis is a pkg for dummy-kinematics analysisTable of ContentsInstallationLicenseInstallationpip install dummy-kinematicsExample usagefrom dummy_kinematics.ppt_factory import H3_05_PPT_Factory,THOR_PPT_Factory#forsimplifiedexample,AssumptionMPDBisDR11Thor,13and14isH3_05#datasourceisthecsvorxlsxfilepathpt = r"E:\workat\official CNCAP\odata\MPDB\pt_mpdb.csv"fvc = r"E:\workat\official CNCAP\odata\MPDB\corrected_fvc_mpdb.xlsx"factory = (THOR_PPT_Factory().add_a_data_coverter(name="PT",path=pt,speed_kph=50.80,x_code="17CPILLELO02ACXD", # setting body wave isocodey_code="17CPILLELO02ACYD",z_code="17CPILLELO02ACZD").add_a_data_coverter(name="FVC", path=fvc,speed_kph=49.9,x_code="14SILBBCPIL0ACXD",y_code="14SILBBCPIL0ACYD",z_code="14SILBBCPIL0ACZD").body_performance_report().set_current_dummy("11", "THOR").create_full_prs("DR dummy report"))factory = (H3_05_PPT_Factory().from_other_factory(factory).set_current_dummy("13","H3_05").create_full_prs("PS dummy report").set_current_dummy("14","H3_05").create_full_prs("RL dummy report"))factory.save_ppt_report("MPDB_20221228.pptx")Licensedummy-kinematicsis distributed under the terms of theMITlicense.