Saravanan666/pypi-org huggingface dataset:
Package: react-flask
💫 React Flask (RF)Fully typed Flask and React applicationsWelcome to RF, astrongly-linkedFlask and React application template.RF combines aFlaskserver, with aReact TypeScriptUI into a comprehensive full-stack framework for building modern web applications.RF features a sophisticated types manager that automatically synchronizesPython Type hintsandTypeScript interfaces. This means that as you make changes to your API code in the server, RF diligently keeps the API Client up to date.Built on popular toolsWe use cutting edge Python tools including:Pydantic 2.0Flask 2.3And our TypeScript is modern too:Node 18.17.0React 18TypeScript 5.1Both TypeScript and Python hold their positions as two of themost widely used programming languages globally. As a result, they are frequently combined in various projects.However, setting up a smooth and efficient development environment that integrates these languages can be a cumbersome and time-consuming process, often leading to a subpar developer experience. Thankfully, RF steps in to solve this challenge by through it's sophisticated types manager.Type-safe productivity boostRF provides:A types manager which keeps the API interface type-safe.React: A collection of type-safe API hooks for querying the HTTP API.React: No single page app, so bundled JS for the client loads faster.Flask: A manager for generating new React pages without any manual effort.Flask: View-based routing to reduce the bundle size of JS on page loads.Currently in developmentBefore this becomes a fully fledged package, it exists as a decent template that can be forked when you start a new project and worked on from there.Set upFork the code, then run the build and dev command to get started:gitclonegit@github.com:beckett-software/react-flask.gitcdreact-flask
makebuild
makedev
Package: reacthass
ReactHassIntroductionFirst of all I love Python, Home Assistant and Docker, but I also
needed a way to communicate from different devices to Home Assistant
and do some twisted automations.You might need this repo for one of this reasonsInterface Home Assistant with other devicesThere might be the case where you want to run an automation outside Home AssistantIn some of my cases, was easier to build an automation from PythonYou love Python and DockerInstallpip install reacthassUsagefromreacthassimportReactortoken='YOUR TOKEN'url='HOME ASSISTANT URL'hass=Reactor(url,token)ifhass.when_value_reached('sensor','temperature',30):hass.call_service('turn_on','fan.fan')PersistenceIf you want to keep the sensor record in the database you might add to your configuration.yaml:recorder:include:entities:-sensor.testor if you have another suggestion to keep records of the state made by API let me know opening an issue.ExamplesSome examples are in the/examplesfolder,CreditsThis package is built on top of the beautifulHomeAssistantAPI
Package: reaction
Convenient DL servingPart ofCatalyst Ecosystem. Projectmanifest.InstallationCommon installation:pipinstall-UreactionGetting startedconsumer.py:importasynciofromtypingimportList,Anyfromreaction.rpcimportRabbitRPCclassrpc(RabbitRPC):URL='amqp://user:password@host'@rpc()defsync_square(*values)->List[float]:return[v**2forvinvalues]@rpc()asyncdefasync_square(*values)->List[float]:awaitasyncio.sleep(1)return[v**2forvinvalues]if__name__=='__main__':loop=asyncio.get_event_loop()loop.create_task(sync_square.consume())loop.create_task(async_square.consume())loop.run_forever()client.py:importasynciofromconsumerimportsync_square,async_squareif__name__=='__main__':loop=asyncio.get_event_loop()x=loop.run_until_complete(sync_square.call(2,3))y=loop.run_until_complete(async_square.call(4,5,6))print(x)# 4, 9print(y)# 16, 25, 36loop.close()ExampleRegister telegram bot, achieve tokencd example && TG_TOKEN="telegram bot token goes here" docker-compose up --force-recreate --buildRabbitMQ web ui:http://127.0.0.1:15672/#/user: adminpassword: j8XfG9ZDT5ZZrWTzw62qDocs (you can submit requests from web ui):http://127.0.0.1:8000/docs#/Redoc:http://127.0.0.1:8000/redocTelegram bot is ready to classify ants & bees, but you have to send files "as a photo"Telegram bot quick howtoInstall async telegram client first:$pipinstallaiotgThen create your bot:tgbot.pyfromconsumerimportasync_squarefromaiotgimportBot,Chatbot=Bot(api_token='telegram bot token goes here')@bot.command('/start')asyncdefstart(chat:Chat,match):returnchat.reply('Send me /square command with one float argument')@bot.command(r"/square (.+)")asyncdefsquare_command(chat:Chat,match):val=match.group(1)try:val=float(val)square=awaitasync_square.call(val)resp=f'Square for{val}is{square}'except:resp='Invalid number'returnchat.reply(resp)bot.run()
Package: reaction-network
Reaction Network (rxn_network) is a Python package for synthesis planning and predicting chemical reaction pathways in inorganic materials synthesis.InstallationWe recommend installing using pip:pipinstall -U reaction-networkThe package will then be installed under the namerxn_network. The Materials Project
API is not installed by default; to install it, run:pip install -U mp-api.NoteAs of version 7.0 and beyond, thereaction-networkpackage no longer usesgraph-tool. All network functionality is now implemented usingrustworkx. This means it is no longer required to complete any extra installations.TutorialsTheexamplesfolder contains two (2) demonstration notebooks:1_enumerators.ipynb: how to enumerate reactions from a set of entries; running
enumerators using jobflow2_networks.ipynb: how to build reaction networks from a list of enumerators and
entries; how to perform pathfinding to recommend balanced reaction pathways; running
reaction network analysis using jobflowCitationIf you use this code in your work, please consider citing the following paper (seeCITATION.bib):McDermott, M. J., Dwaraknath, S. S., and Persson, K. A. (2021). A graph-based network
for predicting chemical reaction pathways in solid-state materials synthesis. Nature
Communications, 12(1).https://doi.org/10.1038/s41467-021-23339-xAcknowledgementsThis work was supported as part of GENESIS: A Next Generation Synthesis Center, an
Energy Frontier Research Center funded by the U.S. Department of Energy, Office of
Science, Basic Energy Sciences under Award Number DE-SC0019212.Learn more about the GENESIS EFRC here:https://www.stonybrook.edu/genesis/
Package: reaction-system
Reaction SystemA Python package for handling Reaction Systems and RsFunctions (partially mapped result functions) with minimization capabilities.OverviewYour Package Name provides functionality for working with Reaction Systems and RsFunctions. It includes methods for minimization, mapping, support analysis, and more.FeaturesReaction System Handling:Create and analyze Reaction Systems.RsFunction Operations:Perform minimization operations on RsFunctions to convert into ReactionSystems.Installationpipinstallyour-package-nameUsageHere's a quick example of using the Reaction System package:fromreaction_systemimportReactionSystem,RsFunction# Create a Reaction Systemreaction_system=ReactionSystem(5)reaction_system.push([1,2,3],[],[4,5])# Minimize the Reaction System over rank, or degreers_rank=reaction_system.minimize_rank()rs_rank_exact=reaction_system.minimize_rank_exact()rs_degree=reaction_system.minimize_rank()# Get the reactions from a reaction systemforreactioninrs_rank.reactions():print(reaction,reaction.enabled([1,2,3,4]))# Create an RsFunctionrs_function=RsFunction(5)rs_function.add([1,2],[3,4])rs_function.add([1,3],[2,4])# Get a minimum corresponding Reaction Systemrs_rank=rs_function.minimize_rank()rs_rank_exact=rs_function.minimize_rank_exact()rs_degree=rs_function.minimize_rank()print(rs_rank)ContributingContributions are welcome! If you have suggestions, bug reports, or want to contribute code, please open an issue or submit a pull request.
Package: re-action-template
release-engineers/action-templateaction-templateruns the Jinja2 templating engine against any given files during a GitHub workflow, and makes the GitHub context available to it.Usageaction-template can be used as a GitHub Action;name: Sample Workflow

