[
  {
    "path": ".github/ISSUE_TEMPLATE/documentation.md",
    "content": "---\nname: 📚 Documentation\nabout: Report an issue related to documentation\nlabels: \"documentation\"\n---\n\n## 📚 Documentation\n\n(A clear and concise description of what the issue is.)\n\n### Have you read the [Contributing Guidelines on Pull Requests](https://github.com/IndianOpenSourceFoundation/dynamic-cli/blob/master/CONTRIBUTING.md#reporting-new-issues)?\n\n(Write your answer here.)\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature.md",
    "content": "---\nname: 🚀 Feature\nabout: Submit a proposal for a new feature\nlabels: \"feature\"\n---\n\n## 🚀 Feature\n\n(A clear and concise description of what the feature is.)\n\n### Have you read the [Contributing Guidelines on Pull Requests](https://github.com/IndianOpenSourceFoundation/dynamic-cli/blob/master/CONTRIBUTING.md#reporting-new-issues)?\n\n(Write your answer here.)\n\n## Motivation\n\n(Please outline the motivation for the proposal.)\n\n## Pitch\n\n(Please explain why this feature should be implemented and how it would be used.)\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/proposal.md",
    "content": "---\nname: 💥 Proposal\nabout: Propose a non-trivial change to dynamic-cli\nlabels: \"proposal\"\n---\n\n## 💥 Proposal\n\n(A clear and concise description of what the proposal is.)\n\n### Have you read the [Contributing Guidelines on Pull Requests](https://github.com/IndianOpenSourceFoundation/dynamic-cli/blob/master/CONTRIBUTING.md#reporting-new-issues)?\n\n(Write your answer here.)\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "## Related Issue\n<!--\n- Info about Issue or bug\n-->\n\nCloses: #[issue number that will be closed through this PR]\n\n\n## Describe the changes you've made\n<!-- \nA clear and concise description of what you have done to successfully close your assigned issue. Any new files? or anything you feel to let us know!\n-->\n\n\n## Checklist:\n\n<!--\nExample how to mark a checkbox:-\n- [x] My code follows the code style of this project.\n-->\n\n- [ ] My code follows the style guidelines of this project.\n- [ ] I have performed a self-review of my own code.\n- [ ] I have commented my code, particularly in hard-to-understand areas.\n- [ ] I have made corresponding changes to the documentation.\n- [ ] My changes generate no new warnings.\n\n## Screenshots\n\n|        Original         |          Updated           |\n| :---------------------: | :------------------------: |\n| **original screenshot** | <b>updated screenshot </b> |\n"
  },
  {
    "path": ".github/workflows/codacy-analysis.yaml",
    "content": "name: Codacy Security Scan\n\non:\n  push:\n    branches: [\"master\", \"main\"]\n  pull_request:\n    branches: [\"master\", \"main\"]\n\njobs:\n  codacy-security-scan:\n    name: Codacy Security Scan\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@master\n\n      - name: Run Codacy Analysis CLI\n        uses: codacy/codacy-analysis-cli-action@master\n        with:\n          output: results.sarif\n          format: sarif\n          # Adjust severity of non-security issues\n          gh-code-scanning-compat: true\n          # Force 0 exit code to allow SARIF file generation\n          # This will handover control about PR rejection to the GitHub side\n          max-allowed-issues: 2147483647\n\n      # Upload the SARIF file generated in the previous step\n      - name: Upload SARIF results file\n        uses: github/codeql-action/upload-sarif@main\n        with:\n          sarif_file: results.sarif\n"
  },
  {
    "path": ".github/workflows/codeql-analysis.yml",
    "content": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# You may wish to alter this file to override the set of languages analyzed,\n# or to provide custom queries or build logic.\n#\n# ******** NOTE ********\n# We have attempted to detect the languages in your repository. Please check\n# the `language` matrix defined below to confirm you have the correct set of\n# supported CodeQL languages.\n#\nname: \"CodeQL\"\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    # The branches below must be a subset of the branches above\n    branches: [ master ]\n  schedule:\n    - cron: '37 2 * * 5'\n\njobs:\n  analyze:\n    name: Analyze\n    runs-on: ubuntu-latest\n\n    strategy:\n      fail-fast: false\n      matrix:\n        language: [ 'python' ]\n        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]\n        # Learn more:\n        # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed\n\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v2\n\n    # Initializes the CodeQL tools for scanning.\n    - name: Initialize CodeQL\n      uses: github/codeql-action/init@v1\n      with:\n        languages: ${{ matrix.language }}\n        # If you wish to specify custom queries, you can do so here or in a config file.\n        # By default, queries listed here will override any specified in a config file.\n        # Prefix the list here with \"+\" to use these queries and those in the config file.\n        # queries: ./path/to/local/query, your-org/your-repo/queries@main\n\n    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).\n    # If this step fails, then you should remove it and run the build manually (see below)\n    - name: Autobuild\n      uses: github/codeql-action/autobuild@v1\n\n    # ℹ️ Command-line programs to run using the OS shell.\n    # 📚 https://git.io/JvXDl\n\n    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines\n    #    and modify them (or add more) to build your code if your project\n    #    uses a compiled language\n\n    #- run: |\n    #   make bootstrap\n    #   make release\n\n    - name: Perform CodeQL Analysis\n      uses: github/codeql-action/analyze@v1\n"
  },
  {
    "path": ".github/workflows/greetings.yml",
    "content": "name: Greetings\n\non: [pull_request_target, issues]\n\njobs:\n  greeting:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/first-interaction@v1\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          issue-message: \"Hi👋 thanks for creating your first issue for IOSF, Will get back to you soon !. \"\n          pr-message: \"🎉Congratulations!!🎉 for making your first PR , our mentors will review it soon.\"\n"
  },
  {
    "path": ".gitignore",
    "content": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\nshare/python-wheels/\n*.egg-info/\n.installed.cfg\n*.egg\nMANIFEST\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.nox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n*.py,cover\n.hypothesis/\n.pytest_cache/\ncover/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\ndb.sqlite3\ndb.sqlite3-journal\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\n.pybuilder/\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# IPython\nprofile_default/\nipython_config.py\n\n# pyenv\n#   For a library or package, you might want to ignore these files since the code is\n#   intended to run in multiple environments; otherwise, check them in:\n# .python-version\n\n# pipenv\n#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.\n#   However, in case of collaboration, if having platform-specific dependencies or dependencies\n#   having no cross-platform support, pipenv may install dependencies that don't work, or not\n#   install all needed dependencies.\n#Pipfile.lock\n\n# poetry\n#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.\n#   This is especially recommended for binary packages to ensure reproducibility, and is more\n#   commonly ignored for libraries.\n#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control\n#poetry.lock\n\n# PEP 582; used by e.g. github.com/David-OConnor/pyflow\n__pypackages__/\n\n# Celery stuff\ncelerybeat-schedule\ncelerybeat.pid\n\n# SageMath parsed files\n*.sage.py\n\n# Environments\n.env\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\ntemp/*\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mkdocs documentation\n/site\n\n# mypy\n.mypy_cache/\n.dmypy.json\ndmypy.json\n\n# Pyre type checker\n.pyre/\n\n# pytype static type analyzer\n.pytype/\n\n# Cython debug symbols\ncython_debug/\n\n# PyCharm\n#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can\n#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore\n#  and can be added to the global gitignore or merged into this file.  For a more nuclear\n#  option (not recommended) you can uncomment the following to ignore the entire idea folder.\n#.idea/\n\n"
  },
  {
    "path": ".travis.yml",
    "content": "# Travis-CI Config file\nos: linux\n\ndist: focal\n\nlanguage: python\n\n# The test will run on the given python versions\npython: \n  - \"3.7\"\n  - \"3.8\"\n  - \"3.9\" \n\n# Installing all the dependencies before testing\ninstall:\n  - pip3 install -r requirements.txt\n\n# Test command\nscript:\n  - py.test-3 -v\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Code of Conduct\n\n## Our Pledge\n\nFor the betterment of open-source and in order to make a welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of their age, body size disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, skin tone, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment includes:\n\n\n\n- Using welcoming and inclusive language\n\n\n- Being respectful of differing viewpoints and experiences\n\n\n- Gracefully accepting constructive criticism\n\n\n- Focusing on what is best for the community\n\n\n- Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants includes:\n\n\n- The use of sexualized language or imagery and unwelcome sexual attention or advances\n\n\n- Trolling, insulting/derogatory comments, and personal or political attacks\n\n\n- Public or private harassment\n\n\n- Publishing others' private information, such as a physical or electronic address, without explicit permission\n\n\n- Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed a representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ping@iosf.in. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "\n## 🤝First time contributing? We will help you out.👍\n\n![GitHub custom open for collaboration](https://img.shields.io/badge/Open%20For-Collaboration-brightgreen?style=for-the-badge)\n\nRefer to the following articles on the basics of Git and Github and can also contact the Project Mentors, in case you are stuck:\n\n- [Getting started with Git and GitHub](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github)\n\n\n- [Forking a Repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)\n\n\n- [Cloning a Repo](https://help.github.com/en/desktop/contributing-to-projects/creating-a-pull-request)\n\n\n- [How to create a Pull Request](https://opensource.com/article/19/7/create-pull-request-github)\n\n***If you don't have git on your machine, [install it](https://help.github.com/articles/set-up-git/).***\n\n## 💥 How to Contribute\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/)\n\n\n\n- Take a look at the Existing [Issues](https://github.com/IndianOpenSourceFoundation/dynamic-cli.git) or create your own Issues!\n\n- Wait for the Issue to be assigned to you after which you can start working on it.\n\n- Fork the Repo and create a Branch for any Issue that you are working upon.\n\n- Read the [Code of Conduct](https://github.com/IndianOpenSourceFoundation/dynamic-cli.git)\n\n- Create a Pull Request which will be promptly reviewed and suggestions would be added to improve it.\n\n- Add Screenshots to help us know what this Script is all about.\n\n## ⭐ How to make a pull request  \n\n**1.** Fork [this](https://github.com/IndianOpenSourceFoundation/dynamic-cli/fork) repository.\nClick on the <a href=\"https://github.com/IndianOpenSourceFoundation/dynamic-cli.git\"><img src=\"https://img.icons8.com/ios/24/000000/code-fork.png\"></a> symbol at the top right corner.\n\n**2.** Clone the forked repository. \n\n```bash\ngit clone https://github.com/<your-github-username>/project_name.git\n```\n\n**3.** Navigate to the project directory.\n\n```bash\ncd dynamic-cli\n```\n\n**4.** Make changes in source code.\n\n**5.** Stage your changes and commit\n\n```bash\n#Add changes to Index\ngit add .\n\n#Commit to the local repo\ngit commit -m \"<your_commit_message>\"\n```\n\n**7.** Push your local commits to the remote repo.\n\n```bash\ngit push\n```\n\n**8.** Create a [PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) !\n\n**9.** **Congratulations!** Sit and relax, you've made your contribution to Dynamic-CLI project.\n\n***:trophy: After this, project leaders and mentors will review the changes and will merge your PR if they are found good, otherwise we will suggest the required changes.***\n\n## Style guide for git commit messages  \n\n*Here's a list of some good to have points, that can add more value to your contribution logs.*\n\n\n\n- Use the present tense (example: \"Add feature\" and not \"Added feature\")\n\n- Use the imperative mood (example: \"Move item to...\", instead of \"Moves item to...\")\n\n- Limit the first line (also called subject line) to 50 characters or less\n\n- Capitalize the subject line\n\n- Separate subject from body with a blank line\n\n- Do not end the subject line with a period\n\n- Wrap the body at 72 characters\n\n- Use the body to explain what, why, vs, and how\n\n- Reference issues and pull requests liberally after the first line\n\nFor more detailed reference to the above points, refer [here](https://chris.beams.io/posts/git-commit.)\n\n## 💥 Issues\nFor major changes, you are welcomed to open an issue  about what you would like to contribute. Enhancements will be appreciated.\n\n### All the Best!🥇\n\n<p align = \"center\">\n\n<a href=\"https://github.com/IndianOpenSourceFoundation\"> <img src=\"http://ForTheBadge.com/images/badges/built-by-developers.svg\" alt=\"built by developers\"></a>\n[![built with love](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/IndianOpenSourceFoundation/dynamic-cli.git)\n\n</p>\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "![dynamic-cli](https://socialify.git.ci/IndianOpenSourceFoundation/dynamic-cli/image?description=1&descriptionEditable=A%20Modern%2C%20user-friendly%20command-line%20%20for%20the%20API%20testing%2C%20and%20if%20you%27re%20stuck%20-%20Search%20and%20browse%20StackOverflow%20without%20leaving%20the%20CLI&font=Inter&forks=1&issues=1&language=1&owner=1&pattern=Plus&pulls=1&stargazers=1&theme=Light)\n\n![dynamic-cli-cropped](https://user-images.githubusercontent.com/31731827/147034382-2e8b724c-f196-4e98-b524-a61439601671.png)\n\n\n ![PyPI](https://img.shields.io/pypi/v/dynamic-cli?color=brightgreen)\n [![<Sonarcloud quality gate>](https://sonarcloud.io/api/project_badges/measure?project=IndianOpenSourceFoundation_dynamic-cli&metric=alert_status)](https://sonarcloud.io/dashboard?id=IndianOpenSourceFoundation_dynamic-cli)\n[![Downloads](https://pepy.tech/badge/dynamic-cli/month)](https://pepy.tech/project/dynamic-cli)\n[![Downloads](https://pepy.tech/badge/dynamic-cli)](https://pepy.tech/project/dynamic-cli)\n [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![PyPI](https://img.shields.io/pypi/pyversions/dynamic-cli.svg)](https://pypi.python.org/pypi/dynamic-cli/) \n<!-- [![PyPI Downloads](https://img.shields.io/pypi/dm/dynamic-cli)](https://pypi.org/project/dynamic-cli/)  -->\n\nA Modern, user-friendly command-line HTTP client for the API testing, and if you're stuck - Search and browse StackOverflow without leaving the CLI\n\n## Why `Dynamic-cli`?\n\n### The Command Line Utility\n\nAlthough the Stackoverflow website is really cool, it can be **tough to remember the same question that you faced earlier** :\n\n* Countless answers, you can save it to playbook\n* Toggle between multiple answers is easy\n* Are you a developer ? Integrate your own feature and install it\n\n## `dynamic-cli` - A Supercharged Command Line Utility\n\n<!-- ![dynamic-gif](https://user-images.githubusercontent.com/31731827/146558085-c3e9f396-9e48-482f-a1e1-6e24808ef7f9.gif) -->\n\n\n![dynamic_search](https://user-images.githubusercontent.com/72400676/159194727-ca939e06-2c9f-4c8b-ad27-1948e9c82010.gif)\t\n\n\n![dynamic_saving_to_playbook](https://user-images.githubusercontent.com/72400676/159194738-004fa3f0-9888-4a35-b15f-055b351b4481.gif)\n![dynamic_retrieving_from_playbook](https://user-images.githubusercontent.com/72400676/159194746-e171c00e-6c8e-4896-8ab9-50ada2cd1e37.gif)\n\t\n![dynamic_api](https://user-images.githubusercontent.com/72400676/159194711-3a31fc35-7cbc-40e6-9f5d-e33c894bb6cd.gif)\n\n\n## Index\n\n* [Installation](#installation)\n    * [Pip Installation](#pip-installation)\n    * [Virtual Environment Installation](#virtual-environment-installation)\n    * [Supported Python Versions](#supported-python-versions)\n    * [Supported Platforms](#supported-platforms)\n    * [Windows Support](#windows-support)\n* [Developer Installation](#developer-installation)\n* [License](#license)\n* [Contribution Guidelines](https://github.com/IndianOpenSourceFoundation/dynamic-cli/blob/master/CONTRIBUTING.md)\n* [Code Of Conduct](https://github.com/IndianOpenSourceFoundation/dynamic-cli/blob/master/CODE_OF_CONDUCT.md)\n* [New to Open Source ?](#contributing)\n\n\n## Arguments⚙\n\nUsage: Dynamic [OPTIONS] <br>\n\nA Modern, user-friendly command-line HTTP client for the API testing, and if you're stuck - Search and browse StackOverflow without leaving the CLI. <br>\n\nOptions: <br>\n\n`-st, --start -> Introduces Dynamic CLI` <br>\n`-v, --version -> Gives the Version of the CLI` <br>\n`-s, --search -> Search a question on Stackoverflow` <br>\n`-no, --notion -> Open browser to login to Notion.so` <br>\n`-d, --debug -> Turn on Debugging mode` <br>\n`-c, --custom -> Setup a custom API key` <br>\n`-p, --playbook -> To access all the answers saved in the playbook` <br>\t\n`-h, --help -> Shows this message and exit` <br>\n`-GET -> Make a GET request to an API` <br>\n`-POST -> Make a POST request to an API` <br>\n`-DELETE -> Make a DELETE request to an API` <br>\n\n## Installation\n\n### Pip Installation\n\n[![PyPI version](https://badge.fury.io/py/dynamic-cli.svg)](http://badge.fury.io/py/dynamic-cli) [![PyPI](https://img.shields.io/pypi/pyversions/dynamic-cli.svg)](https://pypi.python.org/pypi/dynamic-cli/)\n\n`dynamic-cli` is hosted on [PyPI](https://pypi.python.org/pypi/dynamic-cli).  The following command will install `Dynamic-cli`:\n\n    pip3 install dynamic-cli\n\nYou can also install the latest `dynamic-cli` from GitHub source which can contain changes not yet pushed to PyPI:\n\n    pip3 install git+https://github.com/IndianOpenSourceFoundation/dynamic-cli.git\n\nIf you are not installing in a `virtualenv`, you might need to run with `sudo`:\n\n    sudo pip3 install dynamic-cli\n\n#### `pip3`\n\nDepending on your setup, you might also want to run `pip3` with the [`-H flag`](http://stackoverflow.com/a/28619739):\n\n    sudo -H pip3 install dynamic-cli\n\nFor most linux users, `pip3` can be installed on your system using the `python3-pip` package.\n\nFor example, Ubuntu users can run:\n\n    sudo apt-get install python3-pip\n\n\n### Virtual Environment Installation\n\nYou can install Python packages in a [`virtualenv`](http://docs.python-guide.org/en/latest/dev/virtualenvs/) to avoid potential issues with dependencies or permissions.\n\nIf you are a Windows user or if you would like more details on `virtualenv`, check out this [guide](http://docs.python-guide.org/en/latest/dev/virtualenvs/).\n\nInstall `virtualenv` and `virtualenvwrapper`:\n\n    pip3 install virtualenv\n    pip3 install virtualenvwrapper\n    export WORKON_HOME=~/.virtualenvs\n    source /usr/local/bin/virtualenvwrapper.sh\n\nCreate a `dynamic-cli` `virtualenv` and install `dynamic-cli`:\n\n    mkvirtualenv dynamic-cli\n    pip3 install dynamic-cli\n\nIf the `pip` install does not work, you might be running Python 2 by default.  Check what version of Python you are running:\n\n    python --version\n\nIf the call above results in Python 2, find the path for Python 3:\n\n    which python3  # Python 3 path for mkvirtualenv's --python option\n\nInstall Python 3 if needed.  Set the Python version when calling `mkvirtualenv`:\n\n    mkvirtualenv --python [Python 3 path from above] dynamic-cli\n    pip3 install dynamic-cli\n\nIf you want to activate the `dynamic-cli` `virtualenv` again later, run:\n\n    workon dynamic-cli\n\nTo deactivate the `dynamic-cli` `virtualenv`, run:\n\n    deactivate\n\n\n### Supported Python Versions\n\n* Python 3.5 - Tested\n* Python 3.6 - Tested\n* Python 3.7 - Tested\n* Python 3.8 - Tested\n\n### Supported Platforms\n\n* Mac OS X\n    * Tested on OS X 11.16.1\n* Linux, Unix\n    * Tested on Ubuntu 20 LTS\n* Windows*\n    * Tested on Windows 10/11 with WSL only [Currently, you need [WSL](https://docs.microsoft.com/en-us/windows/wsl/install) for this]\n\n### Windows Support\n\n`dynamic-cli` has been tested on Windows 10/11 with [WSL](https://docs.microsoft.com/en-us/windows/wsl/install) installed. Please read the doc [here](https://github.com/IndianOpenSourceFoundation/dynamic-cli/blob/master/window_setup.md)\n\n\n\n## Developer Installation📦\n\n**1.** Installing pip\n\n```shell\nsudo apt-get install python3-pip\n```\n\n**2.** Clone this repository to your local drive\n\n```shell\ngit clone https://github.com/IndianOpenSourceFoundation/dynamic-cli.git\n```\n\n**3.** Go to dynamic directory\n\n```shell\ncd dynamic-cli/\n```\n\n**4.** Install dependencies\n\n```shell\npip3 install -r requirements.txt\n```\n\n**5.** Install with pip\n\n```shell\npip3 install -e .\n```\n\n**If you face some issue running dynamic on mac, follow the below instructions**\n\n> **Note for mac users**: Make sure to add these lines in you `~/.bashrc` or `~/.zhsrc`(*depending upon your shell*) 👇\n> ```bash\n> export LC_ALL=en_US.UTF-8\n> export LANG=en_US.UTF-8\n> export LC_CTYPE=en_US.UTF-8\n> ```\n\n\n\n## License\nThe project is licensed under the GNU General Public License v3. Check out [`LICENSE`](https://github.com/IndianOpenSourceFoundation/dynamic-cli/blob/master/LICENSE)\n\n### Contributing\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat&logo=git&logoColor=white)](https://github.com/IndianOpenSourceFoundation/dynamic-cli/pulls) [![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/IndianOpenSourceFoundation/dynamic-cli)\n\n**We're accepting PRs for our open and unassigned [issues](https://github.com/IndianOpenSourceFoundation/dynamic-cli/issues)**. Please check [CONTRIBUTING.md](CONTRIBUTING.md). We'd love your contributions! **Kindly follow the steps below to get started:**\n\n**1.** Fork [this](https://github.com/IndianOpenSourceFoundation/dynamic-cli/fork) repository.\n\n**2.** Clone the forked repository.\n```bash\ngit clone https://github.com/<your-github-username>/project_name.git\n```\n\n**3.** Navigate to the project directory.\n\n```bash\ncd dynamic-cli\n```\n\n**4.** Make changes in source code.\n<br />\nP.S. If you want to add emojis 😁, use `unicodes`.\nEmoji `unicodes` can be found at [https://unicode.org/emoji/charts/full-emoji-list.html](https://unicode.org/emoji/charts/full-emoji-list.html)\n<br />\nTo include an emoji in a string, copy the unicode (Eg: `U+1F600`), replace `+` with `000` and\nprefix it with a `\\`.\n<br />\nEg: `\\U0001F604`\n\n**5.** Stage your changes and commit\n\n```bash\n# Add changes to Index\ngit add .\n\n# Commit to the local repo\ngit commit -m \"<your_commit_message>\"\n```\n\n**7.** Push your local commits to the remote repo.\n\n```bash\ngit push\n```\n\n**8.** Create a [PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) !\n\n**9.** **Congratulations!** Sit and relax, you've made your contribution to Dynamic-CLI project.\n\n### Testing\nWe also have written **unit tests for API features** of dynamic-cli, if you have made changes to that section you can run tests as follows:\n\n**1.** To run every test in dynamic-cli:\n```bash\npytest\n```\n**2.** To run test related to only one feature for ex. for GET API Feature:\n```bash\npytest -k test_get_api\n```\n\n### Dynamic CLI is a part of these open source programs\n\n\n<p align=\"center\">\n <a>\n <img  width=\"40%\" height=\"10%\" src=\"https://raw.githubusercontent.com/GirlScriptSummerOfCode/MentorshipProgram/master/GSsoc%20Type%20Logo%20Black.png\">\n\n## Contributors👨🏽‍💻\n\n### Credit goes to these people:✨\n\n<table>\n\t<tr>\n\t\t<td>\n\t\t\t<a href=\"https://github.com/IndianOpenSourceFoundation/dynamic-cli/graphs/contributors\">\n  <img src=\"https://contrib.rocks/image?repo=IndianOpenSourceFoundation/dynamic-cli\" alt=\"Dynamic Cli Contributors\"/>\n</a>\n\t\t</td>\n\t</tr>\n</table>\n\n\n"
  },
  {
    "path": "dynamic/__init__.py",
    "content": ""
  },
  {
    "path": "dynamic/__main__.py",
    "content": "#!/usr/bin/env python\n\n\nimport sys\nimport os\nimport argparse\n\nroot = os.path.dirname(__file__)\nsys.path.append(root)\n#from dynamic.search import Search\nfrom search import Search\n\nversion = \"1.1.0\"\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\n    \"-st\", \"--start\", help=\"introduce you to dynamic\", action=\"store_true\"\n)\n\nparser.add_argument(\n    \"-s\", \"--search\", help=\"search a question on StackOverflow\", action=\"store_true\"\n)\n\nparser.add_argument(\n    \"-v\", \"--version\", version=f\"Dynamic-CLI version {version}\", action=\"version\"\n)\n\n\nparser.add_argument(\n    \"-n\",\n    \"--new\",\n    help=\"Opens browser to create new StackOverflow question.\",\n    const=True,\n    metavar=\"title (optional)\",\n    nargs=\"?\",\n)\n\nparser.add_argument(\n    \"-file\", \"--file\", help=\"Save answer to a file\", action=\"store_true\"\n)\n\nparser.add_argument(\"-c\", \"--custom\", help=\"Set a custom API key\", action=\"store_true\")\n\nparser.add_argument(\n    \"-u\", \"--update\", help=\"Check updates for the application\", action=\"store_true\"\n)\n\nparser.add_argument(\"-GET\", help=\"Make a GET request to an API\", action=\"store_true\")\n\nparser.add_argument(\"-POST\", help=\"Make a POST request to an API\", action=\"store_true\")\n\nparser.add_argument(\n    \"-DELETE\", help=\"Make a DELETE request to an API\", action=\"store_true\"\n)\n\nparser.add_argument(\n    \"-p\", \"--playbook\", help=\"View and organise the playbook\", action=\"store_true\"\n)\n\nparser.add_argument(\n    \"-no\",\n    \"--notion\",\n    help=\"\\\n                    Login to your Notion account to save playbook.\\\n                    Opens a browser window for you to login to\\\n                    your Notion accout\",\n    action=\"store_true\",\n)\n\nARGV = parser.parse_args()\n\nsearch_flag = Search(ARGV)\n\n\ndef main():\n    if ARGV.start:\n        print(\n            \"\"\"\\U0001F604 Hello and Welcome to Dynamic CLI\n                 \\U0001F917 Use the following commands to get started\n                 \\U0001F50E Search on StackOverflow with '-s'\n                 \\U0001F4C4 Open browser to create new Stack Overflow question with '-n [title(optional)]'\n                 \\U0001F4C2 Save answer to a file with '-file'\n                 \\U00002728 Know the version of Dynamic CLI with '-v'\n                 \\U0001F609 See this message again with '-st'\n                 \\U00002755 Get help with '-h'\n                \"\"\"\n        )\n    else:\n        search_flag.search_args()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "dynamic/api_test.py",
    "content": "import json\nimport requests\nfrom pygments import highlight, lexers, formatters\n\n\nclass ApiTesting:\n    default_url = \"https://127.0.0.1:8000\"\n    default_headers = {}\n    invalid_schema_message = (\n        \"Check whether the URL is valid or check if\"\n        + \"the localhost server is active or not\"\n    )\n    # fetches the input data for making a request\n\n    @classmethod\n    def fetch_input_url(cls):\n        request_url = cls.default_url\n        request_headers = cls.default_headers\n        input_url = input(\"Enter URL: \")\n        input_headers = input(\"Enter Headers: \")\n        if input_url != \"\":\n            request_url = input_url\n        if input_headers != \"\":\n            try:\n                request_headers = json.loads(input_headers)\n            except Exception:\n                print(\"Failed to parse Input Headers\")\n        # Check whether the request_url has an endpoint or not\n        has_endpoint = cls.__check_endpoint(request_url)\n\n        # Check if http:// or https:// is present in request_url\n        has_protocol = cls.__check_protocol(request_url)\n\n        if not (has_protocol):\n            request_url = \"https://\" + request_url\n\n        # Ask the user for endpoint if not present in request_url\n        if not (has_endpoint):\n            if request_url[-1] == \"/\":\n                endpoint = input(\"Input endpoint \" +\n                                 \"(Without the starting slash): \")\n            else:\n                endpoint = input(\"Input endpoint (With the starting slash): \")\n            request_url += endpoint\n\n        print(\"Trying ...\\u26A1\")\n        return {\n            \"request_url\": request_url,\n            \"request_headers\": request_headers,\n        }\n\n    @classmethod\n    def read_data_from_file(cls):\n        filename = input(\"Enter a filename (response_data.json)\")\n        data = {}\n        if filename.strip() == \"\":\n            filename = \"response_data.json\"\n            print(f\"filename empty, so default file {filename} is used \")\n        with open(filename, \"r\") as reader:\n            file_content = reader.read()\n            try:\n                json_data = json.loads(file_content)\n                data = json_data.get(\"data\")\n                # Make sure the data is not None and send\n            except json.JSONDecodeError:\n                print(\"Unable to parse the file, Please try again\")\n                cls.read_data_from_file()\n        return data\n\n    @classmethod\n    def enter_data_payload(cls):\n        print(\"Option 1: For sending data payload from terminal\\n\")\n        print(\"Option 2: For sending data payload by reading from json file\\n\")\n        store = int(input(\"Please choose the above options? (1/2)\"))\n\n        data = {}\n        if store == 1:\n            data = input(\"Enter data as key value pairs\")\n            try:\n                data = json.loads(data)\n            except Exception as exception_obj:\n                print(\n                    f\"Unable to load the data due to {exception_obj}, please try again \\n\"\n                )\n                cls.enter_data_payload()\n        elif store == 2:\n            data = cls.read_data_from_file()\n        else:\n            print(\n                f\"you have entered {store}, please choose from above options\")\n            cls.enter_data_payload()\n        return data\n\n    @classmethod\n    def fetch_payload_data(cls):\n        store = input(\"Do you want to send data payload? (Y/N)\")\n        data = None\n        if store.lower() == \"y\":\n            data = cls.enter_data_payload()\n\n        elif store.lower() == \"n\":\n            data = {}\n        else:\n            print(\n                f\"You have entered {store}, please enter from the above options\")\n            cls.fetch_payload_data()\n        return data\n\n    # saves the json response into a file\n    @classmethod\n    def save_response_data(cls, response_data):\n        store_data = input(\"Store response data? (Y/N): \")\n        if store_data.lower() == \"y\":\n            filename = input(\"Enter a filename (response_data.json)\")\n            if filename == \"\":\n                filename = \"response_data.json\"\n            with open(filename, \"w\") as jsonFile:\n                json.dump(response_data, jsonFile, indent=4)\n            print(f\"Response data stored in {filename}\")\n        elif (store_data.lower()) == \"n\":\n            print(\n                f\"You have entered {store_data}, So the response is not saved\")\n        else:\n            print(f\"You have entered {store_data}, please enter either Y or N\")\n            cls.save_response_data(response_data)\n\n    # formats the response data and prints it in json on console\n    @classmethod\n    def print_response_json(cls, response):\n        print(f\"Reponse Status Code: {response.status_code}\")\n        response_data = json.loads(response.content)\n        parsed_json = json.dumps(response_data, indent=4)\n        output_json = highlight(\n            parsed_json, lexers.JsonLexer(), formatters.TerminalFormatter()\n        )\n        print(output_json)\n\n    # Make GET request\n    @classmethod\n    def get_request(cls):\n        request_data = cls.fetch_input_url()\n        # Make GET request and store the response in response_data.json\n        try:\n            response = requests.get(\n                request_data[\"request_url\"], headers=request_data[\"request_headers\"]\n            )\n            cls.print_response_json(response)\n            response_data = json.loads(response.content)\n            cls.save_response_data(response_data)\n            return response.json()\n        except requests.exceptions.InvalidSchema:\n            print(cls.invalid_schema_message)\n        except Exception as exception_obj:\n            print(exception_obj)\n\n    # Make a POST request\n    @classmethod\n    def post_request(cls):\n        request_data = cls.fetch_input_url()\n        data = cls.fetch_payload_data()\n        try:\n            response = requests.post(\n                url=request_data[\"request_url\"],\n                headers=request_data[\"request_headers\"],\n                data=data,\n            )\n            cls.print_response_json(response)\n            response_data = json.loads(response.content)\n            cls.save_response_data(response_data)\n\n            return response\n\n        except requests.exceptions.InvalidSchema:\n            print(cls.invalid_schema_message)\n        except Exception as exception_obj:\n            print(exception_obj)\n\n    # Make a delete request\n    @classmethod\n    def delete_request(cls):\n        # request_data contains dictionary of inputs entered by user\n        request_data = cls.fetch_input_url()\n        try:\n            response = requests.delete(\n                request_data[\"request_url\"], headers=request_data[\"request_headers\"]\n            )\n            cls.print_response_json(response)\n            response_data = json.loads(response.content)\n            cls.save_response_data(response_data)\n\n        except requests.exceptions.InvalidSchema:\n            print(cls.invalid_schema_message)\n        except Exception as exception_obj:\n            print(exception_obj)\n\n    @classmethod\n    def __check_endpoint(cls, request_url):\n        if request_url == cls.default_url:\n            return False\n        else:\n            return True\n\n    @classmethod\n    def __check_protocol(cls, request_url):\n        if request_url[:4] == \"http\":\n            return True\n        else:\n            return False\n"
  },
  {
    "path": "dynamic/error.py",
    "content": "from termcolor import colored\r\n\r\n\r\nclass SearchError:\r\n    def __init__(self, error_statement, suggestion=\"Try again\"):\r\n        # the error statement\r\n        self.error_statement = error_statement\r\n\r\n        # the suggestion statement\r\n        self.suggestion = suggestion\r\n\r\n        self.evoke_search_error(self.error_statement)\r\n\r\n    def evoke_search_error(self, error_statement):\r\n        print_text = [\r\n            colored(error_statement, \"red\"),\r\n            colored(self.suggestion, \"green\"),\r\n        ]\r\n        for text_to_print in print_text:\r\n            print(text_to_print)\r\n\r\n\r\nclass LoginError:\r\n    def __init__(self, error_statement, success=False):\r\n        \"\"\"\r\n        Implements error printing for User Login\r\n        :error_statement: Error statement to print\r\n        :success: Indicates success of login attempt\r\n                  Prints in green if True else red\r\n        \"\"\"\r\n        self.error_statement = error_statement\r\n        self.success = success\r\n        self.evoke_search_error()\r\n\r\n    def evoke_search_error(self):\r\n        color = \"green\" if self.success else \"red\"\r\n        print_text = colored(self.error_statement, color)\r\n        print(print_text)\r\n"
  },
  {
    "path": "dynamic/markdown.py",
    "content": "from rich.markdown import Markdown\r\nfrom rich.console import Console\r\nimport html as html\r\n\r\n\r\nclass MarkdownRenderer(object):\r\n    def __init__(self, markdown_text, console_print=True):\r\n        assert isinstance(markdown_text, str), \"Expected a string\"\r\n\r\n        markdown_text = html.unescape(markdown_text)\r\n        self.markdown_text = markdown_text\r\n        self.do_console_print = bool(console_print)\r\n\r\n        self.console = Console()  # rich console\r\n\r\n        self.render = self.print_mark_down_text()\r\n\r\n    def print_mark_down_text(self):\r\n        rendered_markdown = Markdown(self.markdown_text)\r\n\r\n        if self.do_console_print:\r\n            self.console.print(rendered_markdown)\r\n\r\n        return rendered_markdown\r\n\r\n    def __repr__(self):\r\n        return str(self.render)\r\n\r\n    def __len__(self):\r\n        if isinstance(self.render, str):\r\n            return len(self.render)\r\n        return -1\r\n\r\n    def __str__(self):\r\n        return str(self.render)\r\n"
  },
  {
    "path": "dynamic/notion.py",
    "content": "import os\n\nfrom utility import get_browser_driver\nfrom error import LoginError\nfrom settings import LOGIN_PATH\nfrom settings import TOKEN_FILE_PATH\n\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\n\n\ndef get_token_from_cookie(cookie, token):\n    for el in cookie:\n        if el[\"name\"] == token:\n            return el\n\n\ndef get_token_from_file():\n    try:\n        with open(TOKEN_FILE_PATH, \"r\") as f:\n            data = f.read()\n    except Exception as e:\n        print(e)\n    if not data or data == \"\":\n        raise RuntimeError(\"Token not found in file\")\n    else:\n        return data\n\n\ndef get_cookies_from_login():\n    \"\"\"Capture browser cookies for authentication.\"\"\"\n    driver = get_browser_driver()\n    try:\n        driver.get(LOGIN_PATH)\n        WebDriverWait(driver, 300).until(\n            EC.presence_of_element_located((By.CLASS_NAME, \"notion-sidebar-container\"))\n        )\n        return driver.get_cookies()\n    except Exception as e:\n        print(e)\n    finally:\n        driver.quit()\n\n\nclass NotionClient:\n\n    \"\"\"\n    Implements Login and token retrieval.\n\n    Handles the entire procedure of connecting to User's Notion account,\n    generating Notion's tokenv2_cookie, storing it locally and uploading\n    content to User's space\n    \"\"\"\n\n    def __init__(self):\n        \"\"\"\n        No input parameters required for instantiating object.\n\n        :tokenv2_cookie: stores the cookie containing user's tokenv2\n        :tokenv2_key: used to create environment variable\n        \"\"\"\n        self.tokenv2_cookie = None\n        self.tokenv2_key = \"TOKENV2\"\n\n    def save_token_file(self):\n        if self.tokenv2_cookie:\n            with open(TOKEN_FILE_PATH, \"w\") as f:\n                f.write(str(self.tokenv2_cookie))\n\n    def get_tokenv2_cookie(self):\n        message_success = \"Successfully logged into Notion \\U0001F389\"\n        message_failure = \"Login unsuccessful. Please try again \\U0001F615\"\n        # Sets 'tokenv2_cookie equal to the particular cookie containing token_v2\n        if not self.tokenv2_cookie:\n            try:\n                self.tokenv2_cookie = get_token_from_file()\n                LoginError(message_success, success=True)\n            except Exception:\n                try:\n                    cookies = get_cookies_from_login()\n                    self.tokenv2_cookie = get_token_from_cookie(cookies, \"token_v2\")\n                except Exception:\n                    self.tokenv2_cookie = None\n                finally:\n                    if self.tokenv2_cookie:\n                        os.environ[self.tokenv2_key] = str(self.tokenv2_cookie)\n                        LoginError(message_success, success=True)\n                        self.save_token_file()\n                    else:\n                        LoginError(message_failure, success=False)\n        return self.get_tokenv2_cookie\n"
  },
  {
    "path": "dynamic/save.py",
    "content": "import os as os\r\nimport json as json\r\nimport uuid as uuid\r\n\r\n\r\nclass SaveSearchResults(object):\r\n    def __init__(self, result_json):\r\n        self.result_json = self.__get_as_dict(result_json[0])\r\n        self.save_results_filename = self.generate_file_name(os.getcwd())\r\n\r\n        self.save_data_to_file(self.result_json, self.save_results_filename)\r\n\r\n    def save_data_to_file(self, data, filename):\r\n        with open(os.path.join(os.getcwd(), f\"{filename}.json\"), \"w\") as result_writer:\r\n            json.dump(data, result_writer, indent=6)\r\n\r\n    def __get_as_dict(self, json_array):\r\n        result_dict = {}\r\n        for index, element in enumerate(json_array):\r\n            result_dict[index] = json_array[index]\r\n        return dict(result_dict)\r\n\r\n    def generate_file_name(self, directory):\r\n        file_list = os.listdir(directory)\r\n        filename = str(uuid.uuid4()).replace(\"-\", \"_\")[:4]\r\n        while filename in file_list:\r\n            filename = str(uuid.uuid4()).replace(\"-\", \"_\")[:4]\r\n\r\n        return filename\r\n\r\n    def __repr__(self):\r\n        return str(self.save_results_filename)\r\n"
  },
  {
    "path": "dynamic/search.py",
    "content": "#!/usr/bin/env python\nimport webbrowser\nfrom termcolor import colored\nimport sys as sys\n\nfrom error import SearchError\nfrom utility import Utility\nfrom utility import Playbook\nfrom save import SaveSearchResults\nfrom update import UpdateApplication\nfrom api_test import ApiTesting\nfrom notion import NotionClient\n\nversion = \"0.1.0\"\n\n\nclass Prompt:\n    def __init__(self, message):\n        self.message = message\n\n    def prompt(self):\n        print(colored(f\"{self.message} : \", \"cyan\"), end=\"\")\n        data = input()\n        return data\n\n\nclass Search:\n    def __init__(self, arguments):\n        self.arguments = arguments\n        self.utility_object = Utility()\n        self.api_test_object = ApiTesting()\n        self.playbook_object = Playbook()\n\n    def search_args(self):\n        if self.arguments.search:\n            self.search_for_results()\n        elif self.arguments.file:\n            self.search_for_results(True)\n        elif self.arguments.playbook:\n            self.playbook_object.display_panel()\n        elif self.arguments.new:\n            url = \"https://stackoverflow.com/questions/ask\"\n            if isinstance(self.arguments.new, str):\n                webbrowser.open(f\"{url}?title={self.arguments.new}\")\n            else:\n                webbrowser.open(url)\n        elif self.arguments.custom:\n            self.utility_object.setCustomKey()\n        elif self.arguments.update:\n            update = UpdateApplication(version)\n            update.check_for_updates()\n        elif self.arguments.GET:\n            self.api_test_object.get_request()\n        elif self.arguments.POST:\n            self.api_test_object.post_request()\n        elif self.arguments.DELETE:\n            self.api_test_object.delete_request()\n        elif self.arguments.notion:\n            NotionClient().get_tokenv2_cookie()\n\n    def search_for_results(self, save=False):\n        queries = [\"What do you want to search\", \"Tags (optional)\"]\n        query_solutions = []\n\n        # ask question\n        for each_query in queries:\n            # Be careful if there are\n            # KeyBoard Interrupts or EOErrors\n            try:\n                prompt = Prompt(str(each_query)).prompt()\n                if not each_query == \"Tags (optional)\" and prompt.strip() == \"\":\n                    SearchError(\n                        \"\\U0001F613 Input data empty\", \"\\U0001F504 Please try again \"\n                    )\n                    sys.exit()\n            except:\n                sys.exit()\n\n            query_solutions.append(prompt)\n\n        question, tags = (\n            query_solutions[0],\n            query_solutions[1] if len(query_solutions) > 1 else \"\",\n        )\n        json_output = self.utility_object.make_request(question, tags)\n        questions = self.utility_object.get_que(json_output)\n        if questions == []:\n            # evoke an error\n            SearchError(\"\\U0001F613 No answer found\", \"\\U0001F604 Please try reddit\")\n        else:\n            data = self.utility_object.get_ans(questions)\n            print(\n                \"\"\"\n            \\U0001F604  Hopefully you found what you were looking for!\n            \\U0001F4C2  You can save an answer to a file with '-file'\n\n            Not found what you were looking for \\U00002754\n            \\U0001F4C4  Open browser and post your question\n                on StackOverflow with '-n [title (optional)]'\n\n            \\U0001F50E  To search more use '-s'\n            \"\"\"\n            )\n\n            if save:\n                filename = SaveSearchResults(data)\n                print(\n                    colored(\n                        f\"\\U0001F604 Answers successfully saved into {filename}\",\n                        \"green\",\n                    ),\n                )\n"
  },
  {
    "path": "dynamic/settings.py",
    "content": "import os\nfrom pathlib import Path\n\nNOTION_URL = \"https://www.notion.so/\"\nLOGIN_PATH = NOTION_URL + \"/login\"\nDATA_DIR = os.environ.get(\n    \"DYNAMIC_DATA_DIR\", str(Path(os.path.expanduser(\"~\")).joinpath(\".dynamic\"))\n)\nPLAYBOOK_FILE = str(Path(DATA_DIR).joinpath(\"playbook.json\"))\nTOKEN_FILE_PATH = str(Path(DATA_DIR).joinpath(\"tokenv2_cookie\"))\n\ntry:\n    os.makedirs(DATA_DIR)\nexcept FileExistsError:\n    pass\n\nif not os.path.isfile(TOKEN_FILE_PATH):\n    open(TOKEN_FILE_PATH, \"w\").close()\n"
  },
  {
    "path": "dynamic/tests/__init__.py",
    "content": ""
  },
  {
    "path": "dynamic/tests/test_get/__init__.py",
    "content": ""
  },
  {
    "path": "dynamic/tests/test_get/output.json",
    "content": "{\n    \"data\": {\n        \"id\": 2,\n        \"email\": \"janet.weaver@reqres.in\",\n        \"first_name\": \"Janet\",\n        \"last_name\": \"Weaver\",\n        \"avatar\": \"https://reqres.in/img/faces/2-image.jpg\"\n    },\n    \"support\": {\n        \"url\": \"https://reqres.in/#support-heading\",\n        \"text\": \"To keep ReqRes free, contributions towards server costs are appreciated!\"\n    }\n}"
  },
  {
    "path": "dynamic/tests/test_get/test_get_api.py",
    "content": "from io import StringIO\nimport json\nfrom dynamic import api_test\n\n\nclass TestApi():\n    def test_get_request_no_headers(self, monkeypatch):\n        # Test to check get api response without header\n\n        self.test_object = api_test.ApiTesting()\n        test_uri = \"https://reqres.in/api/users/2\"\n        test_headers = \"\"\n        save_response = \"n\"\n        inputs = StringIO(test_uri+\"\\n\"+test_headers+\"\\n\"+save_response)\n        monkeypatch.setattr('sys.stdin', inputs)\n        res = self.test_object.get_request()\n\n        file = open(\n            'dynamic/tests/test_get/output.json')\n        assert res == json.loads(file.read())\n"
  },
  {
    "path": "dynamic/tests/test_get_api.py",
    "content": "from io import StringIO\nimport json\nfrom ..api_test import ApiTesting\n\n\nclass TestApi():\n\n    def test_get_request_no_headers(self, monkeypatch):\n        # Test to check get api response without header\n\n        self.test_object = ApiTesting()\n\n        test_uri = \"https://reqres.in/api/users/2\"\n        test_headers = \"\"\n        save_response = \"n\"\n\n        inputs = StringIO(test_uri+\"\\n\"+test_headers+\"\\n\"+save_response)\n\n        monkeypatch.setattr('sys.stdin', inputs)\n\n        res = self.test_object.get_request()\n\n        assert res == json.loads(\"\"\"{\"data\":{\"id\":2,\"email\":\"janet.weaver@reqres.in\",\"first_name\":\"Janet\",\"last_name\":\"Weaver\",\"avatar\":\"https://reqres.in/img/faces/2-image.jpg\"},\"support\":{\"url\":\"https://reqres.in/#support-heading\",\"text\":\"To keep ReqRes free, contributions towards server costs are appreciated!\"}}\"\"\")\n"
  },
  {
    "path": "dynamic/tests/test_post/__init__.py",
    "content": ""
  },
  {
    "path": "dynamic/tests/test_post/input.json",
    "content": "{\n    \"name\": \"morpheus\",\n    \"job\": \"leader\"\n}"
  },
  {
    "path": "dynamic/tests/test_post/test_post_api.py",
    "content": "from io import StringIO\nfrom dynamic import api_test\nimport json\n\n\nclass TestApi():\n    def test_post_request_json_input(self, monkeypatch):\n        # Test to post response with data using json file\n\n        self.test_object = api_test.ApiTesting()\n        test_uri = \"https://reqres.in/api/users\"\n        test_headers = \"\"\n\n        test_store_data = \"y\"\n        test_enter_payload_data = \"2\"\n\n        test_data = \"dynamic/tests/test_post/input.json\"\n\n        save_response = \"n\"\n        inputs = StringIO(test_uri+\"\\n\"+test_headers+\"\\n\"+test_store_data +\n                          \"\\n\"+test_enter_payload_data+\"\\n\"+test_data+\"\\n\"+save_response)\n        monkeypatch.setattr('sys.stdin', inputs)\n\n        res = self.test_object.post_request()\n        assert res.status_code == 201\n\n    def test_post_request_terminal_input(self, monkeypatch):\n        # Test to post response with data using terminal\n\n        self.test_object = api_test.ApiTesting()\n        test_uri = \"https://reqres.in/api/users\"\n        test_headers = \"\"\n\n        test_store_data = \"y\"\n        test_enter_payload_data = \"1\"\n\n        test_data = json.dumps({\"name\": \"aditya\", \"job\": \"leader\"})\n\n        save_response = \"n\"\n        inputs = StringIO(test_uri+\"\\n\"+test_headers+\"\\n\"+test_store_data +\n                          \"\\n\"+test_enter_payload_data+\"\\n\"+test_data+\"\\n\"+save_response)\n        monkeypatch.setattr('sys.stdin', inputs)\n\n        res = self.test_object.post_request()\n        assert res.status_code == 201\n"
  },
  {
    "path": "dynamic/update.py",
    "content": "import requests as requests\r\nfrom termcolor import colored\r\nimport webbrowser as webbrowser\r\n\r\nfrom error import SearchError\r\n\r\n\r\nclass UpdateApplication(object):\r\n    def __init__(self, current_version):\r\n\r\n        \"\"\"\r\n        Check for updates in the application\r\n\r\n        Check for updates in the application\r\n        via github's public api. The application\r\n        checks for the latest release and makes\r\n        sure that the version of the application\r\n        is same as the latest release tag\r\n\r\n        \"\"\"\r\n        self.current_version = current_version\r\n        self.release_api_url = \"https://api.github.com/repos/IndianOpenSourceFoundation/dynamic-cli/releases/latest\"\r\n\r\n    def check_for_updates(self):\r\n        try:\r\n            data = requests.get(self.release_api_url)\r\n            data = data.json()\r\n            if \"message\" in data:\r\n                if data[\"message\"] == \"Not Found\":\r\n                    print(colored(\"The application does not have any release\", \"yellow\"))\r\n                    return None\r\n\r\n            if data[\"tag_name\"] == self.current_version:\r\n                print(colored(\"Yeah! You have the latest version\", \"green\"))\r\n            else:\r\n                print(colored(f\"New release found - {data.tag_name}\", \"red\"))\r\n                webbrowser.open(data[\"html_url\"])\r\n\r\n        except Exception as exception:\r\n            exception = SearchError(str(exception), \"Try later\")\r\n"
  },
  {
    "path": "dynamic/utility.py",
    "content": "from termcolor import colored\nimport requests\nfrom rich.console import Console\nfrom rich.markdown import Markdown\nimport sys as sys\n\n# Required for Questions Panel\nimport os\nimport time\nimport locale\nfrom collections import defaultdict\nfrom simple_term_menu import TerminalMenu\nimport webbrowser\n\nfrom error import SearchError\nfrom save import SaveSearchResults\nfrom markdown import MarkdownRenderer\nfrom settings import PLAYBOOK_FILE\n\n# Required for OAuth\nimport json\nfrom oauthlib.oauth2 import MobileApplicationClient\nfrom requests_oauthlib import OAuth2Session\n\n# Required for Selenium script and for web_driver_manager\nimport time\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\n\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.firefox import GeckoDriverManager\nfrom webdriver_manager.microsoft import EdgeChromiumDriverManager\n\nconsole = Console()\n\n\ndef get_browser_driver():\n    # Try to install web drivers for one of these browsers\n    # Chrome, Firefox, Edge (One of them must be installed)\n    try:\n        return webdriver.Chrome(ChromeDriverManager().install())\n    except ValueError:\n        try:\n            return webdriver.Firefox(executable_path=GeckoDriverManager().install())\n        except ValueError:\n            try:\n                return webdriver.Edge(EdgeChromiumDriverManager().install())\n            except ValueError:\n                print(\n                    \"You do not have one of these supported browsers:\"\n                    + \"Chrome, Firefox, Edge\"\n                )\n\n\nclass Playbook:\n    def __init__(self):\n        self.key = \"DYNAMIC\"\n\n    @property\n    def playbook_path(self):\n        \"\"\"Create an environment variable 'DYNAMIC containing the path of dynamic_playbook.json and returns i.\"\"\"\n        if not os.getenv(self.key):\n            os.environ[self.key] = PLAYBOOK_FILE\n        return os.getenv(self.key)\n\n    @property\n    def playbook_template(self):\n        # Basic template and fields of playbook\n        return {\"time_of_update\": time.time(), \"items_stackoverflow\": []}\n\n    @property\n    def playbook_content(self):\n        # Reads playbook data from local storage and returns it\n        try:\n            with open(self.playbook_path, \"r\") as playbook:\n                return json.load(playbook)\n        except FileNotFoundError:\n            os.makedirs(os.path.dirname(self.playbook_path), exist_ok=True)\n            with open(self.playbook_path, \"w\") as playbook:\n                json.dump(self.playbook_template, playbook, ensure_ascii=False)\n            return self.playbook_content\n\n    @playbook_content.setter\n    def playbook_content(self, value):\n        if isinstance(value, dict):\n            with open(self.playbook_path, \"w\") as playbook:\n                json.dump(value, playbook, ensure_ascii=False)\n        else:\n            raise ValueError(\"value should be of type dict\")\n\n    def is_question_in_playbook(self, question_id):\n        content = self.playbook_content\n        for entry in content[\"items_stackoverflow\"]:\n            if int(entry[\"question_id\"]) == int(question_id):\n                return True\n        return False\n\n    def add_to_playbook(self, stackoverflow_object, question_id):\n        \"\"\"\n        Receives a QuestionsPanelStackoverflow object and\n        saves data of a particular question into playbook\n        Saves playbook in the following format\n        {\n            time_of_update: unix,\n            items_stackoverflow:\n            [\n                {\n                    time: unix timestamp\n                    question_id: 123456,\n                    question_title: 'question_title',\n                    question_link:  'link',\n                    answer_body: 'body of the answer'\n                },\n                ...\n            ]\n        \"\"\"\n        if self.is_question_in_playbook(question_id):\n            console.print(\n                \"[red] Question is already in the playbook,\" + \"No need to add\"\n            )\n            return\n        for question in stackoverflow_object.questions_data:\n            if int(question[1]) == int(question_id):\n                content = self.playbook_content\n                now = time.time()\n                content[\"time_of_update\"] = now\n                content[\"items_stackoverflow\"].append(\n                    {\n                        \"time_of_creation\": now,\n                        \"question_id\": int(question_id),\n                        \"question_title\": question[0],\n                        \"question_link\": question[2],\n                        \"answer_body\": stackoverflow_object.answer_data[\n                            int(question_id)\n                        ],\n                    }\n                )\n                self.playbook_content = content\n                console.print(\"[green] Question added to the playbook\")\n\n    def delete_from_playbook(self, stackoverflow_object, question_id):\n        content = self.playbook_content\n        for i in range(len(content[\"items_stackoverflow\"])):\n            if content[\"items_stackoverflow\"][i][\"question_id\"] == question_id:\n                del content[\"items_stackoverflow\"][i]\n                break\n        self.playbook_content = content\n        self = Playbook()\n        self.display_panel()\n\n    def display_panel(self):\n        playbook_data = self.playbook_content\n        if len(playbook_data[\"items_stackoverflow\"]) == 0:\n            SearchError(\n                \"You have no entries in the playbook\",\n                \"Browse and save entries in playbook with 'p' key\",\n            )\n            sys.exit()\n        # Creates QuestionPanelStackoverflow object\n        # populates its question_data and answer_data and displays it\n        question_panel = QuestionsPanelStackoverflow()\n        for item in playbook_data[\"items_stackoverflow\"]:\n            question_panel.questions_data.append(\n                [item[\"question_title\"], item[\"question_id\"], item[\"question_link\"]]\n            )\n            question_panel.answer_data[item[\"question_id\"]] = item[\"answer_body\"]\n        question_panel.display_panel([], playbook=True)\n\n\nclass QuestionsPanelStackoverflow:\n    def __init__(self):\n        # list(  list( question_title, question_id, question_link )...  )\n        self.questions_data = []\n\n        # dict( question_id:list( body, link ))\n        # corresponding to self.questions_data\n        self.answer_data = defaultdict(lambda: False)\n\n        self.line_color = \"bold red\"\n        self.heading_color = \"bold blue\"\n        self.utility = Utility()\n        self.playbook = Playbook()\n\n    def populate_question_data(self, questions_list):\n        \"\"\"\n        Function to populate question data property\n        Creates batch request to stackexchange API and to get question\n        details of questions with id in the list. Stores the returned\n        data in the following format:\n            list(  list( question_title, question_link, question_id )  )\n        \"\"\"\n        with console.status(\"Getting the questions...\"):\n            try:\n                resp = requests.get(self.utility.get_batch_ques_url(questions_list))\n            except:\n                SearchError(\"Search Failed\", \"Try connecting to the internet\")\n                sys.exit()\n        json_ques_data = resp.json()\n        self.questions_data = [\n            [item[\"title\"].replace(\"|\", \"\"), item[\"question_id\"], item[\"link\"]]\n            for item in json_ques_data[\"items\"]\n        ]\n\n    def populate_answer_data(self, questions_list):\n        \"\"\"\n        Function to populate answer data property\n        Creates batch request to stackexchange API\n        to get ans of questions with question id\n        in the list. Stores the returned data data\n        in the following format:\n            dict( question_id:list( body, link ) )\n        \"\"\"\n        with console.status(\"Searching answers...\"):\n            try:\n                resp = requests.get(self.utility.get_batch_ans_url(questions_list))\n            except:\n                SearchError(\"Search Failed\", \"Try connecting to the internet\")\n                sys.exit()\n            json_ans_data = resp.json()\n            for item in json_ans_data[\"items\"]:\n                if not (self.answer_data[item[\"question_id\"]]):\n                    self.answer_data[item[\"question_id\"]] = item[\"body_markdown\"]\n        # Sometimes the StackExchange API fails to deliver some answers.\n        # The below code is to fetch them\n        failed_ques_id = [\n            question[1]\n            for question in self.questions_data\n            if not (self.answer_data[question[1]])\n        ]\n        if not (len(failed_ques_id) == 0):\n            self.populate_answer_data(failed_ques_id)\n\n    def return_formatted_ans(self, ques_id):\n        # This function uses uses Rich Markdown to format answers body.\n        body_markdown = self.answer_data[int(ques_id)]\n        body_markdown = str(body_markdown)\n        xml_markup_replacement = [\n            (\"&amp;\", \"&\"),\n            (\"&lt;\", \"<\"),\n            (\"&gt;\", \">\"),\n            (\"&quot;\", '\"'),\n            (\"&apos;\", \"'\"),\n            (\"&#39;\", \"'\"),\n        ]\n        for convert_from, convert_to in xml_markup_replacement:\n            body_markdown = body_markdown.replace(convert_from, convert_to)\n        width = os.get_terminal_size().columns\n        console = Console(width=width - 4)\n        markdown = Markdown(body_markdown, hyperlinks=False)\n        with console.capture() as capture:\n            console.print(markdown)\n        highlighted = capture.get()\n        if not (\"UTF\" in locale.getlocale()[1]):\n            box_replacement = [\n                (\"─\", \"-\"),\n                (\"═\", \"=\"),\n                (\"║\", \"|\"),\n                (\"│\", \"|\"),\n                (\"┌\", \"+\"),\n                (\"└\", \"+\"),\n                (\"┐\", \"+\"),\n                (\"┘\", \"+\"),\n                (\"╔\", \"+\"),\n                (\"╚\", \"+\"),\n                (\"╗\", \"+\"),\n                (\"╝\", \"+\"),\n                (\"•\", \"*\"),\n            ]\n            for convert_from, convert_to in box_replacement:\n                highlighted = highlighted.replace(convert_from, convert_to)\n        return highlighted\n\n    def navigate_questions_panel(self, playbook=False):\n        # Code for navigating through the question panel\n        if playbook:\n            message = \"Playbook Questions\"\n            instructions = \". Press 'd' to delete from playbook\"\n            keys = (\"enter\", \"d\")\n        else:\n            message = \"Relevant Questions\"\n            instructions = \". Press 'p' to save in playbook\"\n            keys = (\"enter\", \"p\")\n        console.rule(\"[bold blue] {}\".format(message), style=\"bold red\")\n        console.print(\n            \"[yellow] Use arrow keys to navigate.\"\n            + \"'q' or 'Esc' to quit. 'Enter' to open in a browser\"\n            + instructions\n        )\n        console.print()\n        options = [\"|\".join(map(str, question)) for question in self.questions_data]\n        question_menu = TerminalMenu(\n            options,\n            preview_command=self.return_formatted_ans,\n            preview_size=0.75,\n            accept_keys=keys,\n        )\n        quitting = False\n        while not (quitting):\n            options_index = question_menu.show()\n            try:\n                question_link = self.questions_data[options_index][2]\n            except Exception:\n                return sys.exit() if playbook else None\n            else:\n                if question_menu.chosen_accept_key == \"enter\":\n                    webbrowser.open(question_link)\n                elif question_menu.chosen_accept_key == \"p\":\n                    self.playbook.add_to_playbook(\n                        self, self.questions_data[options_index][1]\n                    )\n                elif question_menu.chosen_accept_key == \"d\" and playbook:\n                    self.playbook.delete_from_playbook(\n                        self, self.questions_data[options_index][1]\n                    )\n\n    def display_panel(self, questions_list, playbook=False):\n        if not playbook:\n            self.populate_question_data(questions_list)\n            self.populate_answer_data(questions_list)\n        self.navigate_questions_panel(playbook=playbook)\n\n\nclass Utility:\n    def __init__(self):\n        # the parent url\n        self.search_content_url = \"https://api.stackexchange.com/\"\n\n    def __get_search_url(self, question, tags):\n        \"\"\"\n        This function returns the url that contains all the custom\n        data provided by the user such as tags and question, which\n        can finally be used to get answers\n        \"\"\"\n        return f\"{self.search_content_url}/2.2/search/advanced?order=desc&sort=relevance&\" \\\n               f\"tagged={tags}&q={question}&site=stackoverflow\"\n\n    def get_batch_ques_url(self, ques_id_list):\n        \"\"\"\n        Returns URL which contains ques_ids which can be use to get\n        get the details of all the corresponding questions\n        \"\"\"\n        batch_ques_id = \"\"\n        for question_id in ques_id_list:\n            batch_ques_id += str(question_id) + \";\"\n        return f\"{self.search_content_url}/2.2/questions/{batch_ques_id[:-1]}?order=desc&sort=votes&site=stackoverflow&filter=!--1nZwsgqvRX\"\n\n    def get_batch_ans_url(self, ques_id_list):\n        batch_ques_id = \"\"\n        for question_id in ques_id_list:\n            batch_ques_id += str(question_id) + \";\"\n        return f\"{self.search_content_url}/2.2/questions/{batch_ques_id[:-1]}/answers?order=desc&sort=votes&site=stackoverflow&filter=!--1nZwsgqvRX\"\n\n    def make_request(self, que, tag: str):\n        \"\"\"\n        This function uses the requests library to make\n        the rest api call to the stackexchange server.\n        :param que: The user questions that servers as\n                    a question in the api.\n        :type que: String\n        :param tag: The tags that user wants for searching the relevant\n                    answers. For e.g. TypeError might be for multiple\n                    languages so is tag is used as \"Python\" then the\n                    api will return answers based on the tags and question.\n        :type tag: String\n        :return: Json response from the api call.\n        :rtype: Json format data\n        \"\"\"\n        with console.status(\"Searching...\"):\n            try:\n                url = self.__get_search_url(que, tag)\n                resp = requests.get(url)\n            except:\n                SearchError(\n                    \"\\U0001F613 Search Failed\",\n                    \"\\U0001F4BB Try connecting to the internet\",\n                )\n                sys.exit()\n        return resp.json()\n\n    def get_que(self, json_data):\n        \"\"\"\n        This function returns the list of ids of the questions\n        that have been answered, from the response that we get\n        from the make_request function.\n        \"\"\"\n        que_id = []\n        for data in json_data[\"items\"]:\n            if data[\"answer_count\"]:\n                que_id.append(data[\"question_id\"])\n        return que_id\n\n    def get_ans(self, questions_list):\n        \"\"\"\n        This Function creates QuestionsPanel_stackoverflow class which supports\n        Rendering, navigation, searching and redirecting capabilities\n        \"\"\"\n        stackoverflow_panel = QuestionsPanelStackoverflow()\n        stackoverflow_panel.display_panel(questions_list)\n        # Support for reddit searching can also be implemented from here\n\n    # Get an access token and extract to a JSON file \"access_token.json\"\n    @classmethod\n    def setCustomKey(self):\n        \"\"\"\n        scopes possible values:\n        read_inbox - access a user's global inbox\n        no_expiry - access_token's with this scope do not expire\n        write_access - perform write operations as a user\n        private_info - access full history of a user's private\n                       actions on the site\n        \"\"\"\n        client_id = 20013\n        scopes = \"read_inbox\"\n\n        authorization_url = \"https://stackoverflow.com/oauth/dialog\"\n        redirect_uri = \"https://stackexchange.com/oauth/login_success\"\n\n        # Create an OAuth session and open the auth_url in a browser\n        # for the user to authenticate\n        stackApps = OAuth2Session(\n            client=MobileApplicationClient(client_id=client_id),\n            scope=scopes,\n            redirect_uri=redirect_uri,\n        )\n        auth_url, state = stackApps.authorization_url(authorization_url)\n\n        driver = get_browser_driver()\n\n        # Open auth_url in one of the supported browsers\n        driver.get(auth_url)\n\n        # Close the window after 20s\n        # (Assuming that the user logs in within 30 seconds)\n        time.sleep(30)\n        # Close the windows as soon as authorization is done\n        try:\n            WebDriverWait(driver, 1).until(\n                EC.presence_of_element_located((By.TAG_NAME, \"h2\"))\n            )\n            callback_url = driver.current_url\n        finally:\n            driver.quit()\n\n        # Extract access token data from callback_url\n        accessTokenData = stackApps.token_from_fragment(callback_url)\n\n        # Store the access token data in a dictionary\n        jsonDict = {\n            \"access_token\": accessTokenData[\"access_token\"],\n            \"expires\": accessTokenData[\"expires\"],\n            \"state\": state,\n        }\n\n        with open(\"access_token.json\", \"w\") as jsonFile:\n            json.dump(jsonDict, jsonFile)\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[build-system]\nrequires = [\n    \"setuptools>=42\",\n    \"wheel\",\n    \"certifi==2020.6.20\",\n    \"chardet==3.0.4\",\n    \"idna==2.10\",\n    \"requests==2.24.0\",\n    \"termcolor==1.1.0\",\n    \"urllib3==1.25.10\",\n    \"rich==9.9.0\",\n    \"oauthlib==3.1.0\",\n    \"requests-oauthlib==1.3.0\",\n    \"colorama==0.4.4\",\n    \"configparser==5.0.2\",\n    \"crayons==0.4.0\",\n    \"selenium==3.141.0\",\n    \"webdriver-manager==3.3.0\",\n    \"simple-term-menu==1.0.1\"\n]\nbuild-backend = \"setuptools.build_meta\""
  },
  {
    "path": "requirements.txt",
    "content": "certifi==2020.6.20\nchardet==3.0.4\nidna==2.10\nrequests==2.24.0\ntermcolor==1.1.0\nurllib3==1.25.10\nrich==9.9.0\noauthlib==3.1.0\nrequests-oauthlib==1.3.0\ncolorama==0.4.4\nconfigparser==5.0.2\ncrayons==0.4.0\nselenium==3.141.0\nwebdriver-manager==3.3.0\nsimple-term-menu==1.0.1\npytest==7.1.1"
  },
  {
    "path": "setup.py",
    "content": "import setuptools\n\nwith open(\"README.md\", \"r\", encoding=\"utf-8\") as fh:\n    long_description = fh.read()\n\nDEPENDENCIES = [\n    \"certifi==2020.6.20\",\n    \"chardet==3.0.4\",\n    \"idna==2.10\",\n    \"requests==2.24.0\",\n    \"termcolor==1.1.0\",\n    \"urllib3==1.25.10\",\n    \"rich==9.9.0\",\n    \"oauthlib==3.1.0\",\n    \"requests-oauthlib==1.3.0\",\n    \"colorama==0.4.4\",\n    \"configparser==5.0.2\",\n    \"crayons==0.4.0\",\n    \"selenium==3.141.0\",\n    \"webdriver-manager==3.3.0\",\n    \"simple-term-menu==1.0.1\",\n]\n\nsetuptools.setup(\n    name=\"dynamic-cli\",\n    version=\"1.1\",\n    author=\"IOSF Community\",\n    author_email=\"ping@iosf.in\",\n    description=\"A Modern, user-friendly command-line HTTP client for the API testing, and if you're stuck - Search and browse StackOverflow without leaving the CLI\",\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    url=\"https://github.com/IndianOpenSourceFoundation/dynamic-cli\",\n    project_urls={\n        \"Bug Tracker\": \"https://github.com/IndianOpenSourceFoundation/dynamic-cli/issues\",\n    },\n    install_requires=DEPENDENCIES,\n    package_dir={},\n    packages=setuptools.find_packages(),\n    entry_points={\"console_scripts\": [\"dynamic=dynamic.__main__:main\"]},\n    classifiers=[\n        \"Programming Language :: Python :: 3\",\n        \"License :: OSI Approved :: MIT License\",\n        \"Operating System :: OS Independent\",\n    ],\n    python_requires=\">=3.6\",\n    zip_safe=False,\n)\n"
  },
  {
    "path": "window_setup.md",
    "content": "How to Setup WSL for Windows - \n\n- Install the Linux distribution from the Microsoft Store. Click on Window icon > Microsoft Store > Search for Ubuntu\n\n![Microsoft Store](https://user-images.githubusercontent.com/31731827/157431666-45295272-5316-4bf7-9177-d717018e93b9.png)\n\n\n\n- You can now install everything you need to run Windows Subsystem for Linux (WSL) by entering this command in an administrator PowerShell or Windows Command Prompt and then restarting your machine.\n\n```\nwsl --install\n```\n\nNOTE: You need to run the PowerShell as Run as Administrator mode.\n\n```\nClick on Window button > Search for Window powershell > Right Click > Run as Administrator\n```\n\nAfter installing, You'll see a ubuntu icons in your windows. Please find the below screenshot for the references -\n\n![ubuntu_search](https://user-images.githubusercontent.com/31731827/157432751-00068cf6-c4c2-4715-b4cb-8de75a502ae7.png)\n\n![WSL ubuntu](https://user-images.githubusercontent.com/31731827/157432815-56c6c91a-0324-4236-9fe9-afc6d9fbc31b.png)\n\n"
  }
]