Saravanan666/pypi-org huggingface dataset:
Package: knowledgebase-gsheet-gpt
Knowledgebase GSheet GPT此專案為使用 GPT 模型回答基於 Google 試算表的知識庫問題。功能從 Google 試算表下載知識庫內容使用 GPT 模型 (gpt-3.5-turbo 或 gpt-4) 生成知識庫內容的向量表示(embeddings)根據提供的問題，找出與問題最相似的知識庫內容使用 GPT 模型回答問題，並將最相似的知識庫內容作為參考安裝請先確保已安裝 Python 3.7 或更高版本。下載此專案的存儲庫：python3 -m pip install knowledgebase-gsheet-gpt使用方法首先，確保您已擁有 Google API 憑證 (JSON 檔案)。若尚未擁有，請參考Google API 官方文件以建立一個。運行以下命令行，將user替換為您的電子郵件地址，將key_file替換為您 Google API 憑證的路徑，將sheet_ids替換為您要下載的 Google 試算表 ID（以逗號分隔），並將prompt替換為您的問題：python3 -m knowledgebase_gsheet_gpt --user 用戶電子郵件 --prompt 提示問題 --sheet-ids 試算表ID --key-file Google服務帳戶密鑰JSON文件路徑例如：python3 -m knowledgebase_gsheet_gpt --user example@example.com --prompt "請問屁股癢癢的怎麼辦?" --sheet-ids 1abcdefg,2hijklmn --key-file google_key_file.json您將會看到 GPT 模型生成的串流回答。
Package: knowledge-base-search
Knowledge Base SearchThis project provides an efficient and scalable solution to search and query a large knowledge base of documents. It allows users to search for information easily by leveraging advanced NLP techniques like BERT embeddings.FeaturesOrganized code structure following SOLID principlesBERT search for semantic similarity between queries and documentsPreprocessing using SpaCy for efficient text processingCaching system to store preprocessed data and search algorithm instances for faster subsequent searchesLogging to track search-related information and potential issuesMethodologyThe Knowledge Base Search tool employs a two-step process to find relevant documents and generate human-readable answers:Semantic Search: The tool preprocesses and indexes the input documents using advanced NLP techniques like BERT/MiniLM embeddings or a custom search implementation. These embeddings capture the semantic meaning of the text, allowing the search algorithm to find documents that are not just textually similar, but also semantically related to the input query. This approach ensures a more accurate and context-aware selection of relevant documents.Answer Generation: After retrieving the most relevant documents, the tool integrates with OpenAI's Chat GPT API to generate human-readable answers based on the provided context. By only sending the relevant context, we can reduce the cost and improve the performance of the API calls, while ensuring that the generated answers are accurate and contextually appropriate.This methodology is designed to be easily extensible and customizable, allowing users to implement their own search algorithms or NLP models to tailor the solution to their specific use case.InstallationTo set up the project, follow these steps:Clone the repository:gitclonehttps://github.com/your_username/knowledge_base_search.gitChange the directory:cdknowledge_base_searchCreate a virtual environment:For Windows:python-mvenvvenvFor Linux/Mac:python3-mvenvvenvActivate the virtual environment:For Windows:venv\Scripts\activateFor Linux/Mac:sourcevenv/bin/activateInstall the required packages:pipinstall-rrequirements.txtCreate a.envfile in the root of your project and add the openai_api_key variable. Replace<your_api_key>with your actual API key:openai_api_key=<your_api_key>UsageAdd your documents in JSON format to thedata/raw_data/documents.jsonfile.Update themain.pyfile with your query and other necessary modifications.Run themain.pyscript:pythonmain.pyThis will load the documents, preprocess them, and index them using the specified search algorithm (e.g., BERT). Then, it will search for relevant documents based on your query and return the top matching results.ContributingContributions are welcome! Please feel free to open issues or submit pull requests to improve the project.
Package: knowledge-engineer
Knowledge EngineerCommand Line Program allowing for the Engineering of Knowledge for LLM's.OpenAI GPT Chat is the first to be supported, but the program is designed to be extensible to other LLMs. The program can be extended by modifying the "Knowledge Engineer Prompt File" Domain Specific Language (DSL).(That is a fancy way to say:  "by modifying the syntax of the.kepffiles.")Quick StartInstallationpip install knowledge-engineerCreate New Projectknowledge_engineer --create=snakeSetup Projectcd snake
edit ke_process_config.envEnter Your OpenAI API Key in the following line of the ke_process_config.env file:OPENAI_API_KEY='<Your Open API Key>'execute example Projectknowledge_engineer --executeRun Your Generated Snake Gamepython Code/snake.pyFurther DocumentationFor UsersTheGetting Starteddocument contains a good place to start.  It is a PDF file that is a good introduction to the example project you just created and ran.  It is also available in HTML format.TheKEPF Language Referencedocument is a good place to look into the options and syntax of the Domain Specific Language (DSL) used to create the prompts for the LLMs.  It is also available in HTML format.For DevelopersAditionaly, theRelease A Versionexplains how to update PiPy (pip install) directory with future versions of the knowledge-engineer package.For PhilosophersTheWhy Knowledge Engineerdocument explains why I feel that LLMs need 'Knowledge Engineer'.
Package: knowledge-exporter
Knowledge ExporterExport your purchased content from paid knowledge providers, supported format including column, video, audio, etc.How to installpip install knowledge-exporterHow to useUsage: knowledge-exporter [OPTIONS] COLUMN_ID

  📑 -> 📚 导出知识付费平台内容