on:
  push:
    branches:
      - master

permissions:
  contents: write

jobs:
  templating:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: master
      - uses: release-engineers/action-template@v2
        with:
          source: 'README.md.template'
          target: 'README.md'
      - shell: bash
        run: |
          git config --global --add safe.directory '*'
          git config --local user.name 'github-actions[bot]'
          git config --local user.email 'github-actions[bot]@users.noreply.github.com'
          git add README.md
          if git commit --no-verify -m "docs: Regenerate README.md"; then
            # rebase and push in a retry loop
            for i in {1..5}; do
              git pull --rebase && git push && break || sleep 1
            done
          fiFeaturesGitHub ContextThe GitHub context available to workflows is also available to templates like so;{{ github.repository }}When evaluated becomes:release-engineers/action-templateLoad FilesThe example workflow under the Usage paragraph was loaded using;{{ load('.github/workflows/example.yml') }}Load JSONParse and handle JSON data from files in the working directory like so;{{ load_json('tests/data/data.json').info.from_json }}When evaluated becomes:This text is a JSON value in a file.Load YAMLParse and handle YAML data from files in the working directory like so;{{ load_yaml('tests/data/data.yml').info.from_yaml }}When evaluated becomes:This text is a YAML value in a fileLoad Markdown Table of Contents as HTMLParse and obtain a Markdown table of contents from files in the working directory like so;{{ load_markdown_toc('tests/data/data.md') }}When evaluated becomes:<div class="toc">
