Saravanan666/pypi-org huggingface dataset:
Package: pykusto
Introductionpykustois an advanced Python SDK for Azure Data Explorer (a.k.a. Kusto).Started as a project in the 2019 Microsoft Hackathon.Getting StartedInstallationDefault installation:pipinstallpykustoWith dependencies required for running the tests:pipinstallpykusto[test]Without dependencies which are not needed in PySpark:pipinstallpykusto--global-optionpysparkBasic usagefromdatetimeimporttimedeltafrompykustoimportPyKustoClient,Query# Connect to cluster with AAD device authentication# Databases, tables, and columns are auto-retrievedclient=PyKustoClient('https://help.kusto.windows.net')# Show databasesprint(tuple(client.get_databases_names()))# Show tables in 'Samples' databaseprint(tuple(client.Samples.get_table_names()))# Connect to 'StormEvents' tablet=client.Samples.StormEvents# Build query(Query(t)# Access columns using table variable.project(t.StartTime,t.EndTime,t.EventType,t.Source)# Specify new column name using Python keyword argument.extend(Duration=t.EndTime-t.StartTime)# Python types are implicitly converted to Kusto types.where(t.Duration>timedelta(hours=1)).take(5)# Output to pandas dataframe.to_dataframe())Retrying failed queries# Turn on retrying for all queriesfrompykustoimportPyKustoClient,RetryConfig,Queryclient=PyKustoClient("https://help.kusto.windows.net",retry_config=RetryConfig()# Use default retry config)# Override retry config for specific queryQuery(client.Samples.StormEvents).take(5).to_dataframe(retry_config=RetryConfig(attempts=3,sleep_time=1,max_sleep_time=600,sleep_scale=2,jitter=1))ContributingThis project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visithttps://cla.opensource.microsoft.com.When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted theMicrosoft Open Source Code of Conduct.
For more information see theCode of Conduct FAQor
contactopencode@microsoft.comwith any additional questions or comments.
Package: pykuwahara
pykuwaharaKuwahara filter in Python (numpy + OpenCV).The Kuwahara filter is a non-linear smoothing filter used in image processing for adaptive noise reduction. It is able to apply smoothing on the image while preserving the edges.
Source:WikipediaThis implementation provide two variants of the filter:The classic one, using a uniform kernel to compute the window mean.A gaussian based filter, by computing the window gaussian mean. This is inspired by theImageMagickapproach.Installationpip install pykuwaharaUsageSimple exampleimport cv2
from pykuwahara import kuwahara

image = cv2.imread('lena_std.jpg')

filt1 = kuwahara(image, method='mean', radius=3)
filt2 = kuwahara(image, method='gaussian', radius=3)    # default sigma: computed by OpenCV

cv2.imwrite('lena-kfilt-mean.jpg', filt1)
cv2.imwrite('lena-kfilt-gaus.jpg', filt2)Original imageFiltered with Kuwahara (mean)Filtered with Kuwahara (gaussian)Painting effectKuwahara filter can be used to apply a painting effet on pictures.import cv2
from pykuwahara import kuwahara

image = cv2.imread('photo.jpg')

# Set radius according to the image dimensions and the desired effect
filt1 = kuwahara(image, method='mean', radius=4)
# NOTE: with sigma >= radius, this is equivalent to using 'mean' method
# NOTE: with sigma << radius, the radius has no effect
filt2 = kuwahara(image, method='gaussian', radius=4, sigma=1.5)

cv2.imwrite('photo-kfilt-mean.jpg', filt1)
cv2.imwrite('photo-kfilt-gaus.jpg', filt2)Original image (source:wikipedia)Filtered with Kuwahara (mean)Filtered with Kuwahara (gaussian)Advanced usageColor image are supported by grayscaling the source image and using the gray channel to calculate the variance.
The user can provide another channel at his convenience, and alternatively give the right color conversion code (default isCOLOR_BGR2GARY).import cv2
from pykuwahara import kuwahara

image = cv2.imread('selfie.jpg')
image = (image / 255).astype('float32')     # pykuwahara supports float32 as well

lab_image = cv2.cvtColor(image, cv2.COLOR_BGR2Lab)
l, a, b = cv2.split(lab_image)

hsv_image = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv_image)

filt1 = kuwahara(image, method='gaussian', radius=5, sigma=2., image_2d=l)
filt2 = kuwahara(image, method='gaussian', radius=5, sigma=2., image_2d=v)

