Saravanan666/pypi-org huggingface dataset:
Package: docchat
DocChat is a Python application that allows users to interact with documents using natural language. It leverages LangChain, Gradio, and the OpenAI API to create a chat interface for document-based conversations.InstallationTo get started with DocChat, follow these steps:Clone the repository to your local machine:git clone https://github.com/BackyardML/DocChat.gitChange the directory to the project folder:cd DocChatInstall Poetry (if you haven't already):pip install poetryInstall project dependencies using Poetry:poetry installObtain an API key fromOpenAI.UsageRunning DocChatYou can run DocChat by executing the app.py script:poetry run python app.pyThis will start a Gradio web application with a chat interface that you can access through your web browser.Interacting with DocChatLaunch the Gradio application by running the app.py script.Set your OpenAI API key by entering it in the "OpenAI API Key" textbox.Upload the document you want to chat about using the file uploader.Click the "Run" button to create a chatbot for the document.Start chatting with the document! You can type messages in the "Message" textbox, and the chatbot will respond based on the content of the document.To clear the chat history, click the "Clear" button.ContactIf you have any questions or need assistance, feel free to contact me atpatrik@backyardml.se
Package: docchecker
DocChecker: Bootstrapping Code-Text Pretrained Language Model to Detect Inconsistency Between Code and CommentDocChecker PackageDocChecker is trained on top of encoder-decoder model to learn from code-text pairs. It is a tool that uses for automated detection to identify inconsistencies between code and docstrings, and generates comprehensive summary sentence to replace the old ones.Usage ScenarioInstallationInstall the dependencies:pip-rinstallrequirements.txtInferenceSince DocChecker is a Python package, users can use it byinferencefunction.fromDocChecker.utilsimportinferenceParameters:input_file_path (str): the file path that contains source code if users want to check all the functions in there.raw_code (str): a sequence of source code ifinput_file_pathis not given.language (str, required): the programming language. We support 10 popular programming languages such as Java, JavaScript, Python, Ruby, Rust, Golang, C#, C++, C, and PHP.output_file_path (str): if it is not None, the results from our tool will be written in this path; otherwise, they will be printed on the screen.
Returns:list of dictionaries, including:function_name: the name of each function in the raw codecode: code snippetdocstring: the docstring corresponding code snippetpredict: the prediction of DocChecker. It returns "Inconsistent!” for the inconsistent pair and “Consistent!” means the docstring is consistent with the code in a code-text pairrecommend_docstring: If a code-text pair is considered as “Inonsistent!”, DocChecker will give a comprehensive docstring to replace its docstring, otherwise, it will keep the original version.ExamplefromDocChecker.utilsimportinferencecode="""def inject_func_as_unbound_method(class_, func, method_name=None):# This is actually quite simpleif method_name is None:method_name = get_funcname(func)setattr(class_, method_name, func)def e(message, exit_code=None):# Print an error log message.print_log(message, YELLOW, BOLD)if exit_code is not None:sys.exit(exit_code)"""inference(raw_code=code,language='python')>>>[{"function_name":"inject_func_as_unbound_method","code":"def inject_func_as_unbound_method(class_, func, method_name=None):\n\nif method_name is None:\nmethod_name = get_funcname(func)\nsetattr(class_, method_name, func)","docstring":" This is actually quite simple","predict":"Inconsistent!","recommended_docstring":"Inject a function as an unbound method."},{"function_name":"e","code":"def e(message, exit_code=None):\n\nprint_log(message, YELLOW, BOLD)\nif exit_code is not None:\nsys.exit(exit_code)","docstring":"Print an error log message.","predict":"Consistent!","recommended_docstring":"Print an error log message."}]ReferenceMore details can be found in ourpaper.
If you use this code or our package, please consider citing us:@article{DocChecker,title={Bootstrapping Code-Text Pretrained Language Model to Detect Inconsistency Between Code and Comment},author={},journal={},pages={},year={2023}}Contact usIf you have any questions, comments or suggestions, please do not hesitate to contact us.Website:fpt-aicenterEmail:support.ailab@fpt.comLicenseMIT License
Package: docci
docciVarious document management utilsUsageThedocci.file.FileAttchmentclass is root of whole package.
It abstracts work with files and provides useful properties like base64 convertion, content-disposition header generation, mimetype detection:fromdocci.fileimportFileAttachment# Create file attachment from filefile=FileAttachment.load("path/to/file")# Now you can use the FileAttachment features:# Get base64 file representationfile.content_base64# Generate Content-Disposition header with file namefile.content_disposition# Get file extensionfile.extension# Get file mimetypefile.mimetype# Save file to diskfile.save("path/to/file")To see other features proceed to thedocumentation
Package: doccito
## Installation ##Install lib with pip:pip install doccito- OR -Put the “doccito”directorysomewhere in your python path## Usage ##Doccito allows quick and easy documentation for your project by taking a readme.markdown file and constructing an html page with a table of contents corresponding to the document’s <h> tags.More markdown syntax and examples can be found on the Markdown website, <a href = “http://daringfireball.net/projects/markdown/syntax”>here</a>.###Command-Line Arguments###Running Doccito on the command-line allows use of either a provided base.html page for your document or a custom one with the [–template] command.Running Doccito without any arguments will bring up it’s help menu with optional arguments:-h,--helpshow help message and exit--stdiospecifies stdio--templatespecifies custom html template--versionshow program’s version number and exitcat README.markdown | python doccito.py –stdio > docs.html- OR -python doccito.py README.markdown > docs.htmlwill take the README.markdown file and throw it into the default base.html template and create and send it to docs.html.cat README.markdown | python doccito.py –stdio –template layout.html > docs.htmlwill use layout.html as it’s template.##API##Using Doccito as a library allows use of several functions:###doccito.create_docs###inputis a string containing the documentation in .markdowntemplateis the .html template to be used (optional)Example usage:import doccitodoccito.create_docs(input, template=”./base.html”)
Package: doc-classifier
OverviewA machine learning model to classify scientific documents (articles and thesis) by field of study.Available languages : Arabic, French, English.Training set : 117976, Test set : 50558, Accuracy : 87%.Available labels : 'Sciences and technology', 'Matter sciences', 'Mathematics and computer science', 'Natural and life sciences', 'Earth and universe sciences', 'Economics, marketing and management', 'Law and political sciences', 'Literature and foreign languages', 'social and human sciences', 'Sport and physical activities', 'Health sciences', 'Architecture and urban planning'.Usefrom doc_classifier import classifysummary = 'This article analyzes the basic classification of machine learning, including supervised learning, unsupervised learning, and reinforcement learning. It combines analysis on common algorithms in machine learning, such as decision tree algorithm, random forest algorithm, artificial neural network algorithm, SVM algorithm, Boosting and Bagging algorithm, BP algorithm. Through the development of theoretical systems, further improvement of autonomous learning capabilities, the integration of multiple digital technologies, and the promotion of personalized custom services, the purpose is to improve people's awareness of machine learning and accelerate the speed of popularization of machine learning.'label = classify(summary)print(label)
Package: doc-cli
DocCliPython 3.6+ utility to build Classes that can be easily modified to create a Python
Argparse specification. The goal of this is to couple a CLI specification to a config
class, making them quicker to build and less likely to break.This leans heavily on theDeclilibrary
to generate Argparse objects.Creating CLI ObjectsCLI objects can be created automatically from a class definition, reading in default
values and descriptions from type hints and the docstring.fromdoccliimportDocCliParserclassCliTool:command_name="cli-tool"def__init__(self,_non_cli_param:str,param_a:str,param_b,param_c:int=5):"""This is the command descriptionArgs:_non_cli_param (str): Underscore leading params aren't included in theCLI specsparam_a: A required parameterparam_b: Note that the type needs to come from the annotationparam_c: This one has a default"""self.param_a=param_aself.param_b=param_bself.param_c=param_cself.non_cli_param=non_cli_param# To create the argparse object:if__name__=="__main__":args=DocliParser(CliTool).parse_args()...Seeexamplesfor more examples, including how to create CLIs withsubcommands.Config File HelpersDocCli also provides theConfigUtilclass which can be used to automatically
create Yaml config files. These include the ability to:Infer config specifications from the__init__methodConvert an instantiated object into a dictionaryThis will ignore config values that have the same value as their defaultAbility to nest Config objects in other objects, to create centralised config filesA sub-config object can still be instantiated from the super YAML fileObjects inheriting from theConfigUtilclass can set the following class level
variables:config_key: strParameters for this object. Defaults to the class namesub_config_list: ListA list of Config Classes that also inherit from ConfigUtil, and are children of this classflatten_sub_configs: boolDefaults to True. When reading from/writing to a dict, sub_configs will either be recorded
as sub-dictionaries, or at the same level as the config items for the current dictionary.Using them togetherThese tools can be used together to create a config class that can:Generate a CLI parserInitiate from a CLI parser, while also filling in unsupplied values from a Config fileWrite supplied values to a config file so they can be remembered laterDocliParser has the methodparse_args_with_config_file, which will attempt to
fill in any unprovided arguments with values provided in the Config File. Note that
this will only work if:The variables are stored as top-level keys in the fileThe variables are stored in a sub-dictionary under the same key as the subcommand nameIf the subcommand class inherits fromConfigUtiland the variables are stored in a
sub-dictionary under the same key as the ConfigUtil.config_key variableAn example of this can be seen inexamples
Package: docconvert
DocconvertUpdate or convert docstrings in existing Python files.This Python (2.7+/3.6+) module and script intends to help Python programmers to
enhance internal code documentation using docstrings.
It is useful to harmonize or change a project docstring style format.It will parse one or several python scripts and retrieve existing docstrings.
Then, for all found modules/functions/methods/classes, it will convert docstrings
with parameters, returns, and other fields formatted in the newly specified style.Currently, the managed styles in input/output are:InputepytextreST(re-Structured Text, as used by Sphinx)OutputgooglenumpyepytextreST(re-Structured Text, as used by Sphinx)Getting StartedInstallationDocconvert can be installed through pip:pipinstalldocconvertUsageusage:docconvert[-h][-i{guess,rest,epytext}][-o{google,numpy,rest,epytext}][--in-place][-cCONFIG][-tTHREADS][-v]sourcepositionalarguments:sourceThedirectoryorfiletoconvert.