<ul>
<li><a href="#header-one">Header One</a><ul>
<li><a href="#header-two">Header Two</a><ul>
<li><a href="#header-three">Header Three</a></li>
<li><a href="#header-three-two">Header Three, Two</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>Load Markdown Table of Contents as dataParse and handle Markdown table of contents data from files in the working directory like so;{{ load_markdown_toc_tokens('tests/data/data.md') }}When evaluated becomes:[{'level': 1, 'id': 'header-one', 'name': 'Header One', 'children': [{'level': 2, 'id': 'header-two', 'name': 'Header Two', 'children': [{'level': 3, 'id': 'header-three', 'name': 'Header Three', 'children': []}, {'level': 3, 'id': 'header-three-two', 'name': 'Header Three, Two', 'children': []}]}]}]ContributingThis is a Python Poetry project usingFire.
SeePoetryfor more information.Development requires:BashDockerPythonPoetryLinksThis project was created usingtemplate-poetry.
Package: reaction-utils
rxnutilsUtilities to work with datasets of chemical reactions, reaction templates and template extractionPrerequisitesBefore you begin, ensure you have met the following requirements:Linux OS (or in principle Windows or macOS)You have installedanacondaorminicondawith python 3.8The tool has been developed and fully tested on a Linux platform, but it is only occassionally tested on Windows and macOS.
If you find an issue on a Windows or macOS platform, we might be able to fix, but we might just disable that feature on those platforms.InstallationFor usersSetup your python environment and then runpip install reaction-utilsConsult the documentation for further information.For developersFirst clone the repository using Git.Then execute the following commands in the root of the repositoryconda env create -f env-dev.yml
conda activate rxn-env
poetry installtherxnutilspackage is now installed in editable mode.Lastly, make sure to install pre-commits that are run on every commitpre-commit installUsageThe package is divided into (currently) three sub-packages:chem- chemistry routines like template extraction or reaction cleaningdata- routines for manipulating various reaction data sourcespipeline- routines for building and executing simple pipelines for modifying and analyzing reactionsThe full auto-generated API document is availablehere, and the documentation also provides a few examples on common tasks.DevelopmentTestingTests uses thepytestpackage, and is installed bypoetryRun the tests using:pytest -vThe full command with all flags for CI is available through aninvokecommandinvoke run-testsDocumentation generationThe documentation is generated by Sphinx from hand-written tutorials and docstringsThe HTML documentation can be generated byinvoke build-docsLintingLinting is done preferably withpylint.invoke run-lintingCurrently we do not usemypyto check type annotations, but this will be switched on in the future.ContributingWe welcome contributions, in the form of issues or pull requests.If you have a question or want to report a bug, please submit an issue.To contribute with code to the project, follow these steps:Fork this repository.Create a branch:git checkout -b <branch_name>.Make your changes and commit them:git commit -m '<commit_message>'Push to the remote branch:git pushCreate the pull request.Please useblackpackage for formatting, and followpep8style guide.Contributors@ckannas@SGenheden@anniewesterlund@CBA087@EBjerrum@A-ThakkarThe contributors have limited time for support questions, but please do not hesitate to submit an issue (see above).LicenseThe software is licensed under the Apache 2.0 license (see LICENSE file), and is free and provided as-is.ReferencesThakkar A, Kogej T, Reymond J-L, et al (2019) Datasets and their influence on the development of computer assisted synthesis planning tools in the pharmaceutical domain. Chem Sci.https://doi.org/10.1039/C9SC04944DKannas C, Thakkar A, Bjerrum E, Genheden S (2022) rxnutils – A Cheminformatics Python Library for Manipulating Chemical Reaction Data. ChemRxiv.https://doi.org/10.26434/chemrxiv-2022-wt440-v2
Package: reactivecli
ReactiveCLIReactiveCLI is a CLI framework library to build responsive console interfaces.Description:ReactiveCLI makes it painless to create interactive interfaces on console. Change values, and states of components and they will simple update in your console menu.Components-Based:Using prefab components or build your own component make things easier to recicle code and avoid repetition code process.Sumary:InstallationQuick StartDocumentationCoreComponentsInstallationInstall ReactiveCLI with pip:pipinstallreactivecliQuick StartAfter install ReactiveCLI with pip.In your project create aapp.pyfile and write a simple menu on it:#import component TitlefromreactivecliimportTitle#Create the menu callbackdefmenu():#Instantiate the Title component as menu_titlemenu_title=Title("Hello ReactiveCLI!")#Return a list with the components in desired orderreturn[menu_title]In the main file of the project create a root, pass the app menu and True[remove on final build] as arguments.Example inmain.py:fromreactivecliimportcreate_rootimportapp#Create root with the app menu and set dev mode to truecreate_root(app.menu,True)Now open the console and run your code withpython main.pycommand.This will be the expected output:TO BE WRITTENDocumentationReactiveCLI have a simple use methodology based on components.CoreReactiveCLI core methods and builderscreate_root :-Create a menu flow root from a menu callback-Usage:fromreactivecliimportcreate_rootimportappcreate_root(app.menu,True)argtypedescriptionmenu_callbackcallableCallback that returns a list with menu components.devboolIf true the files changed will be recompiled in execution time.ComponentsReactiveCLI are based on components. So to build up an application you need to know what components to use.InputText container that can be editable in execution time and saved to use the value as you wish.Usage:fromreactivecliimportInput,Textdefmenu():name_input=Input()age_input=Input("value")return[Text("Insert your name:"),name_input,Text("Insert your age:"),age_input]TO BE WRITTEN
Package: reactive-grpc
reactive-grpcA simple gRPC bridge to reactive streams.Example: Given the following Protocol buffers definition:syntax = "proto3";