cv2.imwrite('selfie-kfilt-gaus1.jpg', filt1 * 255)
cv2.imwrite('selfie-kfilt-gaus2.jpg', filt2 * 255)Original image (source)Filtered with Kuwahara on L (Lab)Filtered with Kuwahara on V (HSV)
Package: pykv
# PyKV
PyKV is a key-value storage in the memory, it is simple and fast.## Requirements
Python3.8+## Installation`bash $ pip install pykv `## Example`python $ python >>> from pykv import KV >>> kv =KV(name="kv-app")>>>kv.put("key1","value1")        # the key1 default expires after 2 hours >>>kv.get("key1")'value1' >>> >>>kv.put("key2","value2", ttl=5) # the key2 expires after 5 second >>>kv.get("key2")# the key2 is deleted and return None after 5 second >>> `
Package: pykvdb
A simple key-value database in python.InstallationpipinstallpykvdbUsage:frompykvdbimportKVDBimportos# set db file path, default is './pykvdb'dbpath=os.path.join(os.path.split(os.path.realpath(__file__))[0],'kvdb')# set db file maxsize, default is 10Mdbsize=10*1024*1024withKVDB(path=kvpath,size=dbsize)askv:kv.set('a','test')# get valuewithKVDB(path=kvpath,size=dbsize)askv:print(kv.get('a'))# scan all key-valuewithKVDB(path=kvpath,size=dbsize)askv:cur=kv.cursor()fork,vincur:print(k.decode(),v.decode())
Package: pyKVFinder
A Python package for detecting and characterizing biomolecular cavities.See also:GitHub repositoryDocumentation and tutorialInstallationTo install the latest release onPyPI,
run:pip install pyKVFinderOr to install the latest developmental version, run:git clone https://github.com/LBC-LNBio/pyKVFinder.git
pip install pyKVFinderCitationIf you use pyKVFinder package, please cite:Guerra, J. V. S., Ribeiro-Filho, H. V., Jara, G. E., Bortot, L. O., Pereira, J. G. C., & Lopes-de-Oliveira, P. S. (2021). pyKVFinder: an efficient and integrable Python package for biomolecular cavity detection and characterization in data science. BMC bioinformatics, 22(1), 607.https://doi.org/10.1186/s12859-021-04519-4.If you usepyKVFinder.Molecule, please also cite:Guerra, J. V. S., Alves, L. F. G., Bourissou, D., Lopes-de-Oliveira, P. S., & Szalóki, G. (2023). Cavity Characterization in Supramolecular Cages. Journal of chemical information and modeling, 63(12), 3772-3785.https://doi.org/10.1021/acs.jcim.3c00328.LicenseThe software is licensed under the terms of the GNU General Public License version 3 (GPL3) and is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Package: pykvm
PyKVM a small KVM client that demonstrates how to use the Kernel-based Virtual Machine (KVM) interface from Python. The
client first initializes a barebones VM with a small amount of memory, and then loads and runs a raw binary. Since there
is no guest OS, no devices, and no I/O available, all the binary can do is access CPU registers and memory.This client is compatible with theKVM extensions for symbolic executionprovided byS2E. In
other words, you can symbolically execute programs with PyKVM.Running with native KVMFirst, build the sample binary. This binary writes 4KB of data at address0x1000and then halts the CPU.gitclonehttps://github.com/s2e/pykvmcdpykvmmake-CsampleThen, run the compiledsample.binbinary in PyKVM. Make sure that/dev/kvmis accessible.python-mpykvm.kvmsample/sample.binThe output will show the state of the memory before and after executing the binary.Symbolic executionWe will now swap native KVM for a version that implements symbolic execution.First, you need to build S2E. Please refer to the S2Edocumentationfor more details. In
all the commands below, theS2EDIRvariables points to the root of your S2E environment set up usings2e-env.Second, recompile the sample binary with S2E support. This is necessary in order to write symbolic values to memory. At
the moment, PyKVM cannot write symbolic data to memory directly, so it must be done from the running binary
instead.make-Csamplecleanmake-CsampleEXTRA_CFLAGS="-DUSE_S2E -I$S2EDIR/source/s2e/guest/common/include"exportS2E_CONFIG=sample/s2e-config.lua# libs2e.so uses LD_PRELOAD to intercept all calls to /dev/kvm in order to emulate
# native KVM while at the same time providing symbolic execution capabilities.LD_PRELOAD=$S2EDIR/build/s2e/libs2e-release/x86_64-s2e-softmmu/libs2e.sopython-mpykvm.kvmsample/sample.binWhen all the paths complete,libs2eautomatically terminates the Python process. You can inspects2e-last/debug.txtto see symbolic execution output. You will find several test cases corresponding to various
execution paths of the sample binary. Please refer to the sample binary’s source code for more details about the
expected results.ProjectsHere are some of the interesting things you could try and build on top of PyKVM.Run PyKVM in GDB together withlibs2e. Thegdb.iniscript contains the required configuration for S2E. Do not
forget to adapt the paths in there to your system.gdb--init-commandgdb.ini--argspython-mpykvm.kvmsample/sample.binWrite a small library that implements ans2e_make_symbolicsyscall, so that binaries can get symbolic data
easier. You can view this library as an OS, or better yet the BIOS.Extend PyKVM to load actual ELF/PE files into memory. Of course, they won’t have any imports or OS dependencies.
Package: pykvs
pykvsPyKVS is key-value store for Python. keys must be string and values must be picklable object.Installationgitclonehttps://github.com/yutayamazaki/pykvs.gitpythonsetup.pyinstallExampleimportpykvskvs=pykvs.PyKVS('./kvs')kvs['some-key']='some-value'
Package: pykvsdb
PYKVSDBA key-value store database written from the ground-up with speed in mind.InstallationPYKVSDB can be installed via pip:pip install pykvsdbSyntaxSetting ValuesYou can store a key-value pair in PYKVSDB with thesetfunction:pykvsdb.set("language", "python")Getting ValuesTo retrieve a value, use thegetfunction:pykvsdb.get("language")Saving to the file systemIf you would like to be able to access your data later you will need to save it to the file system withsave:pykvsdb.save("test.db")Loading a saved databaseIf you need to access a database saved to the file system again, you need to load it withload:pykvsdb.load("test.db")
Package: pykvs-lite
pykvs_liteKey-Value Store for PythonFeaturesSimple and convenient Key-value Store LibraryEasy to install (Use SQLite for the back end)Installation$ python3 -m pip install pykvs_liteRepositoryGitHubSimple sampleThe pykvs has set and get method.
However, you need to connect to the file before you use it.import pykvs_lite as kvs

