Saravanan666/pypi-org huggingface dataset:
Package: dreamutils
dreamutilsA collection of useful and often repeated python methodsThe package contains code / method that were written over and over again,
without creating a centralized package for them. It project was created to solve this problem.
Surely, some of the methods are exotic(most of thedreamutils.pythonfile i think),
but if you need those methods you know where to find them.Installation💻•Examples💡•Licence📝InstallationUsePython >= 3.6Install itviapippipinstalldreamutilsor withgitgitclonehttps://github.com/ByteDream/dreamutils.gitcddreamutils
pythonsetup.pyinstallExamplesHere are examples of some useful packagesXMLA easy to use and powerful xml manipulation classimportdreamutils.types.xmlasxmlmy_xml=xml.new_xml()sub_elem_id=my_xml.add(0,'sub_elem','example_text')# every new created element has an idmy_xml.get_element(sub_elem_id).attrib={'attrib':'example'}# with the id you can obtain the element later...my_xml.add(sub_elem_id,'sub_sub_elem')# ... and use it to add new sub element# Note: the root element has always the id `0`print(my_xml.get_string())SortingA collection of sorting algorithms (the most common I think)fromdreamutils.sortimportQuickSortsorted=QuickSort.integer([2,9,4,623,5])print(sorted)NetA file with nice internet methodsfromdreamutils.netimportget_ip_infosinfos=get_ip_infos('8.8.8.8')# if no argument is passed, information about your own ip will be returnedprint(infos)TestingThe tools are (currently) only tested on linux, but they should also work on Windows and MacOS.So if there are any problems feel free to open a newissue.LicenceThis project is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0) - see theLICENSEfile for more details.
Package: drebedengi-python-api
Drebedengi Python APIA rather thin python wrapper for Drebedengi SOAP API.Documentation:https://mishamsk.github.io/drebedengi-python-apiGitHub:https://github.com/mishamsk/drebedengi-python-apiPyPI:https://pypi.org/project/drebedengi-python-api/Free software: GPL-3.0-onlyFeaturesAlmost full coverage of "get" methods with better English naming for params & types (see [drebedengi.api][])!!! important
Retrieving aggregated reports viaget_transactionsis not currently supported, despite full list of API parametersTyped data model (see [drebedengi.model][])CreditsThanks to:drebedengifor a great finance management servicezeepfor a convenient Python SOAP clientlxmlfor XML libraryattrsfor model classesThis package was created withCookiecutterand themishamsk/cookiecutter-pypackageproject template.
Package: dredd_hooks
AboutThis package contains a bridge betweenDredd API Testing Frameworkand Python environment to ease implementation of testing hooks
provided byDredd. WriteDreddhooks in Python to glue togetherAPI
Blueprintwith your Python projectUsage example:importdredd_hooksashooks@hooks.before_alldeffoo(transactions):fortintransactions:t['request']['headers']['content-type']='application/json'DownloadYou can see all theavailable versionsatPyPI.From source (tar.gz or checkout)Unpack the archive, enter thedredd-hooks-pythondirectory and run:python setup.py installSetuptools/PyPIAlternatively it can be installed fromPyPI, either manually
downloading the files and installing as described above or using:pip install dredd_hooksUsageCreate a hook file inhooks.py:importdredd_hooksashooks@hooks.before("Machines > Machines collection > Get Machines")defbefore_hook(transaction):transaction['skip']="true"Run it with Dredd:$ dredd apiary.apib localhost:3000 --language python --hookfiles ./hooks.pyAPIModuledredd_hooksdefines following decoratorsbefore,after,before_all,after_all,before_each,after_each,before_validation,before_each_validation.before,before_validationandafterhooks are identified bytransaction
name.You can combine those decorators together. So one function can be used
for different hooks but be aware that some hooks have a list of all
transactions as an argument and not a single transaction.importdredd_hooksashooks@hooks.after_all@hooks.before_all@hooks.before_each@hooks.after_each@hooks.before_validation('Machines > Machines collection > Get Machines')@hooks.before("Machines > Machines collection > Get Machines")@hooks.after("Machines > Machines collection > Get Machines")defmulti_hook_function(trans):ifisinstance(trans,list):print('called with list of transactions')else:iftrans['name']=='Machines > Machines collection > Get Machines':trans['skip']='true'Usage is very similar tosync JS hooks APIContributingFork itCreate your feature branch (git checkout-bmy-newfeature)Commit your changes (git commit-am'Add some feature')Push (git push originmy-new-feature)Create a new Pull RequestTestingDon’t forget about tests, seetestdirectory. The project usesunittestpackage andtox.For integration test withDreddinterface the project uses ruby basedarubaso to get it running make
sure you have Ruby installed and then do:$ bundle installAfter the setup you can run the test easily with:$ bundle exec cucumberMore details about the integration test can be found in thedredd-hooks-template repocopyright:Copyright (c) 2015 Apiary Czech Republic, s.r.o.license:MIT, see LICENSE for details.
Package: dreem
[![Build docs](https://github.com/rouskinlab/dreem/actions/workflows/documentation.yml/badge.svg)](https://github.com/rouskinlab/dreem/actions/workflows/documentation.yml)
[![Run tests](https://github.com/rouskinlab/dreem/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/rouskinlab/dreem/actions/workflows/tests.yaml)# DREEMProf. Silvi Rouskin’s [DREEM algorithm](https://www.nature.com/articles/s41586-020-2253-5).## InstallationInstallation instructions [here](https://rouskinlab.github.io/dreem/dreem/installation.html).## DocumentationThe documentation is available on [Github Pages](https://rouskinlab.github.io/dreem).## ContributorsYves Martin, Scott Grote, Matthew Allan, Albéric de Lajarte.## For developersBefore pushing to main, ensure that the code passes the tests:` pytest test/test_pipeline.py `and that the docs compile:` cd docs make html `
Package: dref
drefPackages that usedrefDeveloper GuideSetup# create conda environment$mambaenvcreate-fenv.yml# update conda environment$mambaenvupdate-ndref--fileenv.ymlInstallpipinstall-e.# install from pypipipinstalldrefnbdev# activate conda environment$condaactivatedref# make sure the dref package is installed in development mode$pipinstall-e.# make changes under nbs/ directory# ...# compile to have changes apply to the dref package$nbdev_preparePublishing# publish to pypi$nbdev_pypi# publish to conda$nbdev_conda--build_args'-c conda-forge'$nbdev_conda--mambabuild--build_args'-c conda-forge -c dsm-72'UsageInstallationInstall latest from the GitHubrepository:$pipinstallgit+https://github.com/dsm-72/dref.gitor fromconda$condainstall-cdsm-72drefor frompypi$pipinstalldrefDocumentationDocumentation can be found hosted on GitHubrepositorypages. Additionally you can find
package manager specific guidelines oncondaandpypirespectively.A = AliasC = ClassVarQ = OptionalE = (Over)-EngineeredZ = CustomR = RichP = PlotD = DataB = BioM = Machine Learning
Package: dreg-client
A Python REST client for Docker Registries. Pronounceddee-redgeclient.It’s useful for automating image tagging and untaggingUsageMost people will primarily use theRegistryclass:fromdreg_clientimportRegistryregistry=Registry.build_with_manual_client("https://registry.example.com/v2/")namespaces=registry.namespaces()# a sequence of stringsrepositories=registry.repositories()# a mapping of repository names to Repository objectsns_repositories=registry.repositories("testns")# a mapping of repository names to Repository objects,# but only for those repositories in the "testns" namespacetest_repo=registry.repository("testrepo","testns")# a Repository objecttest_repo=registry.repository("testns/testrepo")# an identical repository objectTheRepositoryclass has several methods for interacting with individual repositories:fromdreg_clientimportRepository,Manifestassertisinstance(test_repo,Repository)asserttest_repo.name=="testns/testrepo"tags=test_repo.tags()# a sequence of stringsmanifest=test_repo.get_manifest(tags[0])# a Manifest objectassertisinstance(manifest,Manifest)test_repo.delete_manifest(manifest.digest)# manifests can only be deleted by digest, not by tag# At the moment, retrieving and deleting blobs returns a requests Response object directlyget_blob_response=test_repo.get_blob("sha256:ce17d456b9373523c40fe294e8918a10059f63c54edd2c8ead1f3079f7fbb22a")delete_blob_response=test_repo.delete_blob("sha256:ce17d456b9373523c40fe294e8918a10059f63c54edd2c8ead1f3079f7fbb22a")However, you’re probably going to want to use the high-levelget_image()method, which returns anImageobject:fromdreg_clientimportImage,Platformtest_image=test_repo.get_image(tags[0])assertisinstance(test_image,Image)asserttest_image.repo=="testns/testrepo"asserttest_image.tag==tags[0]asserttest_image.platforms=={Platform.from_name("linux/amd64"),Platform.from_name("linux/arm64"),Platform.from_name("linux/arm/v7"),}platform_image=test_image.get_platform_image(Platform.from_name("linux/amd64"))Historydreg-client is a fork of a project nameddocker-registry-client.
While it looked good, development has stalled, with approved PRs remaining unmerged. The code design was also hostile
to strict type checking. I forked it to make some improvements, add type hints, and to resolve several outstanding
problems at the time.This fork is not a drop-in replacement fordocker-registry-client. Major changes from upstream include:Complete removal of python2 supportComplete removal of support for v1 registriesA re-work of class namesA re-work of the requests integration and registry auth serviceMore higher-level abstractions, to avoid needing to dive into manifest dictionariesAlternativespython-dxf
Package: dreifus
dreifusOpenCV, OpenGL, Pytorch3D, ... you never know which camera coordinate convention you are currently using?You always have to tryinvert()on your "pose" matrices because you never know whether they are cam2world or
world2cam?The dreifus library is what you need!dreifus (German for tripod) assists you in dealing with 3D cameras in Python.1. Installationpipinstalldreifus2. Usage2.1. Extrinsic (Pose) matricesTranslating between coordinate conventions made easy:fromdreifus.matriximportPose,CameraCoordinateConvention,PoseType# wrap some 4x4 extrinsic matrix# Default assumed coordinate convention: OPEN_CV# Default assumed pose type: WORLD_2_CAMpose=Pose(some_extrinsic_matrix,pose_type=...,camera_coordinate_convention=...)# Translate between coordinate conventionspose.change_camera_coordinate_convention(CameraCoordinateConvention.OPEN_GL)# Ensure your pose transforms into the direction you expectpose.change_pose_type(PoseType.CAM_2_WORLD)2.2. Intrinsicsfromdreifus.matriximportIntrinsicsintrinsics=Intrinsics(fx,fy,cx,cy)# Adapt your intrinsics to images downscaled by a factor of 2xintrinsics.rescale(0.5)# Adapt your intrinsics to an image cropped at (50, 50) left-topintrinsics.crop(50,50)3. VisualizationThe visualization tools will automatically interpret your camera poses correctly, as long as you specifiedcamera_coordinate_conventionandpose_typecorrectly.importpyvistaaspvfromdreifus.pyvistaimportadd_coordinate_axes,add_camera_frustumpose=Pose(...)# Some extrinsicsintrinsics=Intrinsics(...)# Some intrinsicsimage=...# Some images taken from that viewp=pv.Plotter()add_coordinate_axes(p)add_camera_frustum(p,pose,intrinsics,image=image)p.show()Render a pyvista scene from a specific camera:importpyvistaaspvfromdreifus.pyvistaimportrender_from_camerap=pv.Plotter(window_size=[IMG_W,IMG_H],off_screen=True)p.background_color=(0,0,0,0)image=render_from_camera(p,pose,intrinsics)
Package: drekar-launch-process
Drekar Launch ProcessThis library contains client utility functions for processes launched usingdrekar-launch, although they may also be used withoutdrekar-launch. Currently this package provides a reliable way for processes to receive shutdown signals from a process manager or the user usingctrl-c.Seedrekar-launch:https://github.com/johnwason/drekar-launchInstallationpython -m pip install --user drekar-launch-processOn Ubuntu, it may be necessary to replacepythonwithpython3.UsageThe module contains three functions:drekar_launch_process.wait_exit()- Block and wait for exitdrekar_launch_process.wait_exit_callback(callback)- Return immediately and callcallback()when shutdown signal receiveddrekar_launch_process.wait_exit_stop_loop(loop)- Call to stop anasyncioloop when shutdown signal receivedExampleA simple example of running a Python http server in a background thread, using the blockingwait_exit().importdrekar_launch_processimportthreadingfromhttpimportserverashttp_serverserver=http_server.ThreadingHTTPServer(('',8085),http_server.SimpleHTTPRequestHandler)defrun_server():server.serve_forever()th=threading.Thread(target=run_server)th.daemon=Trueth.start()drekar_launch_process.wait_exit()This example uses the callback version to quit the http server:importdrekar_launch_processimportthreadingfromhttpimportserverashttp_serverserver=http_server.ThreadingHTTPServer(('',8085),http_server.SimpleHTTPRequestHandler)defshutdown_server():server.shutdown()drekar_launch_process.wait_exit_callback(shutdown_server)server.serve_forever()Shutdown Signal ExplanationReliably sending a shutdown/quit command to a process in a cross-platform manner is surprisingly difficult. On POSIX based systems like Linux and Mac OS X, signals such asSIGINTorSIGTERMare typically sent. (Ctrl-C sendsSIGINT). These signals can be caught by the process, and used to gracefully shut down.SIGKILLis used to immediately terminate the process.On Windows, it is significantly more difficult. Windows typically uses "Window Message Queues" to communicate with processes. Even processes like services that do not have a visible window often have a hidden window so messages can be received from the operating system. There is some functionality for sending console signals, but these are not reliable for all cases. Windows also has the concept ofJob Objectsthat can be used to group different processes together. The combination of job objects and windows messages provide a reliable way to send and receive graceful shutdown signals.Thewait_for_exit*commands either way for Signals on POSIX, or windows close messages and console events on Windows.
Package: drel
drelDjango request ElasticSearch loggingDjango supportTo log every django request insert LoggingMiddleware before AuthenticationMiddleware:# settings.pyMIDDLEWARE=[...,"django.contrib.auth.middleware.AuthenticationMiddleware","drel.django.LoggingMiddleware",...]This will insert request and response info to Elastic Search index calledlogs-{week_start}-{week_end}in following format:{"timestamp":"2018-12-09 02:22:22","type":"default","request":{"url":"https://httpbin.org/post","data":{"param1":"value1"},"headers":{}},"response":{"status":200,"data":{"args":{},"data":"","files":{},"form":{"param1":"value1"},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate","Connection":"close","Content-Length":"13","Content-Type":"application/x-www-form-urlencoded","Host":"httpbin.org","User-Agent":"python-requests/2.19.1"},"json":null,"origin":"130.193.67.76","url":"https://httpbin.org/post"}},"app":"default","request_id":"2180930f-859b-4aef-8770-17107fff1170"}Requests supportTo logrequestsrequest and response data usedrel.requests.logfunction:>>> from drel.requests import post, log
>>> request, response = post("https://httpbin.org/post", {"param1": "value1"})
>>> log(request, response)ConfigurationTo change settings overrideconfigmodule values:fromdrelimportconfigconfig.APPLICATION="django_app"Sample Django configurationfromdjango.httpimportHttpRequestfromdrel.coreimportconfigfromdrel.djangoimportmail_admins_on_es_exceptiondefignore_logging_handler(request:HttpRequest)->bool:returnany([request.path=="/api/register_device/",request.method!="POST",])config.ELASTIC_SEARCH_EXCEPTION_HANDLER=mail_admins_on_es_exceptionconfig.INDEX_NAME_GETTER=lambda:"django_app_2019-01-01"config.APPLICATION="django_app"config.IGNORE_LOGGING_HANDLER=ignore_logging_handlerThis configuration:mail admins on Elastic Search index exceptionignore logging non-POST and /api/register_device/ requestsinsert docs to django_app_2019-01-01 indexapplication field = django_app
Package: dremio-arrow
Dremio SQL Lakehouse Arrow Flight ClientArrow Flight is a high-speed, distributed protocol designed to handle big data, providing increase in throughput between client applications and Dremio.
This Dremio Arrow Flight Client is based onpython official examples.Disclaimer: This project is not affliated todremioin any way. It is a tool that I developed while at CIFOR-ICRAF and now we have decided to open source it for wider community use. While I may not have enough time to actively maintain it, the tool is stable enough to sustain future use cases. Besides, community contribution is warmly welcome in form of PRs and forks.Documentation:https://jaysnm.github.io/dremio-arrow/GitHub:https://github.com/jaysnm/dremio-arrowPyPI:https://pypi.org/project/dremio-arrow/Free software: Apache-2.0Flight BasicsThe Arrow Flight libraries provide a development framework for implementing a service that can send and receive data streams. A Flight server supports several basic kinds of requests:Handshake: a simple request to determine whether the client is authorized and, in some cases, to establish an implementation-defined session token to use for future requestsListFlights: return a list of available data streamsGetSchema: return the schema for a data streamGetFlightInfo: return an “access plan” for a dataset of interest, possibly requiring consuming multiple data streams. This request can accept custom serialized commands containing, for example, your specific application parameters.DoGet: send a data stream to a clientDoPut: receive a data stream from a clientDoAction: perform an implementation-specific action and return any results, i.e. a generalized function callListActions: return a list of available action typesMore details can be foundhereInstallationPlease see installation noteshere
Package: dremio-client
Dremio clientTheun-officialpython client for Dremio’s REST API. This enables both administrators and data scientists to get
the most out ofDremioin PythonDocumentation:https://dremio-client.readthedocs.io.Github:https://github.com/rymurr/dremio_clientPyPI:https://pypi.python.org/pypi/dremio_clientFree software: Apache Software License 2.0FeaturesCross platform supportAll Pythons between 2.7 - 3.7 supportedFull support for Dremio’sREST APIOptional Support for Dremio’sODBCor experimentalArrow FlightcapabilitiesRich config file support viaconfuseyaml config library. Simple to create a client (config stored in a yaml file)fromdremio_clientimportinitclient=init()# initialise connectivity to Dremio via config filecatalog=client.data# fetch catalogvds=catalog.space.vds.get()# fetch a specific datasetdf=vds.query()# query the first 1000 rows of the dataset and return as a DataFramepds=catalog.source.pds.get()# fetch a physical datasetpds.metadata_refresh()# refresh metadata on that datasetCLI interface for integration with scripts$dremio_clientquery--sql'select * from sys.options'{'results':results}$dremio_clientrefresh-metadata--table'my.vds.name'{'result':'ok'}Catalog autocompletion in Jupyter NotebooksStatusThis is still alpha software and is relatively incomplete. Contributions in the form of Github Issues or Pull requests
are welcome. SeeCONTRIBUTINGTODOsee issuesHistory0.1.0 (2019-07-04)First code, unreleased.0.2.4 (2019-08-13)Alpha quality release with partial implementation of features. First PyPI release.0.3.0 (2019-08-14)Beta quality release for GET based endpoints0.5.0 (2019-10-30)Most endpoint supportedflight support with tls & authminor bugfixes0.6.3 (2020-01-29)All endpoints supportedlots of bugfixesutilities for building spaces/folders vdsremoved recordclass library in favor of attrs0.8.4 (2020-01-29)history re-written0.8.8 (2020-02-19)minor bug fixes0.8.9 (2020-02-19)ensure use correct name for Spaces0.8.11 (2020-03-09)bug fixes when creating sources and folders0.9.2 (2020-03-17)add promote endpointupdate versions from pyup0.10.1 (2020-03-19)fix ssl verify flag in cli0.11.1 (2020-04-09)a number of bug fixes and improvements from the community0.12.0 (2020-04-22)add graph endpoint and cli flagadd more detailed exception handling0.12.1 (2020-05-04)few bug fixes and API extensions0.13.0 (2020-05-21)add version flagupgrades and additions to some commands0.13.1 (2020-05-21)simplify delete cli command0.13.2 (2020-05-22)bugfixes0.13.3 (2020-09-07)fix wlm bugbump dependencies0.13.6 (2020-09-16)add new apisversion bumps0.14.0 (2021-04-01)add new apisversion bumpsdocs updatesfix to query to produce correct pandas data framefix to cli, dup args0.15.1 (2021-08-26)add new apisversion bumps
Package: drench
#DrenchDrench is a lightweight BitTorrent client written in Python. There are a couple of nice features, like the ability to download a subset of all the files in the torrent and exiting cleanly once the download is complete.The client works with [vis](https://github.com/jefflovejapan/vis), a Twisted web server and D3.js visualization, to show what’s going on in the user’s file system while the download is taking place.##InstallThe preferred way to install Drench is with [pip](http://www.pip-installer.org/en/latest/installing.html), which will let you run the following command from the terminal:pip install drenchAlternatively, you can clone the source and run the following:python setup.py install##UseFrom the command line enter the following:python -m drench ./mytorrent.torrent –port 8000 –visualizer 127.0.0.1:8002 –directory ~/Downloads/./mytorrent.torrent: The path to your torrent file (required)–port 8000: The port to use for BitTorrent traffic (optional)–directory ~/Downloads: Where to save your download (optional)–visualizer 127.0.0.1:8002: The address of your [vis](https://github.com/jefflovejapan/vis) server (optional)Drench isn’t capable of downloading multiple torrents at once; just start up a second instance in another terminal instead.##StatusYou can use Drench to download torrent files from the small handful of sites I’ve tested on.What doesn’t work:
- Seeding
- Magnet links
- UDP-based handshake with tracker (which knocks out several of the biggest trackers)