diff --git a/.gitignore b/.gitignore index 655520b..e66cd32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,1289 @@ -Node/node_modules/ -Node/package-lock.json -.DS_Store +# Created by https://www.toptal.com/developers/gitignore/api/vim,java,node,emacs,linux,macos,dotenv,python,pycharm,windows,intellij,dotnetcore,salesforce,visualstudio,visualstudiocode,webstorm,phpstorm +# Edit at https://www.toptal.com/developers/gitignore?templates=vim,java,node,emacs,linux,macos,dotenv,python,pycharm,windows,intellij,dotnetcore,salesforce,visualstudio,visualstudiocode,webstorm,phpstorm +### dotenv ### .env + +### DotnetCore ### +# .NET Core build folders +bin/ +obj/ + +# Common node modules locations +/node_modules +/wwwroot/node_modules + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Node ### +# Logs +logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +### PhpStorm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff + +# AWS User-specific + +# Generated files + +# Sensitive or high-churn files + +# Gradle + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake + +# Mongo Explorer plugin + +# File-based project format + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# SonarLint plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +# Editor-based Rest Client + +# Android studio 3.1+ serialized cache file + +### PhpStorm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij + +### PyCharm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff + +# AWS User-specific + +# Generated files + +# Sensitive or high-churn files + +# Gradle + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake + +# Mongo Explorer plugin + +# File-based project format + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# SonarLint plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +# Editor-based Rest Client + +# Android studio 3.1+ serialized cache file + +### PyCharm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +### Salesforce ### +# GitIgnore for Salesforce Projects +# Project Settings and MetaData +.project +.settings/ +.metadata +build.properties +config + +# Apex Log as optional +apex-scripts/log + +# Eclipse specific +salesforce.schema +Referenced Packages +tmp/ +config/ +*.tmp *.bak +local.properties +.settings +.loadpath +.classpath +*.cache + +# Illuminated Cloud (IntelliJ IDEA) +IlluminatedCloud +.idea +*.iml + +# Mavensmate +*.sublime-project +*.sublime-settings +*.sublime-workspace +mm.log + +# Haoide SublimeText +.config +.deploy +.history + +# OSX-specific exclusions +.[dD][sS]_[sS]tore + +# The Welkin Suite specific +**/.localHistory + +*.sfuo + +TestCache.xml + +TestsResultsCache.xml + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.ionide + +### WebStorm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff + +# AWS User-specific + +# Generated files + +# Sensitive or high-churn files + +# Gradle + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake + +# Mongo Explorer plugin + +# File-based project format + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# SonarLint plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +# Editor-based Rest Client + +# Android studio 3.1+ serialized cache file + +### WebStorm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp_proj +*_wpftmp.csproj +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +*.code-workspace + +# Local History for Visual Studio Code + +# Windows Installer files from build outputs + +# JetBrains Rider +*.sln.iml + +### VisualStudio Patch ### +# Additional files built by Visual Studio + +# End of https://www.toptal.com/developers/gitignore/api/vim,java,node,emacs,linux,macos,dotenv,python,pycharm,windows,intellij,dotnetcore,salesforce,visualstudio,visualstudiocode,webstorm,phpstorm + +Node/node_modules/ +Node/package-lock.json diff --git a/ChatGPT/Advanced Integrations/Translate Language/extract-and-translate.ipynb b/ChatGPT/Advanced Integrations/Translate Language/extract-and-translate.ipynb new file mode 100644 index 0000000..3c4af61 --- /dev/null +++ b/ChatGPT/Advanced Integrations/Translate Language/extract-and-translate.ipynb @@ -0,0 +1,394 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "e3eff3487fe37454", + "metadata": { + "collapsed": false + }, + "source": [ + "# Translate extracted text\n", + "\n", + "This is an example of translating extracted text from a PDF file, using pdfRest and OpenAI.\n", + "\n", + "## Environment\n", + "\n", + "To run this notebook, make sure to set up an environment running Jupyter. One way to do that is to create a Python environment and activate it:\n", + "\n", + "```\n", + "python -m venv .venv\n", + ". ./.venv/bin/activate\n", + "```\n", + "\n", + "Then install Jupyter.\n", + "\n", + "```\n", + "python -m pip install jupyter\n", + "```\n", + "\n", + "You'll also need to install the other Python packages required by these sample notebooks. Those are in a file called `requirements.txt`, stored with this sample.\n", + "\n", + "```\n", + "python -m pip install -r requirements.txt\n", + "```\n", + "\n", + "Run Jupyter, opening this notebook.\n", + "\n", + "```\n", + "jupyter notebook extract-and-translate.ipynb\n", + "```\n", + "\n", + "\n", + "## API keys\n", + "\n", + "You'll need to get some API keys in order to use this example. \n", + "\n", + "- [pdfRest Get Started](https://pdfrest.com/getstarted/)\n", + "- [OpenAI Sign Up](https://platform.openai.com/signup?launch)\n", + "\n", + "Create a file called `.env` in the same directory as this notebook, and places the keys into it, like this:\n", + "\n", + "```\n", + "OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", + "PDFREST_API_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n", + "```\n", + "\n", + "First, we will start by importing some Python modules that we need, and acquiring API keys." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "initial_id", + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-30T20:34:43.329067Z", + "start_time": "2023-10-30T20:34:43.038515Z" + } + }, + "outputs": [], + "source": [ + "import os\n", + "from pathlib import Path\n", + "\n", + "import openai\n", + "import requests\n", + "from dotenv import load_dotenv\n", + "from IPython.display import display_markdown\n", + "from requests_toolbelt import MultipartEncoder\n", + "\n", + "load_dotenv()\n", + "\n", + "openai.api_key = os.getenv(\"OPENAI_API_KEY\")\n", + "pdfrest_api_key = os.getenv(\"PDFREST_API_KEY\")\n", + "\n", + "REQUEST_TIMEOUT = 30" + ] + }, + { + "cell_type": "markdown", + "id": "9882898460f23d70", + "metadata": { + "collapsed": false + }, + "source": [ + "## Extracting the text\n", + "\n", + "Below, we'll define a function that extracts the text from a PDF document represented by a path on disk. It will get the full text by page, returning the JSON data from the endpoint." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "ae86f0335be1e195", + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-10-30T20:34:43.338660Z", + "start_time": "2023-10-30T20:34:43.332339Z" + } + }, + "outputs": [], + "source": [ + "def extract_text(document: Path) -> dict:\n", + " \"\"\"Extract text on a page-by-page basis from a document, and\n", + " return the extracted text\"\"\"\n", + "\n", + " extract_endpoint_url = \"https://api.pdfrest.com/extracted-text\"\n", + "\n", + " # Define the file to upload, and request full text on a per-page basis\n", + " request_data = [\n", + " (\"file\", (document.name, document.open(mode=\"rb\"), \"application/pdf\")),\n", + " (\"full_text\", \"by_page\"),\n", + " ]\n", + "\n", + " mp_encoder_upload = MultipartEncoder(fields=request_data)\n", + "\n", + " # Let's set the headers that the upload endpoint expects.\n", + " # Since MultipartEncoder is used, the 'Content-Type' header gets set to\n", + " # 'multipart/form-data' via the content_type attribute below.\n", + " headers = {\n", + " \"Accept\": \"application/json\",\n", + " \"Content-Type\": mp_encoder_upload.content_type,\n", + " \"Api-Key\": pdfrest_api_key,\n", + " }\n", + "\n", + " print(\"Sending POST request to extract text endpoint...\")\n", + " response = requests.post(\n", + " extract_endpoint_url,\n", + " data=mp_encoder_upload,\n", + " headers=headers,\n", + " timeout=REQUEST_TIMEOUT,\n", + " )\n", + "\n", + " # Print the response status code and raise an exception if the request fails\n", + " print(\"Response status code: \" + str(response.status_code))\n", + " response.raise_for_status()\n", + "\n", + " return response.json()" + ] + }, + { + "cell_type": "markdown", + "id": "73357d14ebed2d2d", + "metadata": { + "collapsed": false + }, + "source": [ + "## TranslationChatbot\n", + "\n", + "Let's define a chatbot whose main purpose is translation. This is a Python class, which makes a persistent object that can be used for a continuing conversation.\n", + "\n", + "We start with a system instruction. The system instruction indicates to OpenAI what the purpose of the conversation is, what role it should take, and any additional instructions.\n", + "\n", + "When translating, we also prepend the material to be translated with an instruction to translate to English.\n", + "\n", + "Each interaction is recorded in `self.messages`, which contains content and a role:\n", + "\n", + "- `system` means that the content is a system instruction. System instructions are usually present at the start of a conversation, but are typically not presented to the user, for instance, in ChatGPT.\n", + "- `user` means that the content is part of the conversation that was uttered by the user.\n", + "- `assistant` means that the content is a reply from the AI.\n", + "\n", + "This class makes it easy to have a conversation with GPT-4. We call `translate_text()` to supply text to be translated, and `chat()` if we want to continue the conversation." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "767daa1177b2f942", + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-10-30T20:34:43.347460Z", + "start_time": "2023-10-30T20:34:43.343528Z" + } + }, + "outputs": [], + "source": [ + "class TranslationChatbot:\n", + " \"\"\"A chatbot that specializes in translation, but can have a continuing conversation.\"\"\"\n", + "\n", + " SYSTEM_INSTRUCTION = \"\"\"\n", + " You are a helpful translator. Given an input text, translate\n", + " it to the requested language. If there are any ambiguities,\n", + " or things that couldn't be translated, please\n", + " mention them after the translation.\n", + "\n", + " The output can use Markdown for formatting.\n", + " \"\"\"\n", + "\n", + " TRANSLATION_INSTRUCTION = \"\"\"\n", + " Please translate the following to English:\n", + "\n", + " \"\"\"\n", + "\n", + " def __init__(self):\n", + " self.messages = [\n", + " {\"content\": self.SYSTEM_INSTRUCTION, \"role\": \"system\"},\n", + " ]\n", + "\n", + " def get_openai_response(self, new_message):\n", + " \"\"\"Request chat completion from OpenAI, and update the messages with the reply. Returns the response from OpenAI.\"\"\"\n", + " self.messages.append(new_message)\n", + " response = openai.ChatCompletion.create(\n", + " model=\"gpt-4\",\n", + " temperature=0,\n", + " messages=self.messages,\n", + " )\n", + " message = response[\"choices\"][0][\"message\"]\n", + " self.messages.append(message)\n", + " return response\n", + "\n", + " def translate_text(self, text: str) -> str:\n", + " \"\"\"Translate text, and return OpenAI's reply.\"\"\"\n", + "\n", + " response = self.get_openai_response(\n", + " {\"content\": f\"{self.TRANSLATION_INSTRUCTION}{text}\", \"role\": \"user\"}\n", + " )\n", + " message = response[\"choices\"][0][\"message\"]\n", + " return message[\"content\"]\n", + "\n", + " def converse(self, text: str) -> str:\n", + " \"\"\"Add a message to the conversation, and return OpenAI's reply.\"\"\"\n", + " response = self.get_openai_response({\"content\": text, \"role\": \"user\"})\n", + " message = response[\"choices\"][0][\"message\"]\n", + " return message[\"content\"]\n", + "\n", + " def chat(self, text: str) -> str:\n", + " \"\"\"A simple method for chatting. OpenAI returns results formatted with Markdown,\n", + " and may contain text styling and lists.\"\"\"\n", + " display_markdown(self.converse(text), raw=True)" + ] + }, + { + "cell_type": "markdown", + "id": "c3afa379e92e9b37", + "metadata": { + "collapsed": false + }, + "source": [ + "## Extract the text\n", + "\n", + "Here, we simply call `extract_text()` with the path to the input document. In this case, the PDF file contains Article 1 of the [Universal Declaration of Human Rights](https://www.ohchr.org/en/human-rights/universal-declaration/), in Greek.\n", + "\n", + "After that, we get the text of the first page. As you can see from the code, the `fullText` dictionary contains an array `pages` which contains each page. The code gets the first page, indexed by `0`, and retrieves the `text` from it." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "7ba1c2806ed931cf", + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-10-30T20:34:44.065537Z", + "start_time": "2023-10-30T20:34:43.348213Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sending POST request to extract text endpoint...\n", + "Response status code: 200\n" + ] + } + ], + "source": [ + "extracted_text = extract_text(Path(\"pdf/UDHR_Article_1_Greek.pdf\"))\n", + "page_1_text = extracted_text[\"fullText\"][\"pages\"][0][\"text\"]" + ] + }, + { + "cell_type": "markdown", + "id": "7fb331f4c047da22", + "metadata": { + "collapsed": false + }, + "source": [ + "\n", + "## Using the TranslationChatbot\n", + "\n", + "Create a `TranslationChatbot`. Use it to translate the text, and ask it to translate the text of the page. \n", + "\n", + "The chatbot retains the history of the conversation, so that we can make further inquiries about the text that was translated.\n", + "\n", + "Since this code is running in the context of a Jupyter notebook, we use `display_markdown()` to print output with style attached. GPT-4 also provides Markdown formatted content, so if the response has any lists or tables in it, they will render nicely." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "f05bc6af1d6f04a", + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-10-30T20:36:24.448339Z", + "start_time": "2023-10-30T20:36:19.886747Z" + } + }, + "outputs": [ + { + "data": { + "text/markdown": "**Text before translation:** ΑΡΘΡΟ 1 ' Ολοι οι άνθρωποι γεννιούνται ελεύθεροι και ίσοι στην αξιοπρέπεια και τα δικαιώματα. Είναι προικισμένοι με λογική και συνείδηση, και οφείλουν να συμπεριφέρονται μεταξύ τους με πνεύμα αδελφοσύνης." + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": "**Text after translation:** ARTICLE 1: All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood." + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "chatbot = TranslationChatbot()\n", + "display_markdown(f\"**Text before translation:** {page_1_text}\", raw=True)\n", + "translated_text = chatbot.translate_text(page_1_text)\n", + "display_markdown(f\"**Text after translation:** {translated_text}\", raw=True)" + ] + }, + { + "cell_type": "markdown", + "id": "cb36888711716303", + "metadata": { + "collapsed": false + }, + "source": [ + "## Making additional queries about the text\n", + "\n", + "Using the `chatbot.chat()` method, we can interact further with the chatbot about the translation. For instance, we can ask about the sentiment of the text." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "ddccc909d0924401", + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-10-30T20:36:44.649085Z", + "start_time": "2023-10-30T20:36:35.843271Z" + } + }, + "outputs": [ + { + "data": { + "text/markdown": "The sentiment of the translated text is one of universal equality, dignity, and fraternity. It emphasizes the inherent freedom, equality, and rights that every human being is born with. The text also underscores the importance of reason and conscience in human behavior, advocating for a spirit of brotherhood among all people. This might invoke feelings of unity, respect, and mutual understanding. It could also inspire a sense of responsibility towards treating others with dignity and fairness." + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "chatbot.chat(\n", + " \"Can you summarize the sentiment of the translated text? What kind of feelings might it invoke?\"\n", + ")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/ChatGPT/Advanced Integrations/Translate Language/pdf/UDHR_Article_1_Greek.pdf b/ChatGPT/Advanced Integrations/Translate Language/pdf/UDHR_Article_1_Greek.pdf new file mode 100644 index 0000000..6bd4f19 Binary files /dev/null and b/ChatGPT/Advanced Integrations/Translate Language/pdf/UDHR_Article_1_Greek.pdf differ diff --git a/ChatGPT/Advanced Integrations/Translate Language/requirements.txt b/ChatGPT/Advanced Integrations/Translate Language/requirements.txt new file mode 100644 index 0000000..d155da3 --- /dev/null +++ b/ChatGPT/Advanced Integrations/Translate Language/requirements.txt @@ -0,0 +1,9 @@ +# This file is @generated by PDM. +# Please do not edit it manually. + +openai>=0.28.1 +python-dotenv>=1.0.0 +pyyaml>=6.0.1 +requests>=2.31.0 +requests-toolbelt>=1.0.0 +