Saravanan666/pypi-org huggingface dataset:
Package: kearsley
Kearsley algorithmThis module provides a class to perform the Kearsley algorithm for structural comparisons. The class calculates the rotation and translation that minimizes the root mean squared deviations for two sets of 3D points.Original paper by Simon K. Kearsley:On the orthogonal transformation used for structural comparisonshttps://doi.org/10.1107/S0108767388010128.InstallInstall the package with:user@host:~$ pip install kearsleyUsageGiven two sets of 3D pointsuandv:>>> u, v = read_data()
>>> u
array([[0, 0, 0],
       [0, 0, 1],
       [0, 0, 2],
       ...,
       [9, 9, 7],
       [9, 9, 8],
       [9, 9, 9]])
>>> v
array([[ 30.50347534, -20.16089091,  -7.42752623],
       [ 30.77704903, -21.02339348,  -7.27823201],
       [ 31.3215374 , -21.99452332,  -7.15703548],
       ...,
       [ 42.05988643, -23.50924264, -15.59516355],
       [ 42.27217891, -24.36478643, -15.59064995],
       [ 42.66080502, -25.27318759, -15.386241  ]])It is possible to calculate the rotation and translation that minimize the root mean squared deviation:>>> from kearsley import Kearsley
>>> k = Kearsley()
>>> rmsd = k.fit(u, v)
>>> rmsd
0.10003430497284149The rotation and translation are the attributes of the class:>>> k.rot.as_matrix()
array([[ 0.05552838, -0.04405506, -0.99748471],
       [ 0.91956342,  0.39147652,  0.03390061],
       [ 0.38899835, -0.9191329 ,  0.06224948]])
>>> k.trans
array([ 30.46560753, -20.15086287,  -7.34422276])Once fitted you can apply the transformation tovor to other set of points:>>> v_transform = k.transform(v)
>>> v_transform
array([[ 0.08563846,  0.02807207,  0.01876202],
       [-0.01009153, -0.0529479 ,  0.92722971],
       [-0.05796549,  0.07167779,  2.03917659],
       ...,
       [ 9.0219524 ,  9.067236  ,  7.08333594],
       [ 9.06692944,  8.9276801 ,  7.95255679],
       [ 8.92463409,  8.93635832,  8.95139744]])It is also possible to fit and transform with one command, in this case the transformation is applied to the second set of points:>>> v_transform, rmsd = k.fit_transform(u, v)
>>> rmsd
0.10003430497284149
>>> v_transform
array([[ 0.08563846,  0.02807207,  0.01876202],
       [-0.01009153, -0.0529479 ,  0.92722971],
       [-0.05796549,  0.07167779,  2.03917659],
       ...,
       [ 9.0219524 ,  9.067236  ,  7.08333594],
       [ 9.06692944,  8.9276801 ,  7.95255679],
       [ 8.92463409,  8.93635832,  8.95139744]])The rmsd is the expected:>>> np.sqrt(np.sum((u - v_transform)**2)/len(u))
