Saravanan666/pypi-org huggingface dataset:
Package: red2df
This package will help you to create Pandas dataframe with your Redshift data with just 2 lines of Python codes.How to useInstall this package with pip CLI.$pipinstallred2dfMake Redshift db cursor with your Redshift information.fromred2dfimportRedshiftToDfDATABASE="your DB name"USER="your user name"PASSWORD="your password"HOST="your Redshift endpoint url"#PORT = your port number in integer. Default is 5439#create an instancecur=RedshiftToDf(DATABASE,USER,PASSWORD,HOST)Run SQL queries and print dataframe.df=cur.create_df("your query")print(df)"""example of result:+----+-----------------------+|    | user_data__platform   ||----+-----------------------||  0 | ANDROID_APP           ||  1 | ANDROID_APP           |+----+-----------------------+"""You also can save the result of query in csv. Please givesave_csv=Trueoption when you callcreate_df().The parameters ofcreate_df():sql[str] : SQL query you want to runsave_csv[bool] : Save the result of the given query in csv if True. Default is Falsefile_path[str] : Path of csv file. Default is './df.csv'.If you want to close your connection, please callclose_connection()cur.close_connection()Please feel free to email me if there is any problem -hyunie@tumblbug.com
Package: reda
REDA - Reproducible Electrical Data AnalysisLatest release: 0.1.7 (27. Feb. 2024)Seereleases pagefor a
complete list of releases. Releases are also published toPypi.REDA is a scientific Python library for reproducible geoelectrical data
analysis. It aims to provide a unified interface for common and advanced data
processing steps while bridging the gap between a multitude of geoelectric
measurement devices and inversion codes used across the geophysical community.
It offers functionality to import, analyze, process, visualize, and export
geoelectrical data with particular emphasis on time-lapse functionality and
reproducibility. The latter is realized in the form of a logging system, which
keeps track of each individual processing step applied to particular data set
in a human-readable journal. REDA is platform compatible, tested and
open-source under the permissive MIT license. Any contributions from the
community are highly welcome.REDA is a work-in-progress. Please contact us if you wish to use it or miss a
specific functionality. Please see thestatus pagefor more
information.In which scenarios is reda useful?Import data from a device-specific file formatExample::import reda
ert = reda.ERT()
ert.import_syscal_bin('data_from_a_syscal_device.bin')
print(ert.data[['a', 'b', 'm', 'n', 'r']])See the!status
pagefor
supported device/software file formats.InstallationInstall latest release from PyPI (https://pypi.org/project/reda/):pip install redaInstall current development version from git:pip install git+https://github.com/geophysics-ubonn/redaFor more information, refer to the!installation
pageof the
documentation.DocumentationAn online version of the docs can be found here:https://geophysics-ubonn.github.io/redaContributingWe look forward to any type of contributions:code contributionexample contributionsdocumentation helpissuing bug reportsIf in doubt, use the Gitter chat to contact us (click the Gitter badge above to
join the chat).
Package: redactdump
Easily create database dumps with support for redacting data (And replacing that data with valid random values).Supported databasesMySQLPostgreSQLMore coming soon...InstallationTo install redactdump, run the following command:pipinstallredactdumpUsageusage:redactdump[-h]-cCONFIG

redactdump