Options:
  -t, --target [GeekTime]         知识付费平台  [required]
  -u, --username TEXT             手机号/用户名  [required]
  -p, --password TEXT             密码  [required]
  --merge / --no-merge            合并专栏文章
  --help                          Show this message and exit.PS导出已购买的知识付费产品，包括专栏、视频、音频等。项目还很早期，欢迎 Issue / Pull Request / Fork。支持平台：极客时间慕课网得到拉钩教育其他支持格式：PDF（方便iPad查阅、批注）视频合集
Package: knowledge-graph
SetupInstall knowledge-graph using these commands:git clone https://github.com/hyroai/knowledge-graph.git
pip install -e ./knowledge-graph
pip install cloud-utils@https://github.com/hyroai/cloud-utils/tarball/masterPublish to PyPIAfter merging your new branch to the main branch, You need to publish a new version to PyPI. On the repo's main view go to the "Code" tab on top and then press on releases.
Click "Draft a new release" and create you new release with semantic version that follows the rules here:https://semver.org/.
Publishing your new release will create a new version on PyPI using the latest commit on main.When to usequerying.pyvsquerying_raw.pyBoth modules provide querying abilities, butquerying.pyrelies on a global store of kgs, storred by their hash value. The code retrieves the kg instance from this map ad hoc. This was built so we can have a serializable representation of a node in the kg,Node, which hasgraph_idandnode_id, and not have to serialize the entire kg any time we serialize an object containing them (e.g. if we're serializing or hashing aNounPhrasefor some reason).The global store is an impure component that can make some code have different behaviours depending on what happened before (whether or not the kg was loaded).Consequently, in contexts where you have aElementandKnowledgeGraph, prefer usingquerying_raw.py, giving the graph instance explicitly. This is mainly when creating graphs or enriching them.In contexts where all you have isNode, usequerying.py.If you implement new querying functions, you can implement them inquerying_raw.py, and lift them toquerying.pyusingstorage.run_on_kg_and_node.Do not use the internal modules inside theknowledge_graphdirectoryInstead, rely on the imports inknowledge_graph/__init__.py, possibly add what you need there (in rare cases this is required).Relations naming conventionsRelation are the middle part of the triplet. Although they can safely be named anything, we use a naming convention that serves as mnemonic device. For example the relationperson/genderimplies the left hand side is an entity representing a person, whereas the right hand side is a gender, so we can expect a triplet likeAlice,person/gender,female.
Package: knowledge-graph-client
OverviewThis package is a very simple client for accessing a GraphQL knowledge graph as a HTTP GET request wrapper.UsageCreate a client:from pykg import KGClient
kg = KGClient(
  host = 'localhost',
  port = 6543,
  user = 'user',
  password = 'password',
  domain = 'my_kg')Perform a string based query:kg.query("{ assets { name } }")Perform a query, but suppress output:result = kg.query("{ assets { name } }", pretty_print=False)
print(len(result['assets']))
Package: knowledgeowl
Python implementation of knowledgeowl APIExamplesCreate connection to knowledge owl:import knowledgeowl
ko = knowledgeowl.KnowledgeOwl('api_key', 'project_id')List all articles and print their ID and Name:resp = ko.list_articles()
for i in resp['data']:
    print('{name}: {id}'.format(**i))Get article by article id:>>> ko.get_article('58cbd78a32131c852498774d')
2017-03-20 08:04:57 INFO connectionpool._get_conn Resetting dropped connection: app.knowledgeowl.com
{u'valid': True, u'data': {u'inherited_roles': None, u'search_phrases': u'', u'internal_title': u'', u'current_version_id': u'xxxxxxxxxxxxxxxxxxxxxxxx', u'application_screens': [u''], u'content_article': None, u'meta_page_title': u'', u'current_version': {u'text': u'updated by ko admin', u'en': {u'text': u'', u'title': u'Test'}, u'title': u'test'}, u'id': u'58cbd78a32131c852498774d', u'auto_save': u'', u'category': u'xxxxxxxxxxxxxxxxxxxxxxxx', u'view_count': None, u'url_hash': u'testapi', u'author': u'xxxxxxxxxxxxxxxxxxxxxxxx', u'ready_versions': None, u'callout': u'none', u'remove_pdf': u'', u'languages': None, u'meta_description': u'', u'current_version_number': 1, u'searchTitle': {u'en': u'Test'}, u'parents': [u'xxxxxxxxxxxxxxxxxxxxxxxx'], u'project_id': u'xxxxxxxxxxxxxxxxxxxxxxxx', u'type': u'article', u'callout_video': u'', u'status': u'published', u'redirect_link': None, u'index': 6, u'toc_title': u'', u'visibility': u'public', u'date_published': {u'usec': 0, u'sec': -68400}, u'reader_roles': u'', u'related_articles': [u''], u'pdf': u'/help/pdfexport/id/58cbd78a32131c852498774d', u'template_article': u'', u'remove_feedback': u'', u'article_link': None, u'tags': u'', u'hide_from_toc': u'', u'callout_expire': 1490619453, u'name': u'Test', u'date_modified': u'03/20/2017 8:57 am EDT', u'prevent_searching': u'', u'date_deleted': None, u'summary': False, u'remove_comments': u'', u'meta_data': None, u'category_view': u'', u'date_created': u'03/17/2017 8:33 am EDT', u'user_teams': u'', u'modified_author': u'xxxxxxxxxxxxxxxxxxxxxxxx'}}Update article:r = ko.update_article('58cbd78a32131c852498774d', index=6).json()Notes:There are certain fields you shouldn’t try to update. Here is the list of fields you can update.:>>> knowledgeowl.ARTICLE_KEYS
['name', 'visibility', 'status', 'url_hash', 'toc_title', 'category', 'application_screens', 'index', 'category_view', 'prevent_searching', 'hide_from_toc', 'remove_pdf', 'callout', 'callout_expire', 'callout_video', 'reader_roles', 'current_version']
>>> knowledgeowl.CATEGORY_KEYS
['name', 'visibility', 'status', 'url_hash', 'type', 'parent_id', 'toc_title', 'faq_display', 'toc_hide_children', 'description', 'index', 'cat_toggle_override', 'reader_roles', 'hide_from_toc']
Package: knowledge-pp
knowledge-ppPreprocessor for theknowledge LaTeX package.StatusThis is a proof of concept,do not use it.
An example document can be found inexamples/along
with a Makefile to generate a document calledmain.pdf.Wanted FeaturesLSP support viahttps://github.com/openlawlibrary/pyglsStrongly terminatingLexical scoping by defaultContexts à la React (dynamic scoping)Hooks forcustom DSLlanguages, that are left un-interpretedA math mode as a custom DSLHow to useGiven a valid document, you can simply runkwpp my_documentTo get the corresponding LaTeX output.In practise, this is indentend to be used in a workflow using a Makefile,
or the specific input triggers from latexmk.Devel using virtualenvUsing virtualenv and the--editableoption frompip3allows for an easy
setup of a development environment that will match a future user install without
the hassle.For bash and Zsh usersvirtualenv-ppython3kw-develsource./kw-devel/bin/activate
pip3install--editable.For fish usersvirtualenv -p python3 kw-develsource./kw-devel/bin/activate.fish
pip3 install --editable .
Package: known-pose-client
Define and retrieve (accurate) semantic poses in a 2D environment. This version is a workaround for some not yet available features of the OpenAPI Specification v3.0 (e.g. &#x60;anyOf&#x60; as a response type and adding a  &#x60;discriminator&#x60; for supporting polymorphism/composition). Therefore, ATM the sub-components BasicPose and InaccuratePose are reference objects inside their respective parent model.    # noqa: E501
Package: knowt
Self-hosted semantic search and QAHave a conversation with your own private documents.
Want to know what your doctor said at your last exam?
What about the name of that cute person with the mishievious smile that you saw at San Diego Tech Coffee?
You probably have that info in a text file on your laptop somewhere, but you probably haven't ever used the word "mischievous" in the notes you jot down in a rush.
You may forget those details unless you have a tool like knowt to help you resurface them.
All you need to do is put your text notes into the "data/corpus" directory and knowt will take care of the rest.Under the hood, Knowt implements a RAG (Retrieval Augmented Generative model).
So knowt first processes your private text files to create a searchable index of each passage of text you provide.
This gives it to perform "semantic search" on this indexed data blazingly fast, without using approximations.
See the project [final report](docs/Information Retrieval Systems.pdf) for more details.
To index a 10k documents should take less than a minute, and adding new documents takes seconds.
And answers to your questions take milliseconds.
Even if you wanted to ask some general question about some fact on Wikipedia, that would take less than a second (though indexing those 10M text stings took 3-4 hours on my two-yr-old laptop).InstallationPython virtual environmentTo set up the project environment, follow these steps:Clone the project repository or download the project files to your local machine.Navigate to the project directory.Create a Python virtual environment in the project directory:pipinstallvirtualenv
python-mvirtualenv.venvActivate the virtual environment (mac/linux):source.venv/bin/activateInstall dependenciesNot that you have a virtual environment, you're ready to install some Python packages and download language models (spaCy and BERT).Install the required packages using therequirements.txtfile:pipinstall-e.Download the small BERT embedding model (you can use whichever open source model you like):python-c'from sentence_transformers import SentenceTransformer; sbert = SentenceTransformer("paraphrase-MiniLM-L6-v2")'Quick startYou can search an example corpus of nutrition and health documents by running thesearch_engine.pyscript.Search your personal docsReplace the text files indata/corpuswith your own.Start the command-line search engine with:pythonsearch_engine.py--refreshThe--refreshflag ensures that a fresh index is created based on your documents.
Otherwise it may ignore thedata/corpusdirectory and reuse an existing index and corpus in thedata/cachedirectory.Thesearch_engine.pyscript will first segement the text files into sentences.
Then it will create a "reverse index" by counting up words and character patterns in your documents.
It will also creat semantic embeddings to allow you to as questions about vague concepts without even knowing any the words you used in your documents.ContributingContributions to this project are welcome!LicenseThis project is licensed underMIT License.
Package: knowyourdata
************KnowYourData************A Simple Data Description Package for Python.A rapid and lightweight module to describe the statistics and structure of data arrays for interactive use. This project was started in 2018 and currently maintained by Mubdi Rahman.Installation============Dependencies------------KnowYourData requires:* Python (>=2.7 or >=3.4)* Numpy (>=1.10.0)* ipythonUser Installation-----------------The easiest way to install KnowYourData is with ``pip``:..code-block:: bashpip install knowyourdataUsage-----For full usage, details are available in the ` documentation <http://knowyourdata.readthedocs.io/>`_. The most simple use case to display data is if you have a numpy array 'x':..code-block:: python>>> from knowyourdata import kyd>>> kyd(x)Help and Support----------------* Documentation: http://knowyourdata.readthedocs.io/
Package: know-your-exceptions
IntroductionException handling is one of the most cruicial part of the coding practices. And it is always a good idea to handle the specific exception using try-except rather than just handling theExceptionclass in Python. This package can help you achieve the same.StepsInstall the package usingpip install know-your-exceptionsImport the decorator in your file usingfrom know_your_exceptions.decorators import exc_finderAdd this decorator over your function, and make sure that you function does not have anytry-exceptblock (so that this package can suggest you accurate exception handling method)Example Response
Package: knoxdb
KnoxDB Python LibraryTable of contentsInstallUsageFeedbackInstallThis library only supportspython3$pipinstallknoxdbUsageimportknoxdbfromknoxdbimportknoxCreate a new DB with a custom name. This returns back information about the DB you can store to easily access it again.new_db=knox.create(db_name="test_db")Get a DB Instance from the ID returned after creating an instancedb=knox.get_from_id(id="test_db_id")Connect to DB Instanceconn=knox.connect(id="test_db_id")Close connection to DBknox.close_db_connection(conn=conn)Query the DB Instance by passing in a SQL Commandconn=knox.connect(id="test_db_id")sql_string="CREATE TABLE\"User\"(id serial PRIMARY KEY, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL)"db_query=knox.query(conn=conn,sql_string=sql_string,close_conn=True)FeedbackFeel free to send me feedback or feature requests on myWebsite. Feature requests are always welcome.If there's anything you'd like to chat about, please feel free to email me atknox.dobbins@gmail.com!
Package: knox-mi-graph
MI-GraphMI-graph (Machine learning graph) is a pip module supporting various configurations for knowledge extraction.UsageTo download the module run the following command:pipinstall--extra-index-urlhttps://repos.knox.cs.aau.dkknox-mi-graphList of commandline argumentsMI-Graph supports the following arguments.usage: mi-graph [-h] [-v] [--file] [--visualisation] {file,flask}

positional arguments:
  {file,flask}     Choose if you want to process a file, or run the program as a rest api

optional arguments:
  -h, --help       show this help message and exit
  -v, --version    show program's version number and exit
  --file , -f      Please indicate the json file you want to process.
  --visualisation  This option visualizes the graph with plotly, after the script has runRun under developmentThere is two alternatives to run the program when developing:Option 1python -c "from mi_graph import cli; cli()"Option 2Wrap option 1 into a Python file which then can be executed:from mi_graph import cli

cli()Now run the file:python <file path>Setup: virtualenv environmentFollowthis guideto setup a virtual environment for developmentSetup: conda environmentInstall conda fromtheir website. (We recommend the mini version /
miniconda)Initialize the environment with:conda create --name knox-env python=3.8activate knox-envpip install -r requirements.txtTest dependenciesFor developers, you also need to install the test requirements:pip install -r tests/requirements.txtPylintBefore you make a pull request to master, you should run branch though pylint.you can usepylint_runnerto run all folders in the solution, or with pylint like so Run:pipinstallpylintAnd thenpylintfolder/Build moduleYou cannot be in a virtual environment, when buildingpython3 setup.py sdist bdist_wheelOutput artifacts:knox-mi-graph-1.0.2.tar.gzknox_mi_graph-1.0.2-py3-none-any.whlWhen the command is finished, it outputs a set of artifacts in adistfolder. Copy the artifacts to the knox
serverknox-master02.srv.aau.dkin the following path:/srv/web/repos.knox.cs.aau.dk/https/The final result after completing the steps above:knox-master02.srv.aau.dk/srv/web/repos.knox.cs.aau.dk/https/knox-mi-graph-1.0.2.tar.gzknox-master02.srv.aau.dk/srv/web/repos.knox.cs.aau.dk/https/knox_mi_graph-1.0.2-py3-none-any.whl
Package: knoxth
Knoxth - Auth for KnoxA authorization module for django built on top ofDRFandKnox.Introduction•Installation•How To Use•Documentation•LicenseIntroductionKnoxth uses Knox tokens to provide token-level authorization management for DRF viewsets.Django Rest Frameowork is an amazingly simple to use and easy
frameowork to write REST APIs in Django. With Knox, you can secure
your API with Access Tokens. Yet, there is a gap left by Knox, the
need for context-specific authentication system built on top of knox.Users will want to customize the "scope" of each token they
create. This way, users may create different tokens for separate
usecases.Let's take an example. Let us say you are developinga rest api that
lets it's create and manage TODO lists. Now, you have a viewset that
handles all CRUD operations, but you want to provide a way for users
to manage access to their todo lists on a token level. So, a user may
want to create a token, with which they can only read TODO lists, but
not modify them.This is where knoxth comes in. Knoxth implements contextual
authorization of DRF viewsets on token level, using Knox Tokens.InstallationKnox should be installed with pip1. Install knoxthpipinstallknoxthFor pipenv projects, it can also be installed as suchpipenvinstallknoxthAfter installing knoxth, you will need to setup knoxth to work with your existing project.
Before seting up knoxth, make sure you have rest_framework and knox setup and ready to go.2. Add to INSTALLED_APPSAddrest_framework,knoxandknoxthto yourINSTALLED_APPS, and addrest_framework.authtokenif you removed it while setting up knox.INSTALLED_APPS=(...'rest_framework','rest_framework.authtoken','knox','knoxth',...)3. Setup default Authentication classMake knox's TokenAuthentication your default authentication class
for django-rest-framework:REST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':('knox.auth.TokenAuthentication',),...}4. Include knoxth URLSKnoxth provides a url config ready with its four default views routed.This can easily be included in your url config:urlpatterns=[#...snip...url(r'api/auth/',include('knoxth.urls'))#...snip...]NoteIt is important to use the string syntax and not try to importknoxth.urls,
as the reference to theUsermodel will cause the app to fail at import time.The views would then acessible as:EndpointDescription/api/auth/authorizeAuthorize username & password. Return authorization code./api/auth/loginAccept authorization code and return access token/api/auth/logoutLogout the user and delete the access token and authorization code./api/auth/logoutallSame as logout, but logs out of all running sessions.they can also be looked up by name:reverse('knoxth_login')reverse('knoxth_logout')reverse('knoxth_logoutall')reverse('knoxth_authorize')5. MigrateApply the migrations for the modelspythonmanage.pymigrateHow To UseRefer to ourdocumentationfor details, or follow ourgetting started guide.LicenseGNU GPL V3GitHub@ayys· 
Twitter@habuayush