0.10003430497298871There are two attributes:Kearsley.rot: a scipy Rotation instance.Kearsley.trans: a ndarray with shape (3,) with the translation.ApplicationsCompare a set of measured points with their theoretical positions.In robotics compare two sets of points measured in different coordinate systems and get the transformation between both coordinate systems.It is possible to use it in a 2D space fixing the third coordinate to zero.NotesCheckScipy Rotationto have all the info about Rotation instance.
Package: keas.googlemap
Zope 3 Google Map IntegrationContentsZope 3 Google Map IntegrationIntroductionDemoLive DemoCHANGESVersion 0.6.0 (2009-07-26)Version 0.5.1 (2008-11-07)Version 0.5.0 (2008-07-28)IntroductionThekeas.googlemappackage provides an easy way to bring google
maps into your zope 3 applications.  Some of the features ofkeas.googlemapare:Look up geocodes (latitude and longitude coordinates) for any
query stringManage Google Map API keys for multiple domainsSort geocodes by distance using the haversine functionPython representation of a google map that will render all the
necessary javascript to display the map, including geocode
markers.DemoSee for yourself whatkeas.googlemapis capable of by running the
demo.  To run the demo, type the following commands:Download the source from the Zope subversion repository:$ svn co svn://svn.zope.org/repos/main/keas.googlemap/trunk keas.googlemap
$ cd keas.googlemapRun thebootstrap.pyandbuildoutscripts:$ python bootstrap.py
$ ./bin/buildoutStart the demo server:$ ./bin/demo fgYou should now be able to gohttp://localhost:8080and see a google map
with options for how the google map should be displayed.Live DemoIf you are too lazy to try out the demo yourself, you can also see it
running athttp://demo.carduner.net/keas.googlemap/CHANGESVersion 0.6.0 (2009-07-26)Feature: Updated text to latest packages.Version 0.5.1 (2008-11-07)Bug: Fix error with non-lating geocode queries.Feature: You can now do:<script
tal:replace="provider:keas.googlemap.browser.interfaces.IJavaScript"
/>and magically get all the necessary javascript viewlets to use the
google map.Feature: marker now has a popupOnLoad attribute that can be set to True
to get marker’s info window displayed when page is loaded, not only when
marker is clicked. Note that only one marker can have popupOnLoad == True.Version 0.5.0 (2008-07-28)Initial ReleaseLook up geocodes (latitude and longitude coordinates) for any
query stringManage Google Map API keys for multiple domainsSort geocodes by distance using the haversine functionPython representation of a google map that will render all the
necessary javascript to display the map, including geocode
markers.
Package: keas.profile
Profiler middlewareThis package provides middleware for profiling of the application.  It’s based
onpaste.debug.profile,
but uses cProfile instead of hotshot.If you use PasteScript, enabling the profiler is as simple as adding[filter-app:profile]
use = egg:keas.profile#profiler
next = mainto your paster configuration file and passing--app-name=profiletopaster.  When you access your web application, every page will have the
profiler output appended to the end of the document body.CHANGES0.3.0 (2013-03-29)Depend on WebOb instead of Paste.Add support for Python 3.0.2.0 (2010-08-07)Remove pyprof2calltree support; looks like it’s buggy (or incompatible with
Python 2.6) and just breaks everything.0.1.0 (2008-12-12)Initial release
Package: keas.unit
Unit ConverterThe unit converter is a simple utility to convert units. While it may seem to
be a trivial task initially, there are many different conventions and
combinations. Instead of inventing yet another unit conversion utility, this
package reuses theunitsshell command, which has the best implementation
that I have found out there.>>> from keas.unit import unitThe first step is to instantiate the unit converter object:>>> converter = unit.UnitConverter()By default the converter uses the following path for theunitscommand:>>> converter.executable
'/usr/bin/units'So let’s make a simple unit conversion:>>> converter.convert('atm', 'kPa')
Decimal("101.325")There are several options that can be set on the conversion object. The first
one is the output format, which allows you to specify the precision on the
output. Of course, we then convert this output to a decimal:>>> converter.format
>>> converter.format = '%.15g' # 15 decimal places
>>> converter.convert('atm', 'kPa')
Decimal("101.325")Next you can specify additional unit conversion data filenames, so that custom
conversions can be loaded:>>> import os
>>> datafile = os.path.join(
...     os.path.dirname(unit.__file__), 'test-conversions.dat')>>> converter.filenames
>>> converter.filenames = ('', datafile)>>> converter.convert('keas', 'l')
Decimal("0.54321")>>> converter.filenames = NoneAn empty name means that the default data file should be loaded as well.The final option allows you to set whether the ‘-’ character should be treated
as a multiplication operator, since it is used as such in some notations.>>> converter.minusAsProduct
False
>>> converter.minusAsProduct = True>>> converter.convert('m-m-m', 'l')
Decimal("1000")Finally, let’s have a look at some error scenarios.There is no known conversion from one unit to another:>>> converter.convert('kg', 'm')
Traceback (most recent call last):
...
UnitConversionError: ('/usr/bin/units -t -o %.15g -p "kg" "m"',
                      'conformability error')One of the units is unknown:>>> converter.convert('kg', 'foo')
Traceback (most recent call last):
...
UnitConversionError: ('/usr/bin/units -t -o %.15g -p "kg" "foo"',
                      "Unknown unit 'foo'")One of the units contains an invalid expression:>>> converter.convert('kg', 'm *')
Traceback (most recent call last):
...
UnitConversionError: ('/usr/bin/units -t -o %.15g -p "kg" "m *"',
                      "Error in 'm *': Parse error")CHANGES1.0.0 (2009-07-26)Initial release.
