Saravanan666/pypi-org huggingface dataset:
Package: redreactor
Red Reactor MQTT Client for Home AutomationThis is a Red Reactor MQTT Client service that is designed to run as a background application to monitor battery status, and to publish that data to a MQTT broker.Functionality includes:Background application that continuously monitors the battery status, and will safely shutdown if requiredThe configuration file can be used to override specific topics and entitiesConnects to a MQTT broker, and publishes the service status, data and enables command topicsPublished data includes:VoltageCurrentBattery LevelExternal Power StatusCPU TemperatureCPU StatusBattery Warning ThresholdBattery Voltage Minimum and MaximumReport IntervalCommands:Immediate ShutdownImmediate RestartChange the Battery Warning ThresholdChange the Battery Voltage Minimum and MaximumChange the Report IntervalProvidessystemdservice example, so it can be started as a service on system bootIf you haven't already got yourself a Red Reactor (An uninterruptible battery powered backup for your Raspberry Pi), one can be purchased from therewebsite.Home AssistantConnecting your Home Assistant instance to the same MQTT Broker as your Red Reactor will allow your Red Reactor to be auto discovered by your Home Assistant instance. It will give you access to all the readings available from the Red Reactor sensors, and allows full configuration of the Red Reactor on the fly - it even adds the ability to reboot and shutdown your device at the push of a button.There is also aHome Assistant Add-onavailable for Supervisor users.MQTTStateTopicredreactor/your-configured-hostname/state{"voltage":4.164,"current":2.1799,"battery_level":100,"external_power":"ON","cpu_temperature":49.1,"cpu_stat":0,"battery_warning_threshold":10,"battery_voltage_minimum":2.6,"battery_voltage_maximum":4.2,"report_interval":30}State Descriptionvoltageis the Voltage of the connected batteriescurrentis the Current draw from the batteriesbattery_levelis the percentage value of charge left in the batteriesexternal_poweris whether the batteries are connected to an external power source or notcpu_temperatureread viacat /sys/class/thermal/thermal_zone0/tempgets the CPU Temperaturecpu_statread viacat /sys/devices/platform/soc/soc:firmware/get_throttledgets the CPU Statbattery_warning_thresholdis a percentage value below 100% that once crossed will initiate a safe shutdown of the devicebattery_voltage_minimumis the voltage at which is to be considered the lowest allowable before initiating a safe shutdownbattery_voltage_maximumis the voltage at which is to be considered the maximum at which the battery can be (this is used in the calculation of thebattery_level)report_intervalis the reporting interval at which the data will be published onto thestatetopicStatusTopicredreactor/hostname/statusDataonlineorofflineCommandTopicredreactor/your-configured-hostname/set/chosen-commandCommand topic | value:battery_warning_threshold| value (int)battery_voltage_minimum| value (float)battery_voltage_maximum| value (float)report_interval| value (int)restart| no value requiredshutdown| no value requiredIf there are more features that you would like to see supported, let me know!
Package: redrover
UNDER DEVELOPMENT - RedRover is not ready for production use and is
made available for the curious only.RedRover is a testing utility suite for Django.  It wraps other powerful
tools such as Nose and Selinium into an easy to use and read syntax.At its core, RedRover borrows from other python projects and provides
an interface with custom syntax sugar inspired by the RSpec and Capybara
projects that are used widely with Ruby on Rails.copyright:2012 by Dustin Farrislicense:BSD, see LICENSE for more details.
Package: redrover-api
Access Red Rover data via this REST API for Organizations that have granted you access.    # Authentication  The API is protected by HTTP Basic Authentication.   Each application that connects to the API has a unique username and password that it must supply with every request.    This value needs to be supplied as an HTTP Header: &#x60;Authorization&#x3D;BASIC [hash]&#x60;. The value of [hash] is the string username:password base64 encoded.    Endpoints marked for Basic Auth can be used with the Basic Auth username and password that you have been assigned.    # API Information  ## Api Key  Each Red Rover organization that has authorized your application has a unique API Key for your application.  To retrieve the API Key, you can use the Organization endpoint (&#x60;api/v1/organization&#x60;) which returns an ApiKey uniquely used for each Organization.    You must supply this as an HTTP Header when accessing that organization: &#x60;apiKey&#x3D;[apiKey]&#x60;. The domains that require this &#x60;ApiKey&#x60; header are labeled as 'Requires an ApiKey'.    ## Identifier  Where an &#x60;Identifier&#x60; can be specified in the route, you may either supply the Red Rover Id of the object (numeric) or the External Id (alpha-numeric). When specifying an External Id, you will need to prepend the External Id with the pike character&#x60;|&#x60; (e.g. &#x60;|ABC123&#x60;).  # noqa: E501
Package: reds
redsRequest/Response library on top of Redis.Simple Client/Server exampleClient:fromredisimportStrictRedisfromredsimportRedsdefmain():key='test:queue'redis=StrictRedis()reds=Reds(redis=redis,key=key)foriinrange(10):task=reds.create_task(task_dict={'id':i})print(task.send())if__name__=='__main__':main()Server:importtimefromrandomimportrandomfromredisimportStrictRedisfromredsimportRedsdefmain():key='test:queue'redis=StrictRedis()reds=Reds(redis=redis,key=key)fortaskinreds.listen():print(task)time.sleep(1)task.respond(task_dict={'success':random()>0.5})if__name__=='__main__':main()
Package: redscale
RedScale is set of tools for managing OpenStack clouds.InstallationTo install redscale on your system, run the following command:sudo pip install redscaleRedScale Tools### CID (Can I deploy?)cid will let you know if you have enough resources to deploy on your cloud.You can use it by speciying how many resources you plan to use:cid --memory 4 --cpu 2Or by specifying the flavor and amount of nodes you’ll deploy:cid --flavor m1.large --amount 3Add a new tool### RequirementsMust have a parser. This parser should be part of the class attributesMust be described here in the readme or any other type of doc inside this repositoryHow to contribute?Using pull requests :)
If you are adding a new app, make sure it answers all the requirements listed above.
Package: redscope
RedscopeA schema introspection tool for aws RedshiftRedscope is used to read the raw SQL DDL from your redshift database and save
the results to.sqlfiles in an easy-to-use project tree.Why use Redscope?Keeping track of the database schema is annoying. If DDL files are kept under version control, and a database migration tool
is used as part of your CI, there is a chance that the table definition can be out of date as it changes over time. This tool allows
the current state of the database schema to be read from redshift, and put under version control so changes can be tracked over time.getting startedpipinstallredscopeCreate a redscope projectredscopeinitpopulate the redshift/redscope/.redscope fileThis file is used to tellredscopehow to connect to redshift. In order to easily support using existing.envfiles in your projects,
it is necessary to tellredscopethe name of your environment file, as well as the name of the
environment variable which contains a standardpsycopg2connection string.[env]file=name_of_env_file.env[redshift]connection=ENV_VARIABLE_WITH_PSYCOPG2_CONNECTION_STRINGIntrospect the database schemarescopeinspectRedscope APISTILL UNDER DEVELOPMENTFor whatever reason, sometimes it is nice to be able to reference SQL ddl directly from your python code.
This can be accomplished using theredscopeapi.frompathlibimportPathfromdotenvimportload_dotenvfromredscope.apiimportRedshiftSchemaload_dotenv('my-env-file.env')redshift_schema=RedshiftSchema('MY_DB_CONNECTION_NAME')# sales_report_table now is a Table DDL objectsales_report_table=redshift_schema.schema('sales').table('report').fetch()# will print full table ddl including constraints, encoding, and defaultsprint(sales_report_table.ddl())# will print simple ddl with just columns and data typesprint(sales_report_table.simple_ddl())# Accessing a function definitionfunc_foo=redshift_schema.schema('my_funcs').function('foo').fetch()# func foo is a Function DDL objectprint(func_foo.ddl())# getting all objects in a schemareporting_views=redshift_schema.schema('reporting').views().fetch()forname,ddlinreporting_views.items():print(f"the key is the schema qualified view name.{name}")print(f"the value is the SQL ddl string.{ddl}")# Files can also be savedroot_path=Path.cwd()tables=redshift_schema.schema('sales').tables().fetch()"""root_pathschemasalestablesschema.table.sql -- one file per table"""fortableintables:table.save_file(root_path)
Package: redsem
redsemFuncionalidades para convertir datos tabulares en redes semánticasDocumentaciónPor el momento la documentación se encuentra en estesitioInstalaciónpipinstallredsemUsoPrepación de datosimportredsemimportpandasaspdimportnetworkxasnxdatos=pd.read_csv('datos.csv')df=redsem.filtrar_primeras_posiciones(datos,ultima_posicion=3)red=nx.from_pandas_edgelist(datos,source='estimulo',target='palabra_limpia',edge_attr=['frecuencia_total','parte_del_habla'])Primero se señala las particiones en estímulos y palabras respuestas.mapeo_bipartita={nodo:'estimulo'ifnodo.endswith('_semilla')else'respuesta'fornodoinred.nodes()}nx.set_node_attributes(red,mapeo_bipartita,'bipartita')Ahora se establece los atributos.columnas_atributos=('frecuencia_total','estimulo','frecuencia_palabra_estimulo')df_atributos=datos.set_index('palabra_limpia')[columnas_atributos]atributos_dic={}forcolindf_atributos.columns:atributos_nodos=df_atributos[col].to_dict()atributos_dic[col]=atributos_nodosnx.set_node_attributes(grafo,atributos_nodos,col)Análisis de redesimportredsemcovid=redsem.proyectar_red_por_estimulos(red,'covid_semilla')nx.export('covid.gexf',covid)covid_dieta=redsem.proyectar_red_por_estimulos(red,'covid_semilla','dieta_semilla')nx.export('covid_dieta.gexf',covid_dieta)
Package: redsession
IntroductionThis async library provides the ability to quickly integrate server sessions into
your application through the use of middleware. The library is compatible with python 3.8+.NoteThis library is designed for such frameworks as:FastAPI and Starlette.Dependencies used support redis version 5.0+InstallationYou can install or update starlette-middleware$pipinstallredsession--upgradeDocumentationYou can find more information on usagehere.
Package: redset
You may not need heavyweights like Celery or RQ. Maintaing an AMQP server
might be overkill. There’s a simpler, easier way to distribute work.Redset provides simple, generic sorted sets backed by Redis that can be used to
coordinate distributed systems and parcel out work. Unlike more common
distribution libraries like Celery or RQ, redset avoids duplicate work for
certain use-cases by maintaining a set of tasks instead of a list or queue.
And it does so with a dead-simple interface that feels natural for Python.Redset is currently used in the wild to do things likemaintain a high-throughput work queue of streaming updates to be processedpower a multi-producer, multi-consumer scraping architecture that won’t do
the same work twicemaintain a simple, cross-process set of “seen” items that each have a
TTLschedule non-duplicate, periodic polling of analytics on social servicesFeaturesNo worker daemons to run, no heavy AMQP service to monitorSafe for multiple producers and consumersSeamless, simple use with Python objects using serializersZero dependencies: you provide an object that implements theredis.client.Redisinterface, we don’t ask any questions.Simple, easy-to-read implementationMimics Python’s nativesetinterfaceBattle-testedPython 3 compatibleSimple exampleimportjsonimportredisfromredsetimportTimeSortedSetr=redis.Redis()ss=TimeSortedSet(r,'important_json_biz',serializer=json)ss.add({'foo':'bar1'})ss.add({'foo':'bar2'})ss.add({'foo':'bar3'})ss.add({'foo':'bar3'})len(ss)# 3# ...some other process Ass.peek()# {'foo': 'bar1'}ss.pop()# {'foo': 'bar1'}# ...meanwhile in process B (at exactly same time as A's pop)ss.take(2)# [{'foo': 'bar2'}, {'foo': 'bar3'}]DocsHereAboutThis software was developed atPercolate,
where we use it for all sorts of things that involve maintaining
synchronized sets of things across process boundaries. A common use-case
is to use redset for coordinating time-sensitive tasks where duplicate
requests may be generated.Redset is unopinionated about how consumers look or behave. Want to have
a plain ‘ol Python consumer managed by supervisor? Fine. Want to be able
to pop off items from within a celery job? Great. Redset has no say in
where or how it is used: mechanism, not policy.Usage conceptsredset.SortedSetand its subclasses can be instantiated with a few
paramters that are notable.Specifying a serializerSince Redis only stores primitive numbers and strings, handling
serialization and deserialization is a key part of making redset set
usage simple in Python.Aserializerinstance can be passed (which adheres to theredset.interfaces.Serializerinterface, though it need not subclass
it) to automatically handle packing and unpacking items managed with
redset.Specifying a scorerA callable that specifies how to generate a score for items being added
can also be passed to SortedSet’s constructor asscorer. This
callable takes one argument, which is the itemobject(i.e. the item
before serialization) to be “scored.”Related projectsredis-pyceleryRQ
Package: redshift-auto-schema
Redshift Auto SchemaRedshift Auto Schema is a Python library that takes a delimited flat file or parquet file as input, parses it, and provides a variety of functions that allow for the creation and validation of tables within Amazon Redshift. For each field, the appropriate Redshift data type is inferred from the contents of the file.InstallationUse the package managerpipto install Redshift Auto Schema.pipinstallredshift-auto-schemaUsagefromredshift_auto_schemaimportRedshiftAutoSchemaimportpsycopg2aspgredshift_conn=pg.connect()new_table=RedshiftAutoSchema(file='sample_file.parquet',schema='test_schema',table='test_table',conn=redshift_conn)ifnotnew_table.check_table_existence():ddl=new_table.generate_table_ddl()withredshift_connasconn:withconn.cursor()ascur:cur.execute(ddl)MethodsNAMEDESCRIPTIONget_column_listReturns column list based on header of file.check_schema_existenceChecks Redshift for the existence of a schema.check_table_existenceChecks Redshift for the existence of a table.generate_schema_ddlReturns a SQL statement that creates a Redshift schema.generate_schema_permissionsReturns a SQL statement that grants schema usage to the default group.generate_table_ddlReturns a SQL statement that creates a Redshift table.generate_column_ddlReturns SQL statement(s) that adds missing column(s) a Redshift table.generate_table_permissionsReturns a SQL statement that grants table read access to the default group.evaluate_table_ddl_diffsReturns a dataframe containing differences between generated and existing table DDL.ContributingPull requests are welcome.LicenseApache License 2.0
Package: redshift-connection-provider
Redshift Connection ProviderAn opinionated class to retrieve a Redshift connection object compatible withpsycopg2.Installpipinstallredshift-connection-providerUsage# Importimportosimportpsycopg2fromredshift_connection.providerimportRSConnectionProvider# Initialize Classrs_conn=RSConnectionProvider(cluster_id=CLUSTER_ID)# Or via ENV Variableos.environ["CLUSTER_ID"]=CLUSTER_IDrs_conn=RSConnectionProvider()# Create connection dictconn_object=rs_conn.get_conn()# Pass it to psycopg2 to create a connectionconn=psycopg2.connect(**conn_object)Connection Parameters:Database User: Can be set via parameter upon class init, as an environment variable (DB_USER), stored as a secret in AWS Secret Manager (specify secret name as environment variableDB_USER_SECRET_NAME); if none is set master user will be used.Database Name: Can be set via parameter upon class init or as an environment variable (DB_NAME).Database Password: Can be set as an environment variable (DB_PASS), stored as a secret in AWS Secret Manager (specify secret name as environment variableDB_PASS_SECRET_NAME); if none is set, a temporary password is acquired using AWS APIs. The temporary password will be scoped to the user specified (which can be auto-created) and to the database passed (if any).Database Host: Acquired automatically via AWS APIs using providedCLUSTER_ID.Database Port: Acquired automatically via AWS APIs using providedCLUSTER_ID.LicenseMITContributing & DevelopingPRs are welcome as long as documented, accompained by passing unit tests and in scope with the project.To setup the development environment run:pipenvinstall--devor manually install all the development dependencies found in thePipfile.
Package: redshift-console
# Redshift Console_Redshift Console_'s goal is to be the tool to monitor and manage a Redshift cluster. The first release has basic tools to monitor running queries, WLM queue and your tables/schemas.After over a year of managing our Redshift cluster with a collection of scripts and queries, we decided to bundle this into a more user friendly tool that can be used by a wider audience. This project also aims to uncover all the useful information hidden in [Redshift's Developer Guide](http://docs.aws.amazon.com/redshift/latest/dg/) (such as the [table design status](http://docs.aws.amazon.com/redshift/latest/dg/c_analyzing-table-design.html) query).![Screenshots](https://dl.dropboxusercontent.com/u/2186704/rdc_screenshots.gif)### Features* Inflight queries view with option to cancel any query and view related alerts (when available; from [STL_ALERT_EVENT_LOG](http://docs.aws.amazon.com/redshift/latest/dg/r_STL_ALERT_EVENT_LOG.html)).* WLM queue view.* Schemas view with additional information for each table including: total size (rows/MB), unsorted area size, is the table properly distributed and more.* Load errors (aggregated view) from the past 24h, based on [STL_LOAD_ERRORS](http://docs.aws.amazon.com/redshift/latest/dg/r_STL_LOAD_ERRORS.html)### RoadmapThis project is safe for usage, but still in its early stage (version 0.1). Future versions will include:* Loads - Progress of current operations and history of recent ones.* Vacuum status.* SNS/CloudWatch integration to show metrics and events from AWS' console.* Proactive notifications re. important events in the system: long running queries, problems, changes to the schema, dangerous levels of unsorted areas and more.We are always happy to receive feedback and suggestions, especially if they are accompanied by a pull request.## UsageYou can either use the PyPI package or the docker image.#### PyPI1. The easiest way to install the project is from pypi:```bash$ pip install redshift-console```2. Settings are set from environment variables. The main setting to set is the connection string to your Redshift cluster: (make sure the user has sufficient permissions)```bash$ export REDSHIFT_CONNECTION_STRING='user= password= host= port= dbname='```3. Start the server:```bash$ redshift-console runserverStarting server on port 5000 (debug mode: False).```#### Docker```bash$ docker run -e REDSHIFT_CONNECTION_STRING="user= password= host= port=5439 dbname=" -p 5000:5000 everythingme/redshift-consoleStarting server on port 5000 (debug mode: False).```## Authors[Arik Fraimovich](http://github.com/arikfr) and [Oren Itamar](http://github.com/orenitamar).
Package: redshifting
# RedshfitingUse this package to shift radio sources (AGN, Clusters, …) from a given redshift to a higher redshift. This can all be done in image plane, by giving a fits image as input.Example to move the Perseus cluster from redshift 0.018 to 1.318:` from redshifting import move_source myfits = 'Perseus_HBA_full.fits' move_source(input_fits=myfits, orig_z=0.018, dz=1.3,output_fits='shifted_'+myfits)`This package is also on pypi:https://pypi.org/project/redshifting/0.1.0/
Package: redshiftquery
Amazon Connect ToolsThese tools are intended to be used to connect and queryoneredshift instance andonedatabase.Requirements:This package is dependant uponkeyringfor keeping credentials secure for connecting to your desired Redshift instance.Instructions:Installation:pip install redshiftquerySetup:Next you will need to setup thekeyringLogin information unique to your redshift database.You will need to store a 'Host', 'Database', 'Username', and 'Password' by running the following in python once:importkeyringkeyring.set_password('Redshift','Host','[Your Host Server]')keyring.set_password('Redshift','Database','[Your Database]')keyring.set_password('Redshift','Username','[Your Username]')keyring.set_password('Redshift','Password','[Your Password]')note that the strings used here are case sensitiveCopy this exactly but replace [Your Host Server], [Your Database], [Your Username], and [Your Password] with your actual login credentials. This will be stored in your OS.You can check that it was set up properly by executing keyring's get_password function, for example to check your Username was set up correctly:keyring.get_password('RedShift','Username')Usage:Quick and Dirty QueryingThe main usage of this tool is to quickly get a dataframe from a query writtin in a SQL file. However sometimes queries are short and files may be overkill in these cases the use ofexquery()is an easy way to see and get results. I typically use this when checking something from terminal.Start by importing:pyQuery ModuleFor querying redshift from SQL files in order to retrieve data frames there are a few functions that can be used.In this example you can see df will be a dataframe holding the contents of mysqlscript.sql which is a file stored in the same working directory of where you are executing your code by using thequeryredshift() functionfromredshiftqueryimportquerydf=query.queryredshift('mysqlscript.sql')Additional functionality allows for SQl to be written dynamically and for us to use python to execute the same sql files but by specifying differen values for wildcards coded into a sql file.Wildcards are expected to be inclused in brackets {}Suppose now we have the following in our mysqlscript:Select*fromtable1wherecol1={foo1}andcol2={foo2}We can execute this from python by specifying a value forfoo1andfoo2by creating a dictionary with the variables we want replaced and the values we want them replaced by.fromredshiftqueryimportquerymydict={'foo1':4,'foo2':'USA'}df=query.querywithwhere('mysqlscript.sql',mydict)This will replace the bracketed values in mysqlscript.sql and ultimately will execute:Select*fromtable1wherecol1=4andcol2='USA'You can use dates. I recommend using the datetime module and passing a string.importdatetimefromredshiftqueryimportquerymydate=dateime.date(2021,10,1).strftime('%m/%d/%Y')mydict={'foo1':4,'foo2':mydate}df=query.querywithwhere('mysqlscript.sql',mydict)ExampleThe real power of this tool is the ability to paramaterize and run mulitple queries.