# connect to KVS
kvs.connect('test.db')

# set
kvs.set('hoge', 1234)

# get
print(kvs.get('hoge'))
# get default value
print(kvs.get('hoge_1st', 'not exists'))

# close
kvs.close()Enum keysimport pykvs_lite as kvs
import json

# connect and set
kvs.connect('test.db')
kvs.set('hoge', 1234)
kvs.set('fuga', 'いろは')
kvs.set('foo', [1,2,3])

# enums
for key in kvs.keys():
    print(key, '=', json.dumps(kvs.get(key), ensure_ascii=False))

# dump to json
print(kvs.dump_json())
kvs.close()Use Multi tablesIt can use multi tables.import pykvs_lite as kvs

# set table_name
kvs.connect('test.db', table_name='no1')
kvs.set('hoge', 123)

# change table_name
kvs.connect('test.db', table_name='no2')
print(kvs.get('hoge', 'not_exists')) # show 'not_exists'only memoryimport pykvs_lite as kvs

# set table_name
kvs.connect()
kvs.set('hoge', 123)
print(kvs.get('hoge'))
Package: py-kvstore
Python KVStorepypi py-kvstoreA simple Key-Value store (similar to redis) built in python.Sets can expire, not expire, and be saved with any arbitrary data. So you can set it as a JSON string, a dict, int, or any other value. It is up to the developer to implement and parse types correctly.Projects UsingCosmosSDK Endpoint CacheNotable Features# create a new KVStorekv1=KVStore(name="transactions",dump_dir="/home/reece/kvstores")# Set a key. Defaults to -1 timeout (no timeout)kv1.set("tx;UUID-HERE","{"data":{"time":"...","amount":"...","currency":"..."}}")# Get the key, returns None if not found (ex: expired or never set)res=kv1.get("tx;UUID-HERE")# Set this key to expire in 100 secondskv1.set("other;expire_later","some string here",100)# Store data in multiple sub keys (hashset).# You can only set a timeout on the parent key for now IF its a new set. Else use .hset_expire(...)kv1.hset("parent_key","subkey1","value",10)kv1.hset("parent_key","subkey2","value2")kv1.hget("parent_key","subkey1")# returns "value"# Set values and increment a counterkv1.set("counter",0)kv1.incr("counter")# returns 1kv1.incr("counter",amount=4)# returns 5# Keyskv1.get_keys()# returns all non expired keyskv1.get_keys("tx;*")# returns keys matching the regex# Save current memory state to disk (the dump_dir set on initialize.)kv1.dump()# clear the storekv1.clear()# Load the previous dump from filekv1.load()
Package: pykwalifire
pykwalifirepykwalifireis a fork of the YAML/JSON validation librarypykwalify. It adds the
following features.New featuresSpecify custom file extensions for YAML and JSON data files [1.7.0]In order to be able to validate JSON or YAML files with non-default file
extensions, the following two options have been introduced:-yEXT,--yaml-extensionEXTto specify a custom extensionEXT, allowing to validate YAML files such asmy-yaml-file.yext.-jEXT,--json-extensionEXTto specify a custom extensionEXT, allowing to validate JSON files such asmy-json-file.jext.Support Python 3.x exclusively [2.0.1]pykwalifiredrops support for Python 2.7. Python 2.x will not be
maintained past 2020, and its defaultasciiencoding makes it a
nightmare for unicode support. To be able to usepykwalifireyou must
use it with Python 3.DefaultruamelYAML parser [2.0.1]AsPyYAML, the most widely used YAML parser in the Python world, does
not support YAML 1.2,ruamel.yamlis the default parser forpykwalifire.HistoryCf.pykwalify.Installationpykwalifireis available from PyPI:https://pypi.python.org/pypi/pykwalifire.Install it withpipinstallpykwalifireBasic usageCreate a data file. JSON and YAML formats are both supported.-foo-barCreate a schema file with validation rules.type:seqsequence:-type:strValidate the file from the command line:pykwalifire-ddata.yaml-sschema.yamlIf the YAML data file would be calleddata.customextension, you would
validate it withpykwalifire-ddata.customextension-sschema.yaml-ycustomextensionDocumentationFor further documentation, please see thepykwalify
documentation.Licensepykwalifireis licensed under the MIT license, cf.license
file.pykwalifybranchThepykwalify
branchis
used to create pull requests against theupstream
repository. Hopefully this way
all work that’s been done inpykwalifirecan be contributed back to
the original project.Thanks @Grokzen for creating a great piece of open source software!Change Log2.0.1(2017-12-20)Full
Changelog1.7.3(2017-12-18)Full
Changelog1.7.2(2017-12-18)Full
Changelog1.7.1(2017-12-18)Full
Changelog1.7.0(2017-12-13)Full
Changelog1.6.0(2017-01-22)Full
Changelog1.5.2(2016-11-12)Full
Changelog1.5.1(2016-03-06)Full
Changelog1.5.0(2015-09-30)Full
Changelog1.4.1(2015-08-27)Full
Changelog1.4.0(2015-08-04)Full
Changelog1.3.0(2015-07-13)Full
Changelog1.2.0(2015-05-19)Full
Changelog1.1.0(2015-04-04)Full
Changelog1.0.1(2015-03-08)Full
Changelog1.0.0(2015-03-08)Full
Changelog15.01(2015-01-17)Full
Changelog14.12(2014-12-24)Full
Changelog14.08(2014-08-24)Full
Changelog14.06.1(2014-06-23)Full
Changelog14.06(2014-06-07)Full
Changelog0.1.2(2013-01-26)Full
Changelogv0.1.1(2013-01-21)Full
Changelogv0.1.0(2013-01-20)*This Change Log was automatically generated by
`github_changelog_generator <https://github.com/skywinder/Github-Changelog-Generator>`__
Package: pykwalify-webform
pykwalify-webformGenerate webforms based on YAML schema with pykwalifyExamplesosgameclones Game form:https://cxong.github.io/pykwalify-webform/osgameclones/game.htmlosgameclones Original Game form:https://cxong.github.io/pykwalify-webform/osgameclones/original.html
Package: pykwic
pykwicKWIC Library for unicode text using Suffix Array.Based onesa.hxxandsais.hxx.Authors & ContributorsShunsuke Aihara -http://argmax.jpThis module is based onesa.hxxby Daisuke Okanohara andsais.hxxby Yuta Mori.This module is prepared with reference toMiniseby Daisuke Okanohara.LicenseWrapper code is licensed under MIT License.Bundledesa.hxxandsais.hxxare licensed under MIT License.
Package: pykxnr
PyKxnrDescriptionA collection of tools I have developed or adapted for day to day use. What I've covered here is
largely arbitrary, but the basic types of tool are separated out into separate files.SetupDependenciesNone, though some tools are designed for use with other packages and rely on that package.
If not using those tools, no additional dependencies are needed. Most recently tested on
python 3.7.Installationpip install pykxnrORpython -m pip install pykxnrAuthorsConnor KeaneLicenseThis project is licensed under the GPL3 License - see the LICENSE.md file for detailsAcknowledgments
Package: pykzee
Pykzee is an engine that allows plug-ins to operate on a JSON-like state tree.
Each plug-in can publish its internal state as part of the global state tree,
and can subscribe to changes of any part of the tree. Plug-ins can also send
commands between each other.The original purpose of Pykzee is to build home automations systems, but it
may well be useful in other contexts.Installation$pipinstallpykzeePykzee depends onpyimmutable, which will automatically be installed by pip if it is not present. Installation of pyimmutable may require a C++17 compiler on the host system.Example Usemkdir pykzee-config
cd pykzee-config
pykzeeThepykzeeexecutable will run forever. Because it is run in an empty directory, the internal state is empty ({}), and since no plug-ins are loaded, nothing will ever change the state. PressCTRL-Cto stop the pykzee process. Then try this:echo '{"__plugin__": "core-plugin"}' >core.json
mkdir plugins
echo '{"__plugin__": "pykzee.core.StateLoggerPlugin", "pretty": true}' >plugins/StateLogger.json
pykzeeLaunchingpykzeeagain now yields some output on the terminal. What you see is the StateLoggerPlugin printing the complete state tree. It will do this again every time the state changes.Pykzee instantiates a plug-in wherever it finds an object with a__plugin__key in the original state tree. The value of the__plugin__key must be a Python class (in dotted notation likefoo.bar.baz.classname, referring to the classclassnamein the modulefoo.bar.baz) or the special valuecore-plugin. The object containing the__plugin__key will get replaced in the state tree with the state published by the plug-in. The original object may have keys other than__plugin__, and those can be used to configure the plug-in, see for example theprettykey in this example, which make the StateLoggerPlugin output the state in pretty printed form.While thepykzeeprocess is still active in your terminal, open another terminal window, enter the samepykzee-configdirectory and add another file:echo '{"hello": "world"}' >test.jsonThe pykzee process will notice the change in the configuration file directory and reload the configuration. Go back to your first terminal window, and you will see that the StateLoggerPlugin has printed the new state tree, which now includes a field namedtestwith the contents{"hello": "world"}.Plug-ins Distributed with the Core PackageThepykzeepackage comes with three plug-ins included:core-plugin: publishes information about the Pykzee engine itself, e.g. which plug-ins are loaded.pykzee.core.StateLoggerPlugin: logs the complete state tree on every change.pykzee.core.CodePlugin: executes a snippet of Python code with access to the state tree.Further ReadingPykzee only becomes useful once further plug-ins are installed. Please have a look at thepykzee-inspectorplug-in, which contains a web server that serves a browser application for inspecting the Pykzee state.
Package: pykzee-inspector
A plug-in for Pykzee that launches a web server, serving a browser application for inspecting the Pykzee state.Installationpip install pykzee-inspectorThen, add this object somewhere in your Pykzee configuration:{"__plugin__":"pykzee.inspector.InspectorPlugin","port":8000}Openhttp://localhost:8000in a web browser to see the whole Pykzee state.
Package: py-kz-validators
Kazakhstani Validators PackageA collection of Python validators for various Kazakhstani identification numbers, such as the Individual Identification Number (IIN) and Taxpayer Identification Number (TIN)Installationpipinstallpy-kz-validatorsUsageHere are the available validators:1. Individual Identification Number (IIN)The IIN validator checks whether a given string represents a valid Kazakhstani Individual Identification Number.fromkz.validatorsimportIINifIIN.is_valid('791028302728'):print('IIN is valid')else:print('IIN is not valid')This code will outputIIN is validsince the IIN791028302728is a valid Kazakhstani Individual Identification NumberContributingContributions are welcome! If you have any suggestions or issues, please open an issue or pull request on theGitHub repository.Local Installation for Contributorsmakedev-depsAfter making any changes, don't forget to run flake8(make lint) and tests(make test).LicenseThis package is licensed under theMIT License. See the LICENSE file for more information.