optionalarguments:-h,--helpshowthishelpmessageandexit-i{guess,rest,epytext},--input{guess,rest,epytext}Inputdocstringstyle.(default:guess)-o{google,numpy,rest,epytext},--output{google,numpy,rest,epytext}Outputdocstringstyletoconvertto.(default:google)--in-placeWritethechangestotheinputfileinsteadofprintingdiffs.-cCONFIG,--configCONFIGLocationofconfigurationfiletouse.-tTHREADS,--threadsTHREADSNumberofthreadstouse.(default:cpucount)-v,--verboseLogmoreinformation.Examples:Convert files insrc/mypackageto google using 4 threads.docconvert--outputgoogle--threads4src/mypackage/Convert filesrc/mypackage/myfile.pyfrom rest to google.docconvert--inputrest--outputgooglesrc/mypackage/myfile.pyCustom ConfigurationYou can configure optional conversion arguments in a json config file. Just
specify a config filepath to the commandline tool.docconvert--configpath/to/config.jsonsrc/mypackage/Detailed description of all configuration options can be found in thedocumentation.ContributingIf you would like to contribute, please take a look at thecontributor documentation.VersioningWe useSemVerfor versioning.
For the versions available, see the tags on the repository.LicenseThis project is licensed under the BSD-3-Clause License.
See the LICENSE.md file for details.
Package: doc-cov
doc-covdoc-cov is a tool for measuring docstring coverage of Python project.Python versions >= 3.6Quick startInstall doc-cov from pip.Usedoccov PROJECT_PATH$ doccov tests/sample_project
function     3 /   5 60.00%OptionsTarget objectdoc-cov can measure docstring coverage of functions, classes and modules.functions (default,-f)$ doccov tests/sample_project -f
function     3 /   5 60.00%classes-c$ doccov tests/sample_project -c
class        2 /   2 100.00%modules-m$ doccov tests/sample_project -m
module       3 /   7 42.86%Outputstr (default,--output str)$ doccov tests/sample_project -fmc --output str
class        2 /   2 100.00%
module       3 /   7 42.86%
function     3 /   5 60.00%csv--output csv$ doccov tests/sample_project -fmc --output csv
coverage,class,2,2,100.00%
coverage,module,3,7,42.86%
coverage,function,3,5,60.00%TargetPrint coverage of whole (default)$ doccov tests/sample_project
function     3 /   5 60.00%Print all coverage of modules--all$ doccov tests/sample_project --all
=============================
module_fulldoc
-----------------------------
function     1 /   1 100.00%
=============================
package_A
-----------------------------
function     0 /   0 -
=============================
package_A.module_fulldoc
-----------------------------
function     1 /   1 100.00%
=============================
package_B
-----------------------------
function     0 /   0 -
=============================
package_B.module_shortdoc
-----------------------------
function     1 /   1 100.00%
=============================
package_B.package_B_1
-----------------------------
function     0 /   0 -
=============================
package_B.package_B_1.module_nodoc
-----------------------------
function     0 /   2 0.00%
=============================
coverage
-----------------------------
function     3 /   5 60.00%Report to pull requestAdd comment togithubpull request.$ doccov <project> -fmc --output csv > doccov.csv
$ GITHUB_TOKEN=XXXXX doccov-report doccov.csvCircleCiAdd pull request comment using circle-ci environment.OtherRequired following environmentPROJECT_USERNAMEPROJECT_REPONAMEPR_NUMBER
Package: doccron
LicenseVersionGithub ActionsCoverageSupported versionsWheelStatusDownloadsDocCronSchedule with DocstringsInstallationpipinstallDocCronDescriptionCron-based scheduler inspired bydoctestExampleCron jobs can be embedded into docstrings by using aliteral block(::). Literal blocks should start with/etc/crontab.Standard/Extended FormatRunhello()at every 2nd minute and 3rd minute:importtimedefhello():"""Print "hello world" at every 2nd minute and 3rd minute:/etc/crontab::*/2 * * * **/3 * * * *"""print(time.strftime('%Y-%m-%d%H:%M:%S'),"hello world")if__name__=='__main__':importdoccrondoccron.run_jobs()Quartz FormatRunhello()at every 2nd second and 3rd second:importtimedefhello():"""Print "hello world" every 2nd second and 3rd second:/etc/crontab::*/2 * * * * **/3 * * * * *"""print(time.strftime('%Y-%m-%d%H:%M:%S'),"hello world")if__name__=='__main__':importdoccrondoccron.run_jobs(quartz=True)Timezone-Awareness (CRON_TZ)DocCron now supportCRON_TZ. The value ofCRON_TZonly applies to succeeding cron jobs.
DocCron supports multipleCRON_TZin a cron table. The default timezone value is the local/system timezone, if not specified.importtimedefhello():"""Print "hello world" at every 2nd minute and 3rd minute:/etc/crontab::CRON_TZ=UTC*/2 * * * **/3 * * * *"""print(time.strftime('%Y-%m-%d%H:%M:%S%z'),"hello world")if__name__=='__main__':importdoccrondoccron.run_jobs()FeaturesStandard and extended cron formats (seeCRON Expression)Nonstandard predefined scheduling definitionsNon-standard charactersQuartz formatWorks with documentation tools likeSphinxTimezone-awareness (CRON_TZ)Interval (e.g.,@every 1h2m3s)TODOHuman-readable date/time stringsReferencesCron FormatWikipedia - Croncron library for GoAuthorRonie Martinez
Package: docdantic
DocdanticDocdantic is a Python library that enables the automatic generation of Markdown documentation from Pydantic models. It works as an extension of the Markdown package, extracting model details and creating neat tables with model fields and their properties.FeaturesSupports both Pydantic V1 and V2 models.Automatically generate tables of Pydantic model fields with their details (name, type, required, default).Supports nested Pydantic models.Configurable exclusion of specific fields from the documentation.InstallationpipinstalldocdanticUsageUsing the Docdantic ExtensionTo generate documentation directly from Markdown files, you can use the Docdantic extension. Simply include the!docdantic: import.path.to.Modeldirective in your Markdown text:# MyModel Reference!docdantic: my_module.MyModelDocdantic will replace the !docdantic directive with a table of model field details.Using Docdantic in Python CodeIf you want to programmatically generate Markdown documentation from Pydantic v2 models, you can use Docdantic in your Python code. Here's an example:importmarkdownfromdocdanticimportDocdanticmarkdown_text="Here are the details of my model:\n\n!docdantic: your.model.path"converted_text=markdown.markdown(markdown_text,extensions=[Docdantic()])# `converted_text` will contain the Markdown text with the model documentationYou can include the!docdantic: your.model.pathdirective in your Markdown text as before, and themarkdown.markdownmethod will process it using the Docdantic extension.ConfigurationDocdantic allows you to exclude specific fields from the generated documentation by using the exclude configuration. You can provide a JSON object in the exclude field of the configuration to specify which fields to exclude. For example:!docdantic: my_module.MyModel
    {
        "exclude": {
            "MyModel": ["field1", "field2"]
        }
    }In the example above, the fieldsfield1andfield2will be excluded from the documentation of theMyModelmodel. Notice the configuration has to be indented with 2-4 spaces or a tab.LicenseThis project is licensed under the terms of the MIT license. SeeLICENSEfor more details.