optionalarguments:-h,--helpshowthishelpmessageandexit-cCONFIG,--configCONFIGPathtodumpconfiguration.-uUSER,--userUSERConnectionusername.-pPASSWORD,--passwordPASSWORDConnectionpassword.-dDEBUG,--debugDEBUGEnabledebugmode.ConfigurationTo create a dump you currently must use a configuration file, however in the future you might be able to do it all via CLI.Supported replacement values.redactdump uses faker to generate random data.replacementcan therefore be any function from the following providers:https://faker.readthedocs.io/en/stable/providers.htmlNOTE: redactdump is currently NOT tested with all providers, some might trigger bugsExample configuration:connection:type:pgsqlhost:127.0.0.1port:5432database:postgresredact:patterns:column:-pattern:'^[a-zA-Z]+_name'replacement:namedata:-pattern:'192.168.0.1'replacement:ipv4-pattern:'JohnDoe'replacement:nameoutput:type:multi_filenaming:'dump-[table_name]-[timestamp]'# Default: [table_name]-[timestamp]location:'./output/'Configuration SchemaThe configuration schema can be foundhereExampleConfigurationconnection:type:pgsqlhost:127.0.0.1port:5432database:postgresredact:patterns:column:-pattern:'^new_'replacement:namedata:-pattern:'6'replacement:random_intoutput:type:multi_filenaming:'dump-[table_name]-[timestamp]'# Default: [table_name]-[timestamp]location:'./output/'Original data(column_1, new_column)6,"""John Doe"""
6,"John Doe"
6,"John Doe"
6,John Doe
1,\John Doe
1,--John Doe
12312, John Doe
99,!John Doe
99,(John Doe)OutputINSERTINTOtable_nameVALUES(890,'Yolanda Mcdonald');INSERTINTOtable_nameVALUES(1982,'Stephen Lewis');INSERTINTOtable_nameVALUES(2952,'Janet Woodward');INSERTINTOtable_nameVALUES(9307,'Joshua Price');INSERTINTOtable_nameVALUES(1,'Tina Morrison');INSERTINTOtable_nameVALUES(1,'Juan Mejia');INSERTINTOtable_nameVALUES(12312,'Michael Thornton');INSERTINTOtable_nameVALUES(99,'Adrian White');INSERTINTOtable_nameVALUES(99,'Robin Jefferson');Known limitationsData types not supportedboxbyteainetintervalcirclecidrlinelsegmacaddrmacaddr8pg_lsnpg_snapshotpointpolygontsquerytsvectortxid_snapshot
Package: redacted-py
redacted-pyRedacting classified documentsThis repository holds the code base for myredacted-pylibrary in Python.It is mainly based off myFeistel cipher for Format-Preserving Encryptionto which I added a few tools to handle document, database and file manipulation to ease out the operation.MotivationIn some fields (like healthcare for instance), protecting the privacy of data whilst being able to conduct in-depth studies is both vital and mandatory. Redacting documents and databases is therefore the obligatory passage.
Withredacted-py, I provide a simple yet secure tool to help redacting documents based on either a dictionary, a record layout or a tag to decide which parts should actually be redacted.UsageYou can use either a dictionary or a tag (or both) to identify the words you want to redact in a document.
The tag should be placed before any word that should be redacted. The default tag is the tilde character (~).For example, the following sentence will only see the wordtaggedredacted:"This is a ~tagged sentence".$pipinstallredacted-pyfromredactedimportDefaultRedactor,DictionaryfromfeistelimportFPECipher,SHA_256source="Some text ~tagged or using words in a dictionary"cipher=FPECipher(SHA_256,key,10)redactor=DefaultRedactor(cipher)redacted=redactor.redact(source)expanded=redactor.expand(redacted)assertexpanded==source,"Original data should equal ciphered then deciphered data"cleansed=redactor.clean(expanded)assertcleansed=="Some text tagged or using words in a dictionary","Cleaning should remove any tag mark"You may also use it in the console with the following command line instructions:usage: python3 -m redacted [-h] [-b | --both | --no-both] [-d DICTIONARY] [-H HASH] [-i INPUT] [-k KEY] [-o OUTPUT] [-r ROUNDS] [-t TAG] [-x | --expand | --no-expand]

options:
  -h, --help            show this help message and exit
  -b, --both, --no-both
                        Add to use both dictionary and tag
  -d DICTIONARY, --dictionary DICTIONARY
                        The optional path to the dictionary of words to redact
  -H HASH, --hash HASH  The hash engine for the round function [default sha-256]
  -i INPUT, --input INPUT
                        The path to the document to be redacted
  -k KEY, --key KEY     The optional key for the FPE scheme (leave it empty to use default)
  -o OUTPUT, --output OUTPUT
                        The name of the output file
  -r ROUNDS, --rounds ROUNDS
                        The number of rounds for the Feistel cipher [default 10]
  -t TAG, --tag TAG     The optional tag that prefixes words to redact [default ~]
  -x, --expand, --no-expand
                        Add to expand a redacted documentTests$gitclonehttps://github.com/cyrildever/redacted.git$cdredacted/py/$pipinstall-e.$python3-munittestdiscoverLicenseThe use of theredactedlibraries and executables are subject to fees for commercial purpose and to the respect of theBSD-2-Clause-Patent license.Pleasecontact meto get further information.NB: It is still under development so use in production at your own risk for now.© 2024 Cyril Dever. All rights reserved.