Package: keats
KeatsKeats is an Python build, installation, and workflow manager. Keats removes the need to update an embedded version string for your packages by automatically creating and maintaining a__version__.pyfile and a correspondingchangelog.jsonfile. Updates topyproject.tomlare automatically handled. Version updates are easy as callingkeats version. Keats also includes an interactive release script, which can be called usingkeats release, which will release your package to your favorite repository such as PyPI.WhyEvery Python developer seems to have their own tricks and scripts for
maintaining changelogs, package versions, and managing releases. Rather
than reinventing the wheel everytime you develop a new pacakge, Keats
provides a standard workflow for doing python package releases. No
customization or Makefiles are required.UsageTo installKeatsto your project, run:poetryrunadd--devkeatsVerify your installation by runningpoetryrunkeatskeatsTo list documentation, run keats with no argumentspoetryrunkeatsTo begin version managment by creating a__version__.pyin
your main package, runpoetryrunkeatsversionupFrom within your python project, you can access your version number and
other package information using something like (usually in the__init__.pyof your main package).from.__version__.pyimport__version__,__title__,__authors__# and so onTo bump to the next version and update your change log (for more on change logs, see below)poetry run keats bumpTo bump to a specific version:poetry run keats bump <optional version>To bump without updating the change log:poetryrunkeatsversionbumpChangelogsChangelogs are important understanding project status and developer intentions.
Keats encourages an up-to-date changelog by providing an standard interface
for maintaining and updating change logs using the following files:.keats/changelog.json- JSON formatted list of changes, with version number, dates, and optional change list..keats/changelog.md- markdown formatted changelogThe recommended way to use this is to runkeats bumpwhich will
bump your package versionandupdate your change log:poetry run keats bump <optional version>This will provide an interactive script to update your changelog
with a description and a list of changes. Entries are appended to the.keats/changelog.jsonand saved. The file is then converted to a markdown
file for readability or documentation purposes.To just update your change log:poetryrunkeatschangelogaddIf you want to just update the.keats/changelog.mdfrom the json file,
run:poetryrunkeatschangelogupTo clear your change logs:poetryrunkeatschangelogclearPre-commit HooksTo automatically keep your__version__.pyfile up to date, install the following hook:repos:
-   repo: https://github.com/jvrana/keats
    rev: 0.2.28
    hooks:
    - id: keats-version-upGlobal installationTo installKeatsglobally, run:pipinstallkeatsYou can then run all of the commands without thepoetry runprefix, given that your current directory is a Python project