package rxgrpc.test;

service TestService {
  rpc GetOneToOne(TestRequest) returns (TestResponse) {}
  rpc GetOneToStream(TestRequest) returns (stream TestResponse) {}
  rpc GetStreamToOne(stream TestRequest) returns (TestResponse) {}
  rpc GetStreamToStream(stream TestRequest) returns (stream TestResponse) {}
}

message TestRequest {
  string message = 1;
}

message TestResponse {
  string message = 1;
}and a simple Servicer class:fromtest.proto.test_pb2_grpcimportTestServiceServicerfromtest.protoimporttest_pb2class_Servicer(TestServiceServicer):defGetOneToOne(self,request:test_pb2.TestRequest,context):returntest_pb2.TestResponse(message='response:{}'.format(request.message))defGetOneToStream(self,request,context):foriinrange(3):yieldtest_pb2.TestResponse(message='response{}:{}'.format(i,request.message))defGetStreamToOne(self,request_iterator,context):returntest_pb2.TestResponse(message='response:{}'.format(', '.join(map(lambdad:d.message,request_iterator))))defGetStreamToStream(self,request_iterator,context):yield frommap(lambdad:test_pb2.TestResponse(message='response:{}'.format(d.message)),request_iterator)A simple gRPC reactive server where request messages are transformed can
be created as follows:fromtest.protoimporttest_pb2_grpc,test_pb2fromrxgrpcimportserver,mappersfromrximportoperatorsfromtest.proto.test_pb2_grpcimportTestServiceServicerclass_Servicer(TestServiceServicer):# ...passworkers=3rx_server=server.create_server(test_pb2,workers)test_pb2_grpc.add_TestServiceServicer_to_server(_Servicer(),rx_server)rx_server.add_insecure_port('[::]:50051')def_transform_message(m:test_pb2.TestRequest)->test_pb2.TestRequest:returntest_pb2.TestRequest(message='TRANSFORMED{}'.format(m.message))rx_server.set_grpc_observable(rx_server.grpc_pipe(operators.map(mappers.grpc_invocation_map(_transform_message)),method_name='/rxgrpc.test.TestService/GetOneToOne'),method_name='/rxgrpc.test.TestService/GetOneToOne')rx_server.start()Here it is an example of a filter for a streaming input:fromrxgrpcimportoperatorsfromtest.protoimporttest_pb2def_filter_message(m:test_pb2.TestRequest)->test_pb2.TestRequest:returnbool(int(m.message[-1])%2)server=...server.set_grpc_observable(server.grpc_pipe(operators.filter(_filter_message),method_name='/rxgrpc.test.TestService/GetStreamToOne'),method_name='/rxgrpc.test.TestService/GetStreamToOne')
Package: reactive-net
reactive-netPython library for managing network communicationsNetwork messages are of three types:MessageFormat:<size u16><payload>This is not used in practiceCommandMessageFormat:<code u16><size u16><payload>ResultMessageFormat:<code u8><size u16><payload>Command MessagesclassReactiveCommand(IntEnum):Connect=0x0Call=0x1RemoteOutput=0x2Load=0x3Reset=0x4RegisterEntrypoint=0x5Output=0x6# called by software modules in SGX and NativeRemoteRequest=0x7Not all the commands have a response! (ResultMessage)RemoteOutputandOutputdoes not have response.Result MessagesclassReactiveResult(IntEnum):Ok=0x0IllegalCommand=0x1IllegalPayload=0x2InternalError=0x3BadRequest=0x4CryptoError=0x5GenericError=0x6
Package: reactive-platform
Reactive Markets Platform SDK PythonThe Reactive Platform SDK for Python.Getting StartedInstallThe package only support python3.7 and python3.8, not for lower versions.Install the package in a python environment:$pipinstallreactive-platformUninstall the package:$pipuninstallreactive-platformUsing REST APIThe REST API has endpoints for various kinds of data from platform, e.g. orders, analytics and
references. This package now only supports querying reference data. To access the platform, a API
token must be granted from platform UI.Create a REST clientCreate a client first:fromreactive.platform.rest.clientimportClientapi_key='xxx'url="https://api.platform.reactivemarkets.com"rc=Client(url=url,api_key=api_key)Reference DataReference data includes asset, instrument, venue and markets. Get those data:asset_ref=rc.fetch_asset_ref()# json format assets reference dataassets=asset_ref.to_json()print("asset reference:\n",assets)# dict format assetsassets_dict=asset_ref.to_dict()print("assets dict:\n",assets)# instr referenceinstr_ref=rc.fetch_instr_ref()instrs=instr_ref.to_json()print("instrument reference:\n",instrs)# venue referencevenue_ref=rc.fetch_venue_ref()venues=venue_ref.to_json()print("venue reference:\n",venues)# market referencemarket_ref=rc.fetch_market_ref()markets=market_ref.to_json()print("market reference:\n",venues)If client uses pandas, the reference data can be viewed in a Dataframe table in jupyter-notebook:importpandasaspddf=pd.read_json(market_ref.to_json())dfPlatform WebSocket APIThe websocket feed provides real-time level 2 market data snapshots, public trades and liquidation
viawss://api.platform.reactivemarkets.com/feedWebSocket ClientTo access the platform via web socket, create a Client which manages the web socket connection
and provides methods to access the platform. See the example inexample/wsclient.py.The message protocol is Flatbuffers, which provides an efficient
serialization/deserializaton mechanism in terms of both processing and space requirements.
The flatbuffer message python API for the platform is in thereactive-papipackage.Client decodes receiving messages intoreactive.papi.Message.Messageand allow user to apply
user defineddata_handlercall back to handle the flatbuffer message.Create a FeedClientThe platform-py also provides another option,FeedClient.fromreactive.platform.feed.clientimportFeedClientapi_key='xxx'addr="wss://api.platform.reactivemarkets.com/feed"feed_client=FeedClient(addr=addr,api_key=api_key)FeedClient provides methodssubscribeandunsubscribeto control sending request to platform,
and implement python classes inreactive.platform.feedsubpackage for corresponding flatbuffer
message types. see a full example inexample/marketdata.pyorexample/trade. The client can
specify book view parameters in the request. Currently, the feed gateway supports, book
depths (1, 5, 10, 20), tick grouping (1, 50), and frequency integer (1 or a larger number).