Package: docdata
DocdataAdd structured information to the end of your python docstrings.💪 Getting StartedUse this package to add structured data to your docstrings in YAML. Just add a---delimiter at the bottom, and the
rest is parsed as YAML.fromdocdataimportparse_docdata,get_docdata@parse_docdataclassMyClass:"""This is my class.---author: Charliemotto:- docs- are- cool"""assertget_docdata(MyClass)=={'author':'Charlie','motto':['docs','are','cool'],}If you want to get the data directly, go forMyClass.__docdata__. If you want to change the way docdata is parsed,
like changing the delimiter, use keyword arguments like in:fromdocdataimportparse_docdata,get_docdata@parse_docdata(delimiter='****')classMyClass:"""This is my class.****author: Charliemotto:- docs- are- cool"""assertget_docdata(MyClass)=={'author':'Charlie','motto':['docs','are','cool'],}⬇️ InstallationThe most recent release can be installed fromPyPIwith:$pipinstalldocdataThe most recent code and data can be installed directly from GitHub with:$pipinstallgit+https://github.com/cthoyt/docdata.gitTo install in development mode, use the following:$gitclonegit+https://github.com/cthoyt/docdata.git
$cddocdata
$pipinstall-e.⚖️ LicenseThe code in this package is licensed under the MIT License.🙏 ContributingContributions, whether filing an issue, making a pull request, or forking, are appreciated. SeeCONTRIBUTING.rstfor more information on getting
involved.🍪 Cookiecutter AcknowledgementThis package was created with@audreyr'scookiecutterpackage using@cthoyt'scookiecutter-python-packagetemplate.🛠️ DevelopmentThe final section of the README is for if you want to get involved by making a code contribution.❓ TestingAfter cloning the repository and installingtoxwithpip install tox, the unit tests in thetests/folder can be
run reproducibly with:$toxAdditionally, these tests are automatically re-run with each commit in
aGitHub Action.
Package: doc-datatypes
doc_datatypesInstallationgit clone git@github.com:Kel0/doc_dict.gitpip install doc-datatypespypiUsageDocumentable listfrom doc_datatypes.mutable_datatypes import DocumentedList


