Saravanan666/pypi-org huggingface dataset:
Package: querysource
QuerySourceQuerySource is a powerful Python library designed to streamline access to multiple databases and external APIs through a single, unified interface. Utilizing the proxy design pattern, QuerySource allows developers to seamlessly integrate various data sources into their projects without worrying about the complexities of managing multiple connections.FeaturesUnified interface for querying multiple databases (Redis, PostgreSQL, MySQL, Oracle, SQL Server, InfluxDB, CouchDB, Druid)Support for external APIs (Salesforce, ShopperTrack, ZipCodeAPI, etc.)Easy-to-use API for executing queriesExtensible design, allowing for easy addition of new data sourcesInstallation$pipinstallquerysource---> 100%Successfully installed querysourceRequirementsPython >= 3.9asyncio (https://pypi.python.org/pypi/asyncio/)Basic UsageQuerySource can be used in several ways, one is using QS object itself:fromquerysource.queries.qsimportQSquery=QS(query='SELECT * FROM tests',output_format='pandas')result,error=awaitquery.query()Extending QuerySourceTo add support for a new data source, create a new class inheriting from the BaseProvider or BaseAPI class and implement the required methods (prepare_connection, query, close). Then, register the new data source in the QuerySource class by adding it to the appropriate dictionary (_supported_databases or _supported_apis).ContributingWe welcome contributions to QuerySource! If you'd like to contribute, please follow these steps:Fork the repositoryCreate a new branch for your feature or bugfixImplement your changesAdd tests covering your changesCreate a pull request against the original repositoryContribution guidelinesWriting testsCode reviewOther guidelinesLicenseQuerySource is released under the BSD License. See the LICENSE file for more details.
Package: querystar
👋 Hi there, this isQueryStarPython-First Solution to Develop BotsQueryStar lets you easily set up triggers and actions to automate workflows.Something likeSaving Slack new messages that must contain 'hello' to a Google sheetcan be easily done:# bot.pyimportquerystarasqsdata=qs.triggers.slack.new_message(channel_id='MyChannelID',trigger_string='hello')qs.actions.slack.new_message(spreadsheet_id='MySheetID',worksheet_id='Sheet1',data=[[data['user'],data['text']]])QueryStar can help you:automate workflowsdevelop Slack botsintegrate SaaS data to your own appsrun background jobsschedule tasks...Get StartedInstallationpip install querystarSetup Slack (or other apps) ConnectionThis step takes 3-5 mins:Crete a free account atquerystar.ioAdd any SaaS tools that you want to automate in your QueryStar workspace. (Head over toquickstartin our docs for instructions.)Get a QueryStar token. (Instruction)Add the token as an environment variable on your dev machine.[!IMPORTANT]
Your Data is Safe on QueryStar backend:
QueryStar takes care of 3rd party API integration. It only monitors trigger events and passes action data back to the apps of your choice. Your data isNOTstored or logged in any form or capacity. Please seePrivacy Policyfor more details.Build and Run a BotCreate a new fileapp.pyand add this code:# app.pyimportquerystarasqsmessage=qs.triggers.slack.new_message(channel_id='MyChannelID')print(message)Add QueryStar app to your Slack channel, and copy the channel ID (Instruction)ReplaceMyChannelIDwith the channel id.Run the bot:$querystarrunapp.pyGet InspiredBecause you use Python, there's much more you can build.A LLM-powered (Large Language Model) Slack bot:tutorial.
Package: querystring
This repo is a port of thenode.js querystring module.It contains two methods,parse_qsandstringify_objthat are functionally equivalent to thequerystring.parseandquerystring.stringifynode counterparts. It also contains defaultencode_uri_componentanddecode_uri_componentfunctions that can be used for convenience.Installationpip install querystringUsageParsing a query string>>> querystring.parse_qs('foo=bar&baz=qux&baz=quux&corge=')
{u'foo': u'bar', u'baz': [u'qux', u'quux'], u'corge': u''}>>> querystring.parse_qs('foo:bar;baz:qux;baz:quux;corge:', sep=';', eq=':')
{u'foo': u'bar', u'baz': [u'qux', u'quux'], u'corge': u''}>>> def gbk_decode(s):
...     return urllib.unquote(s)
...
>>> querystring.parse_qs('foo=bar&w=%D6%D0%CE%C4', decode_fn=gbk_decode)
{'foo': 'bar', 'w': '\xd6\xd0\xce\xc4'}  # u'中文'Converting an object back into a query string>>> querystring.stringify_obj({'foo': 'bar', 'baz': ['qux', 'quux'], 'corge': ''})
'foo=bar&baz=qux&baz=quux&corge='>>> querystring.stringify_obj({'foo': 'bar', 'baz': ['qux', 'quux'], 'corge': ''}, sep=';', eq=':')
'foo:bar;baz:qux;baz:quux;corge:'>>> def gbk_encode(s):
...     return urllib.quote(unicode(s).encode('gbk'))
...
>>> querystring.stringify_obj({'foo': 'bar', 'w': u'中文'}, encode_fn=gbk_encode)
'foo=bar&w=%D6%D0%CE%C4'MotivationWe were looking for a simple module to parse query parameters in a sensible way,
and were unsatisfied by howurlparsehandled params (putting all values in a list),
so we made this.LicenseCopyright Refinery29, Inc.Permission 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.
Package: query-string
Installation$[sudo]pipinstallquery-stringFeaturesPython 2/3 compatibleExamples>>>importquery_string>>>query_string.parse('https://site.org/index.php?k=v&k2=v2&k3=v3#anchor'){'k':'v','k2':'v2','k3':'v3'}>>>query_string.parse('k=v&k2=v2&k3=v3'){'k':'v','k2':'v2','k3':'v3'}LinksQuery string - Wikipediareadme42.com
Package: querystringer
QueryStringerSimple middleware for django to extract string queries from urlsInstallationpip install querystringerImportimport it inside middleware in django settingsmiddlewares = [
  ...,
  'querystringer.middleware.QueryStringer',
  ...,
]Usageall requests will have an edited request dict
and you can access them byrequest.GET['queries']Exampleour viewdef home(request):
    return HttpResponse(request.GET['queries'])then send request to/home?test=truenow we should except output like this('test', 'true')Remove specific charactersin yoursettings.pyadd a list withQUERY_REMOVE_STRINGSname
to ignore characters you want
like thisQUERY_REMOVE_STRINGS = ['-', '>', '%']then the data you get will be clean
like this
request to/home?test=tru>ethen we get(test, true)
Package: querystringsafe-base64
Query string safe Base64Encoding and decoding arbitrary strings into strings that are safe to put into a URL query param.The problemurlsafe_b64encodeandurlsafe_b64decodefrom base64 are not enough because they leave=used for padding chars unquoted:importbase64base64.urlsafe_b64encode('a')'YQ=='And there are 2 problems with that=sign gets quoted:importurlliburllib.quote('=')'%3D'Some libraries tolerate the=in query string values:fromurlparseimporturlsplit,parse_qsparse_qs(urlsplit('http://aaa.com/asa?q=AAAA=BBBB=CCCC').query){'q':['AAAA=BBBB=CCCC']}but the RFC 3986 underspecifies the query string so we cannot rely on=chars being handled by all web applications as it is done by urlparse.Therefore we consider chars:[‘+’, ‘/’, ‘=’]unsafe and we replace them with[‘-’, ‘_’, ‘.’].
Characters+and/are already handled byurlsafe_*functions from base64 so only=is left.
Since the=is used exclusively for padding, we simply remove it, and re-attach the padding during decoding.
Because of that,querystringsafe_base64is able to decode padded and unpadded string.The solutionimportquerystringsafe_base64querystringsafe_base64.encode(b'foo-bar')b'Zm9vLWJhcg'querystringsafe_base64.decode(b'Zm9vLWJhcg..')b'foo-bar'querystringsafe_base64.decode(b'Zm9vLWJhcg')b'foo-bar'CHANGELOG1.2.0Remove padding characters from encoded string.1.1.1Fixed packaging1.1.0Always expect bytesAdd type annotations1.0.0support for restore missing padding during decode process0.2.0Support for python30.1.5Move querystringsafe_base64 module to the rootUse install instead of develop during tests0.1.4Remove bdist_wheel from distributons0.1.3Install pandoc (travis)0.1.2Add setup.cfg and pypandoc to tests0.1.1add MANIFEST.in file0.1.0package structuretests
Package: queryswap
qsAccepts urls from a filename and, for each query parameter, replace the value
with a specified value.UsageExample input file:~ % cat urls.txt
https://www.evildojo.com/index.php?q=search&name=darkmage
https://www.evildojo.com/index.php?q=search
https://www.evildojo.com/index.php
https://www.evildojo.comExample usage:python3 -m qs urls.txt d3v
https://www.evildojo.com/index.php?q=d3v
https://www.evildojo.com/index.php?q=d3v&name=darkmage
https://www.evildojo.com/index.php?q=search&name=d3v
Package: querytograph
QueryToGraphQueryToGraph is a Python library that allows user to use simple English to create graph from a dataframe or csv file. It uses ChatGPT as the underlying engine.For security's sake, it does not send the raw data to ChatGPTbut only the data schema (i.e. the data field names) is sent.InstallationYou can install QueryToGraph using pip:pipinstallquerytographSorry I have only tested this library in Linux.UsageYou need to have an paid OpenAI account and you need to set your OpenAI API Key in your environment variable. You can set it in the terminal:exportOPENAI_API_KEY="put your key here, don't copy this line as it is!"Alternatively, you could do this from inside your Jupyter notebook or Python script:import
os.environ["OPENAI_API_KEY"="put your key here, don't copy this line as it is!"To use QueryToGraph, in your Jupyter notebook or Python script:importquerytographqtg=querytograph.QueryToGraph()qtg.run_gr()Go to your browser and use it, e.g.http://127.0.0.1:7861There are 3 textboxes which you have to key inQueryQuestion by the user, which will be used to generate the graph
Example: "show me the highest and lowest closing price for each month"Data FolderFolder which contains Pandas dataframes in csv or pkl (pickle)Table NameFilename of the dataframe that the user wants to query on.
Do not require the exact nameContributingContributions are welcome! Please contact me atfranziss@gmail.comThis was hack over a weekend and I am sure there are bounds to have bugs... sorry.. =)LicenseThis project is licensed under the MIT License - see the LICENSE file for details.Contactfranziss@gmail.com
Package: querytree
QueryTreeQueryTree is a python data structure that lets you quickly access deeply nested data and load/save it in any major format.With QueryTree, you don't have to check for the esistance of (or create) any intermediate nodes.json_str="""{"foo": {"bar": [{"baz": {"n": 1}},{"baz": {"n": 1},"buz": {"k": 2}}]}}"""tree=Tree.parse_json(json_str)print(tree['foo.bar.0.baz.n'])# 1print(tree['foo.bar.1.buz.k'])# 2# accessing nonexistant locations isn't a problemprint(tree['foo.bar.0.buz.k'])# Noneprint(tree['something.else'])# None# assign valuestree['foo.bar.0.baz.n']=99tree['foo.foo']={"myvalue":"a value"}# save as any formatprint(tree.to_yaml())Outputs:foo:bar:-baz:n:99-baz:n:1buz:k:2foo:myvalue:a value
Package: quesans
QuestionAnswering : Qur'an Question Answering with TransformersTransformers based approach for question answering in Qur'an which employs transfer-learning, ensemble-learning across multiple models.InstallationYou first need to install Java for the evaluation script which usesfarasapyand the desired version is Java8.
Please referOracle installation guidefor more details on installing JDK for different platforms.Then you need to install PyTorch. The recommended PyTorch version is 1.11.0
Please refer toPyTorch installation pagefor more details specifically for the platforms.When PyTorch has been installed, you can install requirements from source by cloning the repository and running:gitclonehttps://github.com/DamithDR/QuestionAnswering.gitcdQuestionAnswering
pipinstall-rrequirements.txtExperiment ResultsYou can easily run experiments using following command and altering the parameters as you wishpython-mexamples.arabic.quran.quran_question_answering--n_fold=1--transfer_learning=False--self_ensemble=False--models=camelmix,arabertParametersPlease find the detailed descriptions of the parametersn_fold              : Number of executions expected before self ensemble
transfer_learning   : On/Off transfer learning
self_ensemble       : On/Off self ensembling
models              : comma seperated model tagsModel Tagsarabert             : aubmindlab/bert-base-arabertv2
mbertcased          : bert-base-multilingual-cased
mbertuncased        : bert-base-multilingual-uncased
camelmix            : CAMeL-Lab/bert-base-arabic-camelbert-mix
camelca             : CAMeL-Lab/bert-base-arabic-camelbert-ca
araelectradisc      : aubmindlab/araelectra-base-discriminator
araelectragen       : aubmindlab/araelectra-base-generator
Package: quese
QUESE"Quese" allows you implement in an easy way a Search Algoritm, based on Embeddings and Semantic Similarity, in your Python apps.
The module provides a function called search_by_embeddings(), with several params to customize the searching process.INSTALLATIONYou can install "quese" with pip:pipinstallqueseEXAMPLE WITH BYfrom quese import search_by_embeddings

data_ = [
    {
        "title": "UX Designer",
        "tags": "Designer"
    },
    {
        "title": "Senior Accounter",
        "tags": "Accounter" 
    },
    {
        "title": "Product Manager",
        "tags": "Managment" 
    }
]

results = search_by_embeddings(data=data_, query="Manager", by="title")
#Results will return a LIST with the dictionaries whose title is Semantically Similar to the query: "Manager", so in this case, the last dictionary: "Product Manager".
print(results)PARAMSdata:It's the first param, it'sREQUIRED, and it must be alist of dictionaries.query:It's the second param, it'sREQUIREDas well, and it represent the query you want to pass.Type:stringby:It's the third param, it'sonly REQUIRED if you don't pass the "template" param, and it represent the value of your dictionaries that you are searching for.For example, if you want to search in  a list of products, your "by" param could be the prop "name" of each product.Type:stringtemplate:It'sonly REQUIRED if you don't pass the "by" param, and it's similar to "by", but allow you to search by a customized string for each dictionary in your data list.For example, if you want to search in a list of products, your "template" param could be a string like this: "{name}, seller: {seller}".
Notice that you have to define your propsbetween "{}", as you can see in the example with the variables"name"and"seller".Type:stringaccuracy:It'soptional, and it represents the similarity that the dictionary must have with the query to be considered a result.The default value is 0.4, wich works good with almost all the models. However, if you want to change it, we don't recommend to set vary high values or very low values, the range0.3-0.6should be enought.Type:float number between 0-1model:It'soptional, and it represents theembedding modelyou want to use.The default model is'sentence-transformers/all-MiniLM-L6-v2'. You can use an other model like 'sentence-transformers/all-mpnet-base-v2', but take care becauseif the model don't work with sentence-transformers this package will not work with it.Type:stringEXAMPLE WITH TEMPLATEfrom quese import search_by_embeddings

data_ = [
    {
        "title": "UX Designer",
        "tags": "Designer"
    },
    {
        "title": "Senior Accounter",
        "tags": "Accounter" 
    },
    {
        "title": "Product Manager",
        "tags": "Managment" 
    }
]

results = search_by_embeddings(data=data_, query="Manager", template="{title}, {tags}")
#Results will return a LIST with the dictionaries whose title and tags are Semantically Similar to the query: "Manager", so in this case, the last dictionary: "Product Manager".
print(results)
Package: questdb
This library makes it easy to insert data intoQuestDB.This client library implements QuestDB’s variant of theInfluxDB Line Protocol(ILP) over TCP.ILP provides the fastest way to insert data into QuestDB.This implementation supportsauthenticationand full-connection
encryption with TLS.QuickstartThe latest version of the library is 1.2.0.python3 -m pip install questdbfromquestdb.ingressimportSender,TimestampNanoswithSender('localhost',9009)assender:sender.row('sensors',symbols={'id':'toronto1'},columns={'temperature':20.0,'humidity':0.5},at=TimestampNanos.now())sender.flush()You can also send Pandas dataframes:importpandasaspdfromquestdb.ingressimportSenderdf=pd.DataFrame({'id':pd.Categorical(['toronto1','paris3']),'temperature':[20.0,21.0],'humidity':[0.5,0.6],'timestamp':pd.to_datetime(['2021-01-01','2021-01-02'])})withSender('localhost',9009)assender:sender.dataframe(df,table_name='sensors',at='timestamp')Docshttps://py-questdb-client.readthedocs.io/Codehttps://github.com/questdb/py-questdb-clientPackage on PyPIhttps://pypi.org/project/questdb/CommunityIf you need help, have additional questions or want to provide feedback, you
may find us onSlack.You can alsosign up to our mailing listto get notified of new releases.LicenseThe code is released under theApache License 2.0.
Package: questdb-connect
QuestDB ConnectThis repository contains the official implementation of QuestDB's dialect forSQLAlchemy,
as well as an engine specification forApache Superset, usingpsycopg2for database connectivity.The Python module is available here:https://pypi.org/project/questdb-connect/Psycopg2is a widely used and trusted Python module for connecting to, and working with, QuestDB and other
PostgreSQL databases.SQLAlchemyis a SQL toolkit and ORM library for Python. It provides a high-level API for communicating with
relational databases, including schema creation and modification. The ORM layer abstracts away the complexities
of the database, allowing developers to work with Python objects instead of raw SQL statements.Apache Supersetis an open-source business intelligence web application that enables users to visualize and
explore data through customizable dashboards and reports. It provides a rich set of data visualizations, including
charts, tables, and maps.RequirementsPython from 3.9 to 3.11(superset itself use version3.9.x)Psycopg2('psycopg2-binary~=2.9.6')SQLAlchemy('SQLAlchemy<=1.4.47')You need to install these packages because questdb-connect depends on them.Versions 0.0.XThese are versions released for testing purposes.InstallationYou can install this package using pip:pipinstallquestdb-connectSQLALchemy Sample UsageUse the QuestDB dialect by specifying it in your SQLAlchemy connection string:questdb://admin:quest@localhost:8812/main
questdb://admin:quest@host.docker.internal:8812/mainFrom that point on use standard SQLAlchemy:importdatetimeimportosos.environ.setdefault('SQLALCHEMY_SILENCE_UBER_WARNING','1')importquestdb_connect.dialectasqdbcfromsqlalchemyimportColumn,MetaData,create_engine,insertfromsqlalchemy.ormimportdeclarative_baseBase=declarative_base(metadata=MetaData())classSignal(Base):__tablename__='signal'__table_args__=(qdbc.QDBTableEngine('signal','ts',qdbc.PartitionBy.HOUR,is_wal=True),)source=Column(qdbc.Symbol)value=Column(qdbc.Double)ts=Column(qdbc.Timestamp,primary_key=True)defmain():engine=create_engine('questdb://localhost:8812/main')try:Base.metadata.create_all(engine)withengine.connect()asconn:conn.execute(insert(Signal).values(source='coconut',value=16.88993244,ts=datetime.datetime.utcnow()))finally:ifengine:engine.dispose()if__name__=='__main__':main()Superset InstallationFollow the instructions availablehere.ContributingThis package is open-source, contributions are welcome. If you find a bug or would like to request a feature,
please open an issue on the GitHub repository. Have a look at the instructions fordevelopersif you would like to push a PR.
Package: questdb-ilp-client
Python QuestDB ILP TCP clientRequirementsThis repository contains a Python 3.9 API for ingesting data into QuestDB through the InfluxDB Line Protocol.We usemakeas a CLI to various convenient work developer flows.Install FlowWe requirePython 3.9.*, or aboveinstalled in your system, andpipneeds to be up-to-date:$python3--version
$Python3.9.<some-integer>
$pip3install--upgradepipNow we can install the project's dependencies in a virtual environment and activate it:$makeinstall-dependenciesOr for development (Required for code quality and test flows):$makeinstall-dependencies-devTo activate the environment:$poetryshell
$echo$SHLVL2To deactivate the environment:$exit$echo$SHLVL1Code Quality Flow (Requires dev dependencies)For convenience, we can let standard tools apply standard code formatting; the second command will report
issues that need to be addressed before using the client in production environments.$makeformat-code
$makecheck-code-qualityTest Flow (Requires dev dependencies)To run all tests in thetestsmodule:$maketestStart/stop QuestDB Docker container FlowTo start QuestDB:$makecompose-upThis creates a folderquestdb_rootto store QuestDB's table data/metadata, server configuration files,
and the web UI.The Web UI is avaliable at:localhost:9000.Logs can be followed on the terminal:$dockerlogs-fquestdbTo stop QuestDB:$makecompose-downData is available, even when QuestDB is down, in folderquestdb_root.Basic usagewithLineTcpSender(HOST,PORT,SIZE)asls:ls.table("metric_name")ls.symbol("Symbol","value")ls.column_int("number",10)ls.column_float("double",12.23)ls.column_str("string","born to shine")ls.at_utc_datetime(datetime(2021,11,25,0,46,26))ls.flush()As an objectls=LineTcpSender(HOST,PORT,SIZE)ls.table("metric_name")ls.symbol("Symbol","value")ls.column_int("number",10)ls.column_float("double",12.23)ls.column_str("string","born to shine")ls.at_utc_datetime(datetime(2021,11,25,0,46,26))ls.flush()Multi-line sendwithLineTcpSender(HOST,PORT,SIZE)asls:foriinrange(int(1e6)):ls.table("metric_name")ls.column_int("counter",i)ls.at_now()ls.flush()Object multi-line sendls=LineTcpSender(HOST,PORT,SIZE)foriinrange(int(1e6)):ls.table("metric_name")ls.column_int("counter",i)ls.at_now()ls.flush()NotesOn filesetup.py: It is deprecated. To publish a package on PyPi you
canfollow this.