Saravanan666/pypi-org huggingface dataset:
Package: polyviz
polyviz: An interface betweenbrightway2andD3.jsThis is a Python package that provides an interface between thebrightway2LCA framework and theD3.jsJavaScript library.
It is designed to be used in Jupyter notebooks, and provides
interactive visualizations of LCA results.This interface extends the capabilities ofd3blocks, and make it compatible
with results generated bybrightway2.polyvizallows the following visualizations to be created from LCA results:Sankey diagrams (example 1,example 2)Chord diagrams (example 1,example 2)Force-directed graphs (example 1,example 2)Tree maps (example 1,example 2)Choropleth maps (example 1,example 2)Violin plots (example 1,example 2)LimitationsTested only withbrightway2version 2.4.5.Probably works with version 2.5 too, but not tested.InstallationInstallpolyvizfrom PyPI:pipinstallpolyvizand you will need to install a forked version ofd3blocks:pipinstallgit+https://github.com/romainsacchi/d3blocks.gitUsageSankey diagramsfrompolyvizimportsankeyimportbw2dataact=bw2data.get_activity(("some db","some activity"))method=("some method","some method")sankey(activity=act,method=method)sankey()returns a filepath to an HTML file that can be opened in a browser.Alternatively, you can track a specific flow:frompolyvizimportsankeyimportbw2dataact=bw2data.get_activity(("some db","some activity"))flow_type="kilowatt hour"sankey(activity=act,flow_type=flow_type)Other examples are available in theexamplesnotebook.SupportDo not hesitate to report issues in the Github repository.MaintainersRomain SacchiContributingSeecontributing.LicenseBSD-3-Clause.
Package: polywhirl
PoliwhirlAre you working with an unfamiliar database and feeling confused?Do you find yourself runningSELECT * FROM TABLE LIMIT 100queries to remind yourself possible values of key fields?Do these values slowly change over the course of years, with no clear documentation from upstream data producers?If you answered "yes" to any of the above questions, this package may be for you.What it doesPoliwhirl helps you orient yourself in an unfamiliar database by generating useful HTML reports (viapandas-profiling) for key tables you specify. It saves all these outputs to a single directory, which you can index locally with Spotlight orAlfred, or even deploy to some internal static website for your team.InstallingYou can install this package via pip:pip install polywhirlFeatures and usagePolywhirl takes a single argument of a yaml file containing the structure of the database you'd like to profile. The format of this yaml file approximately follows that of dbt'sschema.yml. A template filetables.ymlis provided for you, but you'll need to input the lists of schemas and tables specific to your own database.polywhirltables.ymlPolywhirl currently supports these connections:BigQuery (usename: bigqueryintables.yml)Redshift (usename: redshiftintables.yml)For the sake of performance, polywhirl will pull a random sample of 10k rows from each table.
For Redshift, it supports defining asortkeyfor each table, which is used to limit data to the most recent 90 days. This improves performance on large tables.BigQuery credentials are handled bypandas.read_gbq()which relies on thepandas-gbqpackage.Redshift credentials are requested on first run, then stored locally in your system keychain using thekeyringpackage.FAQDo you realize you misspelledPoliwhirl?Yes I noticed this as I was writing this README—but it's too late—the name has grown on me.TodoWould like to get to the following in the future, so feel free to send PRs my way on any of these:Add equivalent of Redshift sortkey to BigQuery logic, to prevent unnecessary full table scansCompile .html outputs into a searchable static websiteAutomated tests (w/ pytest)
Package: polywit
DescriptionModern verification tools report a violation witness amidst verification if a bug is encountered. Polywit employs execution-based validation to check the validity of the counterexample. This process involves extracting information on the assumptions of the verifier from the standardized exchange format for violation witnesses and building a test harness to provide a concrete execution of the program. The tool then executes the test harness on the code under verification and can either confirm or reject the violation witness if the relevant assertion is reached.Whilst most modern execution-based validators such as wit4java and CPA-wit2test focus on specific language, polywit aims to provide an extensible, feature rich framework to allow for easy language integration and validator quality.FrameworkFor a general language, the polywit implementation has the following architecture:TheFile Processordeals with processing of the compilation units.TheWitness Processordeals with processing of the witness.TheTest Harnessdeals with construction and execution of a test to check the validity of the reported violation.LiteratureWit4Java: A violation-witness validator for Java verifiers (competition contribution)by Wu, T., Schrammel, P., & Cordeiro, L. C. International Conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, Cham, 2022. Springerdoi.org/10.1007/978-3-030-99527-0_36Usageusage: polywit [-h] frontend ...