with apyproject.tomlfile.
Package: keba-kecontact
KEBA KeContactThis is python library to control KEBA charging stations, in specific the P20, P30 and the BMW wallbox.
Commands were taken from theUDP Programming Manual.
The library was written for the usage inHome Assistant.CommandsThe following commands are implemented so far:request_dataset_failsafeThe failsafe function is a way to detect a failure of the network communication between the UDP application and the charging station.
In this case, the charging station will fall into a state with a definable current limitation.
By default, the failsafe function is disabled and must be enabled by the application.Parameters:timeout in seconds (default = 30 s)fallback_value in ampere (default = 6 A)persist (default = 0)set_energyThe command setenergy can be used to set an energy limit for an already running or the next charging session.
If the energy limit is greater than or equal to the value in the E pres field of report 3 the charging session will be stopped and the device will be deactivated (similar to ena 0).
All settings caused by setenergy are not permanent and are reset at the next time the device registers that the EV plug is pulled from a vehicle inlet or the charging station is restarted.Parameters:energy in kWh (default = 0 kWh)set_currentThis command sets the current limit of the running charging process.Parameters:current in ampere (default = 0 A)set_textThis command displays a text on the display of the charger.Parameters:text to show on the displaymin time to show the text before next text is shown (default = 2 s)max time to show the text (default = 10 s)startThis command authorizes a charging process with the given RFID tag and RFID class.Parameters:rfid tag as 8 byte hex string, identifier of RFID cardrfid class as 10 byte hex string, classifier of RFID cardstopThis command stops a charging process with the given RFID tag.Parameters:rfid tag as 8 byte hex string, identifier of RFID cardenableThe enable command can be used to permanently disable the system by using the parameter 0.
After receiving ena 0 the device will be disabled until it is rebooted or ena 1 or currtime are used.
The execution of ena 0 will take approximately 1 second.
If ena 0 is used, then no other command should be sent for 2 seconds to ensure an undisturbed execution of the disable command.Parameters:ena in [0,1]unlock_socket(not tested yet)
Package: kebechet
I’m Kebechet, goddess of freshness. I will keep your sources and dependencies fresh and up-to-date.Kebechet is a SourceOps bot that automates updating dependencies of your project. Currently, it supports managing and updating Python projects based onpipenvfiles (PipfileandPipfile.lock) orrequirements.txt/requirements.infiles (seepip-tools- Kebechet is a replacement for it)Configuration of KebechetKebechet is configured using a simple YAML configuration file. Check documentation of managers to get all the available options.Each configuration entry configures a manager. Please checkmanagers and examplesto get info about configuration options.The YAML configuration file can be supplied directly as a path to a file on filesystem as well as a URL to a file - handy for managing configuration of your Kebechet deployment in a Git repository (you have to supply a URL to a raw YAML configuration file).ManagersKebechet consists of managers that perform certain actions.A list of managers with their configuration (documentation lives in the manger directory) can be foundin the repo.Issues created by KebechetIf there are any issues that have serious impact on Kebechet functionality, Kebechet will automatically open an issue in the given repository. These issues can be configuration issues of Kebechet itself or issues in manager itself.Suppressing bot verbosityBot updates pull requests and issues and notifies about updates via comments (to issues or pull requests). You can suppress this behaviour by setting lable ‘silent-bot’ to issue or to a pull request. The bot will still perform updates but update comments will not be added.This is especially helpful for example if you have failing updates of your dependency and you would like to keep the pull request opened and check for fix later. Setting ‘silent-bot’ label to the PR will suppress Kebechet to post updates and you will not retrieve spam messages anymore.NotesTo issue an update to Git repository, Kebechet creates branches in the provided repository.Deploying KebechetTo deploy Kebechet on an OpenShift cluster use kustomize and theThoth Application template files.
Please ensure all the input parameters are correctly set for each of the templates.If Kebechet finds the env variables,GITHUB_APP_IDandGITHUB_PRIVATE_KEY_PATH, it is going to authenticate as a Github Application.Otherwise its going to fallback to look for an OAuth token to authenticate for an successful run.
In both cases the SSH key is needed to commit code changes.
Package: keboola.csvwriter
CSV ElasticDictWriterDictWriter, built on top of csv.DictWriter, that supports automatic extension of headers according to what data it receives.
The result file always has a complete header (as defined by fieldnames) or it is extended if some new columns
are introduced in the data. It always produces a valid CSV (missing columns are filled with blanks).
It uses a series of cached writers / files that are merged into a single one with final set of columns on close()InstallationThe package may be installed via PIP:pip install keboola.csvwriterNOTE:If not using "with" statement, close() method must be called at the end of processing to get the result.NOTE:Does not keep the order of rows added - the rows containing additional headers always come first:Example:fromkeboola.csvwriterimportElasticDictWriterfile='/test/test.csv'wr=ElasticDictWriter(file,["a","b","c"])wr.writeheader()wr.writerow({"a":1,"b":2})wr.writerow({"b":2,"d":4})wr.close()leads to CSV with following content:abcd2412May be also used withwithstatement to automatically close once finished:fromkeboola.csvwriterimportElasticDictWriterfile='/test/test.csv'withElasticDictWriter(file,["a","b","c"])aswr:wr.writeheader()wr.writerow({"a":1,"b":2})wr.writerow({"b":2,"d":4})# get final headersfinal_header=wr.fieldnamesNOTE:The final column list is stored infieldnamesproperty:columns=writer.fieldnames
Package: keboola.json-to-csv
Python JSON to CSV LibraryIntroductionJSON-to-CSV is a Python library designed to simplify the process of parsing JSON data and converting it into CSV files. It provides a flexible and efficient solution for handling JSON data with complex structures and converting it into structured CSV files for easy analysis and storage. The library offers a user-friendly interface for specifying table mappings, primary keys, and data types, allowing users to customize the output CSV format to suit their specific needs. Whether you are dealing with large-scale JSON datasets or small JSON objects, JSON-to-CSV offers powerful tools to streamline the parsing and conversion process, making it an indispensable tool for data engineers and analysts.How it WorksThe parser in JSON-to-CSV operates in three main steps. First, it analyzes the JSON data and constructs a mapping of tables, columns, and data types based on the user-provided table mapping or through automatic inference if not explicitly specified. Next, it processes the JSON data and organizes it into a structured format according to the defined table mapping. During this step, the parser performs additional analysis for data that is not explicitly specified in the table mapping if the user chooses to do so. Finally, the parsed data is saved as CSV files, with each table represented as a separate CSV file, preserving the hierarchical relationships between the tables.QuickstartInstallationpip install keboola.json-to-csvUsageSee Examples folder for usage
Package: keccaky
KeccakySecure and easy-to-use keccak✅ ready for production!!!RoadmapCreate Keccak 256 hashCreate massive tests agains pycryptodome (575 tests)Create benchmark tests agains pycryptodomeAPI made easy for clientDocs for devRe-write Keccak algorithm in Rust using FFIDocsINSTALLpip install keccakypoetry add keccakyUSEfromkeccakyimporthash_it_bytesfromkeccakyimportethereum_hashfromkeccakyimporthash_itasserthash_it_bytes("keccaky".encode()).hex()=="ff7e4a2e488ac0d8ed435b41979a0c1defeae30231dc5338a1b3a39c86adfd3c"assertethereum_hash("keccaky")=="0xff7e4a2e488ac0d8ed435b41979a0c1defeae30231dc5338a1b3a39c86adfd3c"asserthash_it("keccaky")=="ff7e4a2e488ac0d8ed435b41979a0c1defeae30231dc5338a1b3a39c86adfd3c"
Package: keckdrpframework
Data reduction and processing framework at W.M. Keck ObservatoryDocumentationDocumentation for this project is maintained with ReadTheDocs at the following link:https://keckdrpframework.readthedocs.io/en/latest/LicenseThis project is Copyright (c) L. Rizzi, S. Kwok, M. Brown and licensed under
the terms of the BSD 3-Clause license.  See the licenses folder for
more information.ContributingWe love contributions! KeckDRPFramework is open source,
built on open source, and we’d love to have you hang out in our community.Imposter syndrome disclaimer: We want your help. No, really.There may be a little voice inside your head that is telling you that you’re not
ready to be an open source contributor; that your skills aren’t nearly good
enough to contribute. What could you possibly offer a project like this one?We assure you - the little voice in your head is wrong. If you can write code at
all, you can contribute code to open source. Contributing to open source
projects is a fantastic way to advance one’s coding skills. Writing perfect code
isn’t the measure of a good developer (that would disqualify all of us!); it’s
trying to create something, making mistakes, and learning from those
mistakes. That’s how we all improve, and we are happy to help others learn.Being an open source contributor doesn’t just mean writing code, either. You can
help out by writing documentation, tests, or even giving feedback about the
project (and yes - that includes giving feedback about the contribution
process). Some of these contributions may be the most valuable to the project as
a whole, because you’re coming to the project with fresh eyes, so you can see
the errors and assumptions that seasoned contributors have glossed over.Note: This disclaimer was originally written byAdrienne Lowefor aPyCon talk, and was adapted by
KeckDRPFramework based on its use in the README file for theMetPy project.
Package: kecleon
AboutThis is a skeleton project to have a standardized and concrete base for all projects.Installation$python-mpipinstallkecleonDocumentationDocumentation is availablevia GitHub.TestingTo run all tests runnox. No venv is needed; nox makes all of them for us.$python-mpipinstall--usernox$gitclonehttps://github.com/Peilonrayz/kecleon$cdkecleonkecleon$noxLicenseKecleon is available under the MIT license.
Package: kecpkg-tools
kecpkg-toolsUsagekecpkg-tools provide a set of tools to easily create KE-chain packages.
These are executable python scripts aimed for execution on the KE-chain
SIM platform.It requires normal user access to aKE-chaininstance for it to work. KE-chain is the flexible engineering platform
ofKE-works.See AlsoKE-chain packages for SIM are used in combination withpykechain, the open source
KE-chain python api.InstallationInstallation with pipkecpkg-tools is distributed onPyPIas a universal
wheel and is available on Linux/macOS and Windows and supports Python
2.7/3.4+ and PyPy.$pipinstall--user--upgradekecpkg-toolsor when pip is not installed on the system$python3-mpipinstall--user--upgradekecpkg-toolsInstallation using snap (beta)When on a linux platform, you may use the snapstore to install kecpkg automatically and
keep it up to date to the latest and greated.$sudosnapinstallkecpkg--edgeAny feedback is appreciated as we are in beta mode for publishingkecpkgon the snapstore.Licensekecpkg-tools is distributed under the terms of theApache License,
Version 2.0.
Package: kecutil
KEC ITP: Python Util FunctionsFunctionskecutil.reduce(cb(cur, val), list, default)Reduce is used toreducea list to one value.
This is commonly useful when finding the longest string for examplefromkecutilimportreducestrings=["ab","acb","abcdef","abd"]longestString=reduce(lambdax,y:xiflen(x)>len(y)elsey,strings,"")print(longestString)# "abcdef"kecutil.clearConsole()Clears the console windowkecutil.clamp(value: int,length=2)Clamps a float to have the same number of decimals as the length
Returns a new floatfromkecutilimportclampnumber=100.12345clampedTwo=clamp(number)clampedThree=clamp(number,3)print(clampedTwo)# 100.12print(clampedThree)# 100.123print(type(clampedTwo))# <class 'float'>print(type(clampedThree))# <class 'float'>