my_list: DocumentedList = DocumentedList(
    [1, 2, 3], ["First", "Second", "Third"]
)
my_list_2: DocumentedList = DocumentedList(
    [[1, "First"], [2, "Second"], [3, "Third"]]
)Documentable dictfrom doc_datatypes.mutable_datatypes import DocumentedDict


my_dict: DocumentedDict = DocumentedDict(
    {"name": "Alex"}, {"name": "Name field"}
)

my_dict_2: DocumentedDict = DocumentedDict(
    {"name": "Alex", "name_doc": "Name field"}
)To get more info seetests
Package: docdbdemo
Amazon DocumentDB Demo ConstructInstallingPypi (Python)pip install docdbdemonpm (JavaScript and TypeScript)npm install @richardhboyd/doc_db_libUsagePythonfromaws_cdkimport(core)fromdocdbdemoimportDocDbLibclassMyStack(core.Stack):def__init__(self,scope:core.Construct,id:str,**kwargs)->None:super().__init__(scope,id,**kwargs)DocDbLib(self,"MyDocDBClient")TypeScriptimportcdk=require('@aws-cdk/core');importdocdbdemo=require('@richardhboyd/doc_db_lib');exportclassDocDbClientTsStackextendscdk.Stack{constructor(scope:cdk.App,id:string,props?:cdk.StackProps){super(scope,id,props);newdocdbdemo.DocDbLib(this,"MyDocDBClient");}}DiagramInteractingDeploying the stack will create an Amazon DocumentDB Cluster with one instance in each availability zone created by the CDK's VPC Construct, a Lambda function that can put items into the database and fetch them out again, and an API to send requests to the Lambda Funciton.The stack will output an APIGateway endpoint that will front the created DocumentDB.Outputs:
DocDbClientTsStack.MyDocDBClientMyDocDbApiMyDocDBApiEndpoint74609B36=https://gv8ooq7zti.execute-api.us-east-1.amazonaws.com/prod/Let's look at how we use this new API.Putting a document in the DocumentDBAPI=https://gv8ooq7zti.execute-api.us-east-1.amazonaws.com/prod
curl-H"Content-Type: application/json"-d'{"bestCoder":"@allenmichael", "worstCoder":"singledigit"}'-XPOST$API/documentGetting a document out of the databaseAPI=https://gv8ooq7zti.execute-api.us-east-1.amazonaws.com/prod
curl-H"Content-Type: application/json"$API/document?bestCoder=@allenmichaelTesting this out we see$curl-H"Content-Type: application/json"-d'{"bestCoder":"@allenmichael", "worstCoder":"@singledigit"}'-XPOST$API/document{"id":"5d7bd032c7866a33171a1261"}$curl-H"Content-Type: application/json"$API/document?bestCoder=@allenmichael{'_id':ObjectId('5d7bcfe6c7866a33171a125f'),'bestCoder':'@allenmichael','worstCoder':'@singledigit'}