Package: redacty
redactyThis is a CLI tool and Python API that redacts emails from bodies of text in a PostgreSQL database, with optional flags for an excluded domain and an older than x days filter.Github repository:https://github.com/wet-bulb/redacty/InstallationInstallredactywith pippipinstallredactyUsage/ExamplesCommand-Line Interface (CLI)redacty<database_url><table><column>[-aAGE][-xEXCLUDE]database_url: PostgreSQL database URL.table: Name of the table that holds the column to redact.column: Name of the column that holds the text to redact.Optional arguments:-a AGE, --age AGE: Minimum age of records to be anonymized in days. Default is 0 days old.-x EXCLUDE, --exclude EXCLUDE: Email domain to exclude from anonymization.Programatic Use in PythonHere's an example:fromredactyimportanonymize_records# Connect to the PostgreSQL databaseconn=psycopg2.connect(database_url)# Anonymize email addresses in the specified table and column, set minimum age, and no excluded domainsanonymize_records(conn,table,column,30," ")# Close the database connectionconn.close()Repository initiated withfpgmaas/cookiecutter-poetry.
Package: red-alien
The Red Alien Pokémon Script CompilerThis is the source repository forRed Alien, a
compiler for the scripting system found in GBA Pokémon games.See thedocumentationandexamplesfor an overview of its
features.RunningRed Alien is built using cross-platform technologies, so it should run
everywhere. I buildwindows binariesevery now and then.
Arch users can install itsAURpackage.
There is averyold build for Mac OSX which I don't recommend using;
run it from source instead. Same on other linux distributions or
operating systems.Red alien is written in python and can be run directly from the
source files if you have all the dependencies installed:DependencyArch packageDebian/Ubuntu packagePython 3pythonpython3PyQt 5python-pyqt5python3-pyqt5(depends onpython3)Python bindings for Qscintillapython-qscintilla-qt5python3-pyqt5.qsci(depends onpython3-pyqt5)It can be installed system-wide (although it's not needed):# ./setup.py installYou can run asc-cli for CLI or asc-qt for the GUI.If you want pks syntax highlighting in vim, you can copy utils/pks.vim to
$HOME/.vim/syntax/, and add the following line to your .vimrc:
autocmd BufRead,BufNewFile *.pks set filetype=pksAcknowledgementsMost of the command's information was taken from PKSV's pokedef.h (Thanks!)The headers in stdlib/ are taken from XSE.
Package: redantic
redanticSimple redis storage for pydantic objects with an interface of the MutableMapping.ExamplesfromredanticimportRedisDictfrompydanticimportBaseModelfromredisimportRedisclassCar(BaseModel):price:floatmodel:strCarId=intclient=Redis()d=RedisDict[CarId,Car](client=client,name='car_collection',key_type=CarId,value_type=Car)d[1]=Car(price=100.5,model='a')d[2]=Car(price=200,model='b')print(len(d))foriind:print(d[i])You can also use pydantic object as a key.classCarId(BaseModel):id:inttype:strd[CarId(id=1,type='some_type')]=Car(price=100.5,model='a')
Package: redapi
redapiThis project is based off of whatapi and provides a wrapper around the AJAX API for Redacted.ch.
As of right now, it only supports API Key authentication.Example usage:>>>importredapi>>>apihandle=redapi.RedAPI(apikey='v22rdsreb.cg54vt5 3633fyru2894fg54')>>>apihandle.request("browse",searchstr="Square Up")...>>>apihandle.get_torrent()To use another tracker:>>>importredapi>>>apihandle=redapi.RedAPI(apikey='v22rdsreb.cg54vt5 3633fyru2894fg54',server='https://passtheheadphones.me')>>>apihandle.request("browse",searchstr="The Beatles")...Basic API reference available atWhat documentationand on theRedacted API Documentation.
Package: redash-client
Redash Python ClientA client for the Redash API for stmo (https://sql.telemetry.mozilla.org)Installpipinstallredash_clientUsageBefore usingRedashClient, set theREDASH_API_KEYenvironment variable to your Redash API key:export REDASH_API_KEY=<your_api_key>To import and useRedashClient:importosfromredash_client.clientimportRedashClientapi_key=os.environ["REDASH_API_KEY"]redash_client=RedashClient(api_key)# Make a Redash API call:redash_client.search_queries("AS Template:")Package for PipFirst, you must update theversionfield insetup.py.
Then run this commands:pythonsetup.pysdistbdist_wheeltwineuploaddist/*Make sure you havewheelandtwineinstalled.
Package: redash-dynamic-query
## Redash Dynamic QueryA tool for executing dynamic query of redash.## Install```pip install redash-dynamic-query```## SYNOPSIS```pythonfrom redash_dynamic_query import RedashDynamicQueryredash = RedashDynamicQuery(endpoint='http://myredash-host',apikey='secret_apikey',data_source_id=2, # Optional, default auto fillmax_age=0,  # Optional, default value is 0max_wait=60,  # Optional, default value is 60)query_id = 111bind = {'start_date': '2017-01-01T00:00:00','end_date': '2017-01-01T23:59:59',}result = redash.query(query_id, bind)print(result['query_result']['data'])# {#     'rows': [#         {'mydata': 'xxx'}#     ],#     'columns': [#         {#             'type': 'string',#             'friendly_name': 'mydata',#             'name': 'mydata'#         }#     ]# }```## CLI```% rdq``````% rdq --helpusage: rdq [-h] [-d N] [-a N] [-w N] [-k APIKEY] [-e ENDPOINT] -q QUERY_ID[-p QUERY_PARAMETERS] [-f {csv,tsv,json,redash_csv}]Process some integers.optional arguments:-h, --help            show this help message and exit-d N, --data-source-id Nan integer for the data_source_id-a N, --max-age N     an integer for the max_age-w N, --max-wait N    an integer for the max_wait(timeout)-k APIKEY, --apikey APIKEYrequired: redash apikey (can also be specified usingREDASH_APIKEY environment variable)-e ENDPOINT, --endpoint ENDPOINTrequired: redash endpoint (can also be specified usingREDASH_ENDPOINT environment variable)-q QUERY_ID, --query-id QUERY_IDrequired: redash query id-p QUERY_PARAMETERS, --query-parameters QUERY_PARAMETERSredash query parameters(eg. key1=val1,key2=val2)-f {csv,tsv,json,redash_csv}, --output-format {csv,tsv,json,redash_csv}redash output format``````# example% rdq -e http://myredash-host -k secret_apikey -q 111 -p start_date=2017-01-01T00:00:00,end_date=2017-01-01T23:59:59 -f csv```## LICENSEMIT
Package: redash-py
Copyright (c) 2019 denzowPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: UNKNOWN
Platform: UNKNOWN
Description-Content-Type: text/markdown
Package: redash-python
Redash API Python Clientpython package for interacting with the Redash APIFeaturesComplete access to all endpoints in the Redash API.Pagination by default.Duplicate dashboards.Manage users and groups.Duplicate queries with different source tables.Implemented ServicesDashboardsQueriesData SourcesAlertsUsersDestinationsGroupsquery_snippetsWidgets** widgets endpoint does not support GET requests, only update, delete and
create.Getting Startedan API key is required in addition to the instance's host URL.Installationpipinstallredash-pythonUsagefromredash_pythonimportRedashrd=Redash(base_url="",api_key="")# get all dashboardsdashboards=rd.dashboards.get_all()# get specific dashboards by iddash=rd.dashboards.get(1)# get by slug or namequery=rd.queries.get_by_name("my-dashboard")# get by tagsq=rd.queries.get_by_tags(["my-tag"])# get without tagsdash=rd.dashboards.get_by_tags(["my-tag"],without=True)# Duplicate query with a different table as sourceques=rd.queriesques.duplicate_query_table(query=ques.get(1),table_map={"old_table":"new_table"},tags=["admin","test"],publish=True,)# get a list of implemented API endpointsprint(rd.services)# get a list of implemented endpoints in a serviceprint(rd.users)for a full list of implemented methods in each service, print the service
object.>>>print(client.dashboards)DashboardsService(attributes:['endpoint'],methods:['create','create_widget','delete','duplicate','exists','favorite','favorited','get','get_all','get_by_name','get_by_tags','get_id','get_slug','paginate','publish','refresh','share','unfavorite','unpublish','update'])for more examples on usage, see examples folder on github.Developmentbefore starting development, install dev dependencies:pipinstallredash-python[dev]Architecturethis library implements a services based architecture splitting each API
endpoint group to its own service, on top of which is theRedashclass. all
the services share base classes from mixins that make it easier to share common
behavior and allows rapid development for any new endpoints. for instance adding
query_snippets is as simple as:from.baseimportBaseServicefrom.mixinsimportCommonMixin,NameMixin,PrintMixinclassQSnipsService(CommonMixin,NameMixin,PrintMixin):def__init__(self,base:BaseService)->None:# init mixinsCommonMixin.__init__(self,base)self.__base=baseself.endpoint="/api/query_snippets"Directory Structureredash_python
├──__init__.py
├──redash.py# Services wrapper└──services# implemented services├──base.py# Base service class└──mixins.py# Mixins for services with shared functionalityContributingContributions are welcome, please open an issue or PR to propose any changes.License
Package: redash-python-modification
Redash API Python Clientpython package for interacting with the Redash APIFeaturesComplete access to all endpoints in the Redash APIPagination by defaultDuplicate dashboardsManage users and groupsDuplicate queries with differerent source tablesImplemented ServicesDashboardsQueriesData SourcesAlertsUsersDestinationsGroupsquery_snippetsWidgets** widgets endpoint does not support GET requests, only update, delete and
create.Getting Startedan API key is required in addition to the instance's host URL.Installationpipinstallredash-python-modificationUsagefromredash_python_modificationimportRedashrd=Redash(base_url="",api_key="")# get all dashboardsdashboards=rd.dashboards.get_all()# get specific dashboards by iddash=rd.dashboards.get(1)# get by slug or namequery=rd.queries.get_by_name("my-dashboard")# get by tagsq=rd.queries.get_by_tags(["my-tag"])# get without tagsdash=rd.dashboards.get_by_tags(["my-tag"],without=True)# Duplicate query with a different table as sourceques=rd.queriesques.duplicate_query_table(query=ques.get(1),table_map={"old_table":"new_table"},tags=["admin","test"],publish=True,)# get a list of implemented API endpointsprint(rd.services)# get a list of implemented endpoints in a serviceprint(rd.users)for a full list of implemented methods in each service, print the service
object.>>>print(client.dashboards)DashboardsService(attributes:['endpoint'],methods:['create','create_widget','delete','duplicate','exists','favorite','favorited','get','get_all','get_by_name','get_by_tags','get_id','get_slug','paginate','publish','refresh','share','unfavorite','unpublish','update'])for more examples on usage, see examples folder on github.Developmentbefore starting development, install dev depndencies:pipinstallredash-python-modification[dev]Architecturethis library implements a services based architecture splitting each API
endpoint group to its own service, on top of which is theRedashclass. all
the services share base classes from mixins that make it easier to share common
behavior and allows rapid development for any new endpoints. for instance adding
query_snippets is as simple as:from.baseimportBaseServicefrom.mixinsimportCommonMixin,NameMixin,PrintMixinclassQSnipsService(CommonMixin,NameMixin,PrintMixin):def__init__(self,base:BaseService)->None:# init mixinsCommonMixin.__init__(self,base)self.__base=baseself.endpoint="/api/query_snippets"Directory Structureredash_python
├──__init__.py
├──redash.py# Services wrapper└──services# implemented services├──base.py# Base service class└──mixins.py# Mixins for services with shared functionalityContributingContributions are welcome, please open an issue or PR to propse any changes.License
Package: redash-query-download
redash_query_download(rqd)This package provides a unified command line interface to download results in Redash.RequirementsPython 3.xInstallation$pipinstallredash_query_downloadAnd set up your~/.rqdrc.[redash]endpoint=https://HOSTNAMEapikey=APIKEYencoding=UTF-8CommandsUsage:rqd[OPTIONS]Options:-q,--query_idINTEGER[required]-p,--parameters<TEXTTEXT>...-o,--outputTEXT[required]-c,--configTEXT--helpShowthismessageandexit.Examples# query without query parameters$rqd--query_id1-otest.csv# query without query parameters$rqd--query_id1--parametersstart_date2000-01-01--parametersend_date2009-12-31-otest.csv