Validate a given program with a witness conforming to the appropriate SV-COMP
exchange format.

positional arguments:
  frontend    Frontend language
    java      Use the java validator

options:
  -h, --help  show this help message and exitAuthorsJoss Moffatt (University of Manchester, United Kingdom)josshmoffatt@gmail.comTong Wu (University of Manchester, United Kingdom)wutonguom@gmail.comLucas Cordeiro (University of Manchester, United Kingdom)lucas.cordeiro@manchester.ac.ukPeter Schrammel (University of Sussex, United Kingdom)P.Schrammel@sussex.ac.uk
Package: polywrap
PolywrapThis package contains the Polywrap Python SDK.InstallationInstall the package with pip:pipinstallpolywrapQuickstartImports>>> from polywrap import (
...     Uri,
...     ClientConfig,
...     PolywrapClient,
...     PolywrapClientConfigBuilder,
...     sys_bundle,
...     web3_bundle
... )Configure and Instantiate>>> builder = (
...     PolywrapClientConfigBuilder()
...     .add_bundle(sys_bundle)
...     .add_bundle(web3_bundle)
... )
>>> config = builder.build()
>>> client = PolywrapClient(config)InvocationInvoke a wrapper.>>> uri = Uri.from_str(
...     'wrapscan.io/polywrap/ipfs-http-client'
... )
>>> args = {
...     "cid": "QmZ4d7KWCtH3xfWFwcdRXEkjZJdYNwonrCwUckGF1gRAH9",
...     "ipfsProvider": "https://ipfs.io",
... }
>>> result = client.invoke(uri=uri, method="cat", args=args, encode_result=False)
>>> assert result.startswith(b"<svg")
Package: polywrap-client
Polywrap ClientThis package contains the implementation of polywrap python client.QuickstartImports>>> from polywrap_core import Uri, ClientConfig
>>> from polywrap_client import PolywrapClient
>>> from polywrap_client_config_builder import PolywrapClientConfigBuilder
>>> from polywrap_sys_config_bundle import sys_bundle
>>> from polywrap_web3_config_bundle import web3_bundleConfigure and Instantiate>>> builder = (
...     PolywrapClientConfigBuilder()
...     .add_bundle(sys_bundle)
...     .add_bundle(web3_bundle)
... )
>>> config = builder.build()
>>> client = PolywrapClient(config)InvocationInvoke a wrapper.>>> uri = Uri.from_str(
...     'wrapscan.io/polywrap/ipfs-http-client'
... )
>>> args = {
...     "cid": "QmZ4d7KWCtH3xfWFwcdRXEkjZJdYNwonrCwUckGF1gRAH9",
...     "ipfsProvider": "https://ipfs.io",
... }
>>> result = client.invoke(uri=uri, method="cat", args=args, encode_result=False)
>>> assert result.startswith(b"<svg")
Package: polywrap-ethereum-provider
This package provides a Polywrap plugin for interacting with EVM networks.The Ethereum Provider plugin implements theethereum-provider-interface@ens/wraps.eth:ethereum-provider@2.0.0(see../../interface/polywrap.graphql).     It handles Ethereum wallet transaction signatures and sends JSON RPC requests     for the Ethereum wrapper.QuickstartImports>>> from polywrap_core import Uri
>>> from polywrap_client import PolywrapClient
>>> from polywrap_ethereum_provider import ethereum_provider_plugin
>>> from polywrap_ethereum_provider.connection import Connection
>>> from polywrap_ethereum_provider.connections import Connections
>>> from polywrap_ethereum_provider.networks import KnownNetwork
>>> from polywrap_client_config_builder import (
...     PolywrapClientConfigBuilder
... )Configure Client>>> ethreum_provider_interface_uri = Uri.from_str("ens/wraps.eth:ethereum-provider@2.0.0")
>>> ethereum_provider_plugin_uri = Uri.from_str("plugin/ethereum-provider")
>>> connections = Connections(
...     connections={
...         "sepolia": Connection.from_network(KnownNetwork.sepolia, None)
...     },
...     default_network="sepolia"
... )
>>> client_config = (
...     PolywrapClientConfigBuilder()
...     .set_package(
...         ethereum_provider_plugin_uri,
...         ethereum_provider_plugin(connections=connections)
...     )
...     .add_interface_implementations(
...         ethreum_provider_interface_uri,
...         [ethereum_provider_plugin_uri]
...     )
...     .set_redirect(ethreum_provider_interface_uri, ethereum_provider_plugin_uri)
...     .build()
... )
>>> client = PolywrapClient(client_config)Invocation>>> result = client.invoke(
...     uri=ethreum_provider_interface_uri,
...     method="request",
...     args={"method": "eth_chainId"},
...     encode_result=False,
... )
>>> print(result)
"0xaa36a7"
Package: polywrap-ethereum-wallet
This package provides a Polywrap plugin for interacting with EVM networks.The Ethereum wallet plugin implements theethereum-provider-interface@wrapscan.io/polywrap/ethereum-wallet@1.0(see../../interface/polywrap.graphql).     It handles Ethereum wallet transaction signatures and sends JSON RPC requests     for the Ethereum wrapper.QuickstartImports>>> from polywrap_core import Uri
>>> from polywrap_client import PolywrapClient
>>> from polywrap_ethereum_wallet import ethereum_wallet_plugin
>>> from polywrap_ethereum_wallet.connection import Connection
>>> from polywrap_ethereum_wallet.connections import Connections
>>> from polywrap_ethereum_wallet.networks import KnownNetwork
>>> from polywrap_client_config_builder import (
...     PolywrapClientConfigBuilder
... )Configure Client>>> ethreum_provider_interface_uri = Uri.from_str("wrapscan.io/polywrap/ethereum-wallet@1.0")
>>> ethereum_wallet_plugin_uri = Uri.from_str("plugin/ethereum-provider")
>>> connections = Connections(
...     connections={
...         "sepolia": Connection.from_network(KnownNetwork.sepolia, None)
...     },
...     default_network="sepolia"
... )
>>> client_config = (
...     PolywrapClientConfigBuilder()
...     .set_package(
...         ethereum_wallet_plugin_uri,
...         ethereum_wallet_plugin(connections=connections)
...     )
...     .add_interface_implementations(
...         ethreum_provider_interface_uri,
...         [ethereum_wallet_plugin_uri]
...     )
...     .set_redirect(ethreum_provider_interface_uri, ethereum_wallet_plugin_uri)
...     .build()
... )
>>> client = PolywrapClient(client_config)Invocation>>> result = client.invoke(
...     uri=ethreum_provider_interface_uri,
...     method="request",
...     args={"method": "eth_chainId"},
...     encode_result=False,
... )
>>> print(result)
"0xaa36a7"
Package: polywrap-fs-plugin
The Filesystem plugin enables wraps running within the Polywrap client    to interact with the local filesystem.InterfaceThe FileSystem plugin implements an existing wrap interface atwrapscan.io/polywrap/file-system@1.0.QuickstartImports>>> import os
>>> from polywrap_core import Uri
>>> from polywrap_client import PolywrapClient
>>> from polywrap_client_config_builder import PolywrapClientConfigBuilder
>>> from polywrap_fs_plugin import file_system_pluginCreate a Polywrap client>>> fs_interface_uri = Uri.from_str("wrapscan.io/polywrap/file-system@1.0")
>>> fs_plugin_uri = Uri.from_str("plugin/file-system")
>>> config = (
...     PolywrapClientConfigBuilder()
...     .set_package(fs_plugin_uri, file_system_plugin())
...     .add_interface_implementations(fs_interface_uri, [fs_plugin_uri])
...     .set_redirect(fs_interface_uri, fs_plugin_uri)
...     .build()
... )
>>> client = PolywrapClient(config)Invoke the plugin>>> path = os.path.join(os.path.dirname(__file__), "..", "pyproject.toml")
>>> result = client.invoke(
...     uri=Uri.from_str("wrapscan.io/polywrap/file-system@1.0"),
...     method="readFile",
...     args={
...         "path": path,
...     }
... )
>>> assert result.startswith(b"[build-system]")
Package: polywrap-http-plugin
This package contains the HTTP plugin.Http plugin currently supports two different methodsGETandPOST. Similar to calling axios, when defining request    you need to specify a response type. Headers and     query parameters may also be defined.Response TypesTEXT- The server will respond with text,     the HTTP plugin will return the text as-is.BINARY- The server will respond with binary data (_bytes_),     the HTTP plugin will encode as abase64string and return it.QuickstartImports>>> import json
>>> from polywrap_core import Uri
>>> from polywrap_client import PolywrapClient
>>> from polywrap_client_config_builder import PolywrapClientConfigBuilder
>>> from polywrap_http_plugin import http_plugin
>>> from polywrap_msgpack import GenericMapCreate a Polywrap client>>> http_interface_uri = Uri.from_str("wrapscan.io/polywrap/http@1.0")
>>> http_plugin_uri = Uri.from_str("plugin/http")
>>> config = (
...     PolywrapClientConfigBuilder()
...     .set_package(http_plugin_uri, http_plugin())
...     .add_interface_implementations(http_interface_uri, [http_plugin_uri])
...     .set_redirect(http_interface_uri, http_plugin_uri)
...     .build()
... )
>>> client = PolywrapClient(config)Make a GET request>>> result = client.invoke(
...     uri=http_interface_uri,
...     method="get",
...     args={
...         "url": "https://jsonplaceholder.typicode.com/posts",
...         "request": {
...             "responseType": "TEXT",
...             "urlParams": GenericMap({"id": 1}),
...             "headers": GenericMap({"X-Request-Header": "req-foo"}),
...         },
...     }
... )
>>> result.get("status")
200Make a POST request>>> result = client.invoke(
...     uri=http_interface_uri,
...     method="post",
...     args={
...         "url": "https://jsonplaceholder.typicode.com/posts",
...         "request": {
...             "responseType": "TEXT",
...             "body": json.dumps({
...                 "userId": 11,
...                 "id": 101,
...                 "title": "foo",
...                 "body": "bar"
...             }),
...             "headers": GenericMap({"X-Request-Header": "req-foo"}),
...         },
...     }
... )
>>> result.get("status")
201
Package: polywrap-logger-plugin
Logger Python PluginThe Logger plugin implements thelogger-interfacefrom theens/wraps.eth:logger@1.0.0package (see./src/schema.graphql). By default, it logs all events using the Pythonloggingmodule. You can customize this behavior by setting theLoggerproperty on the plugin's configuration object (examples below).Usage1. Configure ClientWhen creating your Polywrap Python client, add the logger plugin:frompolywrap_client_config_builderimportPolywrapClientConfigBuilderfrompolywrap_logger_pluginimportlogger_pluginfrompolywrap_clientimportPolywrapClientconfig=PolywrapClientConfigBuilder().set_package(uri=Uri.from_str("plugin/logger"),package=logger_plugin()).set_interface(interface=Uri.from_str("ens/wraps.eth:logger@1.0.0"),implementations=[Uri.from_str("plugin/logger")]).set_redirect(Uri.from_str("ens/wraps.eth:logger@1.0.0"),Uri.from_str("plugin/logger")).build()client=PolywrapClient(config)2. Invoke The LoggerInvocations to the logger plugin can be made via the interface URI (which will get redirected), or the plugin's URI directly:awaitclient.invoke({'uri':'ens/wraps.eth:logger@1.0.0'|'plugin/logger','method':'log','args':{'level':'INFO','message':'foo bar baz'}})3. Customize The LoggerWhen adding the logger to your client, you can add your own custom log function:config=PolywrapClientConfigBuilder().set_package(uri=Uri.from_str("plugin/logger"),package=logger_plugin(LoggerConfig(logger=YourLogger(),level=LogLevel.INFO))).set_interface(interface=Uri.from_str("ens/wraps.eth:logger@1.0.0"),implementations=[Uri.from_str("plugin/logger")]).set_redirect(Uri.from_str("ens/wraps.eth:logger@1.0.0"),Uri.from_str("plugin/logger")).build()4. Add Multiple LoggersMultiple logger implementations can be added to the client:config=PolywrapClientConfigBuilder().set_package(uri=Uri.from_str("plugin/logger"),package=logger_plugin(LoggerConfig(logger=YourLogger(),level=LogLevel.INFO))).set_interface(interface=Uri.from_str("ens/wraps.eth:logger@1.0.0"),implementations=[Uri.from_str("plugin/logger"),Uri.from_str("plugin/custom-logger")]).set_package(uri=Uri.from_str("plugin/custom-logger"),package=custom_logger_plugin()).build()5. Invoke All Logger ImplementationsWhen you'd like to log something to more than one logger, you can invoke all implementations of the logger interface:implementations=client.get_implementations('ens/wraps.eth:logger@1.0.0')forimplinimplementations:awaitclient.invoke({'uri':impl,'method':'log','args':{'level':'INFO','message':'message'}})
Package: polywrap-manifest
Polywrap Manifest contains the types and functions to de/serialize  Wrap manifests defined athttps://github.com/polywrap/wrap.QuickstartDeserialize WRAP manifest>>> from polywrap_manifest import deserialize_wrap_manifest, WrapManifest_0_1
>>> from polywrap_msgpack import msgpack_encode
>>> raw_manifest = msgpack_encode({
...     "version": "0.1.0",
...     "type": "interface",
...     "name": "test-interface",
...     "abi": {},
... })
>>> manifest = deserialize_wrap_manifest(raw_manifest)
>>> assert isinstance(manifest, WrapManifest_0_1)
Package: polywrap-msgpack
polywrap-msgpack adds ability to encode/decode to/from msgpack format.It provides msgpack_encode and msgpack_decode functions
which allows user to encode and decode to/from msgpack bytesIt also defines the default Extension types and extension hook for
custom extension types defined by WRAP standardQuickstartEncoding-Decoding Native types and objects>>> from polywrap_msgpack import msgpack_decode, msgpack_encode
>>> dictionary = {
...     "foo": 5,
...     "bar": [True, False],
...     "baz": {
...         "prop": "value"
...     }
... }
>>> encoded = msgpack_encode(dictionary)
>>> decoded = msgpack_decode(encoded)
>>> assert dictionary == decoded
>>> print(decoded)
{'foo': 5, 'bar': [True, False], 'baz': {'prop': 'value'}}Encoding-Decoding Extension types>>> from polywrap_msgpack import msgpack_decode, msgpack_encode, GenericMap
>>> counter: GenericMap[str, int] = GenericMap({
...     "a": 3,
...     "b": 2,
...     "c": 5
... })
>>> encoded = msgpack_encode(counter)
>>> decoded = msgpack_decode(encoded)
>>> assert counter == decoded
>>> print(decoded)
GenericMap({'a': 3, 'b': 2, 'c': 5})
Package: polywrapper
You can download it herehttps://pypi.org/project/polywrapper/Welcome to the PolyWrapper wiki!Here is the basics of using poly wrapperTo install polywrapper run the following commandpip install polywrapperHere is an example of inserting data into a databaseconnection = polywrapper.PolyClient("node2.lunes.host:27106", "Better_Password", "ExampleDB")

res = connection.insert("Hello", "World")
print(res)This will return {"Status": "Success"} if it works.`You can also input sub level JSON and listsconnection.insert({"users": ["David", "Andrew"]})
connection.insert("meta", {"page": "2"})To get data from certain keyprint(res)
to get all data from database do
res = connection.get()if the key value system is {"key": "value"} it will return value if it is something like {"key": {"sub": "json"}} it will return {"sub": "json"}To update a keys value.connection.update("key", "value2")once again this can be json or a string
to append data to a list you will need to dores = connection.insert("users", ["John", "Andrew"]) connection.append("users", "Mia")To remove certain keys.connection.remove('key')
Package: polywrap-plugin
This package contains the runtime for the Polywrap plugin system.QuickstartImports>>> from typing import Any, Dict, List, Union, Optional, cast
>>> from polywrap_manifest import AnyWrapManifest
>>> from polywrap_plugin import PluginModule
>>> from polywrap_core import InvokerClient, UriDefine a plugin module>>> class GreetingModule(PluginModule[None]):
...     def __init__(self, config: None):
...         super().__init__(config)
...
...     def greeting(self, args: Dict[str, Any], client: InvokerClient, env: Optional[Any] = None):
...         return f"Greetings from: {args['name']}"Create a plugin wrapper>>> greeting_module = GreetingModule(None)
>>> manifest = cast(AnyWrapManifest, NotImplemented)
>>> wrapper = PluginWrapper(greeting_module, manifest)Invocation>>> args = {
...     "name": "Joe"
... }
>>> result = wrapper.invoke(
...     uri=Uri.from_str("ens/greeting.eth"),
...     method="greeting",
...     args=args,
...     client=cast(InvokerClient, NotImplemented),
... )
>>> assert result.result == "Greetings from: Joe"
Package: polywrap-sys-config-bundle
This package contains the system configuration bundle for Polywrap Client.Bundled WrapswrapdescriptionhttpTo make HTTP requestshttp_resolverTo resolve URIs from HTTP serverwrapscan_resolverTo resolve URIs from wrapscan.ioipfs_http_clientTo add or retrieve items from IPFSipfs_resolverTo fetch wraps from IPFSgithub_resolverTo fetch wraps from github repofile_systemTo perform file system operationsfile_system_resolverTo fetch wraps from File SystemQuickstartImports>>> from polywrap_client_config_builder import PolywrapClientConfigBuilder
>>> from polywrap_sys_config_bundle import sys_bundle
>>> from polywrap_client import PolywrapClient
>>> from polywrap_core import Uri, UriPackageConfigure>>> config = PolywrapClientConfigBuilder().add_bundle(sys_bundle).build()
>>> client = PolywrapClient(config)Invoke bundled http plugin>>> response = client.invoke(
...     uri=Uri.from_str("wrapscan.io/polywrap/http@1.0"),
...     method="get",
...     args={"url": "https://www.google.com"},
... )
>>> response.get("status")
200Resolve URI with bundled wrapscan resolver>>> response = client.try_resolve_uri(
...     Uri("wrapscan.io", "polywrap/uri-resolver@1.0"),
... )
>>> assert isinstance(response, UriPackage)
Package: polywrap-test-cases
This package contains the utility functions to fetch the wrappers    from the wasm-test-harness repo.Functionsfunctiondescriptionget_path_to_test_wrappersGet the path to the test wrappers.fetch_fileFetch a file using HTTP.unzip_fileUnzip a file to a destination.fetch_wrappersFetch the wrappers from the wasm-test-harness repo.
Package: polywrap-uri-resolvers
This package contains URI resolvers for polywrap-client.ResolversresolverdescriptionWrapperResolverDefines a simple statically registered resolver for a wrapper.PackageResolverDefines a simple statically registered resolver for a wrap package.RedirectResolverDefines a simple resolver to redirect a URI to another URI.StaticResolverDefines a simple resolver that allows registering an Uri to redirect or resolve to wrapper or wrap package.UriResolverAggregatorDefines a resolver that aggregates a list of resolvers.RecursiveResolverDefines a resolver that recursively resolves the URI until the result is no longer a URI.ExtendableUriResolverDefines a resolver that resolves a uri to a wrapper by using extension wrappers.ResolutionResultCacheResolverDefines a resolver that caches the URI resolution result.errordescriptionUriResolutionErrorBase class for all errors related to URI resolution.InfiniteLoopErrorRaised when an infinite loop is detected while resolving a URI.UriResolverExtensionErrorBase class for all errors related to URI resolver extensions.UriResolverExtensionNotFoundErrorRaised when an extension resolver wrapper could not be found for a URI.