pax_global_header 0000666 0000000 0000000 00000000064 14760134766 0014530 g ustar 00root root 0000000 0000000 52 comment=5474f0be4ef3dbd845d9eb6541a563861c9e31e4 typer-0.15.2/ 0000775 0000000 0000000 00000000000 14760134766 0012760 5 ustar 00root root 0000000 0000000 typer-0.15.2/.github/ 0000775 0000000 0000000 00000000000 14760134766 0014320 5 ustar 00root root 0000000 0000000 typer-0.15.2/.github/DISCUSSION_TEMPLATE/ 0000775 0000000 0000000 00000000000 14760134766 0017276 5 ustar 00root root 0000000 0000000 typer-0.15.2/.github/DISCUSSION_TEMPLATE/questions.yml 0000664 0000000 0000000 00000012271 14760134766 0022056 0 ustar 00root root 0000000 0000000 labels: [question] body: - type: markdown attributes: value: | Thanks for your interest in Typer! ๐ Please follow these instructions, fill every question, and do every step. ๐ I'm asking this because answering questions and solving problems in GitHub is what consumes most of the time. I end up not being able to add new features, fix bugs, review pull requests, etc. as fast as I wish because I have to spend too much time handling questions. All that, on top of all the incredible help provided by a bunch of community members that give a lot of their time to come here and help others. If more Typer users came to help others like them just a little bit more, it would be much less effort for them (and you and me ๐ ). By asking questions in a structured way (following this) it will be much easier to help you. And there's a high chance that you will find the solution along the way and you won't even have to submit it and wait for an answer. ๐ As there are too many questions, I'll have to discard and close the incomplete ones. That will allow me (and others) to focus on helping people like you that follow the whole process and help us help you. ๐ค - type: checkboxes id: checks attributes: label: First Check description: Please confirm and check all the following options. options: - label: I added a very descriptive title here. required: true - label: I used the GitHub search to find a similar question and didn't find it. required: true - label: I searched the Typer documentation, with the integrated search. required: true - label: I already searched in Google "How to X in Typer" and didn't find any information. required: true - label: I already read and followed all the tutorials in the docs and didn't find an answer. required: true - label: I already checked if it is not related to Typer but to [Click](https://github.com/pallets/click). required: true - type: checkboxes id: help attributes: label: Commit to Help description: | After submitting this, I commit to one of: * Read open issues with questions until I find 2 issues where I can help someone and add a comment to help there. * I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future. * Review one Pull Request by downloading the code and following all the [review process](https://typer.tiangolo.com/help-typer/#review-pull-requests). options: - label: I commit to help with one of those options ๐ required: true - type: textarea id: example attributes: label: Example Code description: | Please add a self-contained, [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example) with your use case. If I (or someone) can copy it, run it, and see it right away, there's a much higher chance I (or someone) will be able to help you. placeholder: | import typer def main(name: str): typer.echo(f"Hello {name}") if __name__ == "__main__": typer.run(main) render: python validations: required: true - type: textarea id: description attributes: label: Description description: | What is the problem, question, or error? Write a short description telling me what you are doing, what you expect to happen, and what is currently happening. placeholder: | * Create a small Typer script. * Open a Terminal with Ninja-Turtle-Shell. * Trigger autocompletion hitting TAB. * I don't see any completion in the terminal using Ninja-Turtle-Shell. * I expected to see autocompletion there. validations: required: true - type: dropdown id: os attributes: label: Operating System description: What operating system are you on? multiple: true options: - Linux - Windows - macOS - Other validations: required: true - type: textarea id: os-details attributes: label: Operating System Details description: You can add more details about your operating system here, in particular if you chose "Other". - type: input id: typer-version attributes: label: Typer Version description: | What Typer version are you using? You can find the Typer version with: ```bash python -c "import typer; print(typer.__version__)" ``` validations: required: true - type: input id: python-version attributes: label: Python Version description: | What Python version are you using? You can find the Python version with: ```bash python --version ``` validations: required: true - type: textarea id: context attributes: label: Additional Context description: Add any additional context information or screenshots you think are useful. typer-0.15.2/.github/FUNDING.yml 0000664 0000000 0000000 00000000023 14760134766 0016130 0 ustar 00root root 0000000 0000000 github: [tiangolo] typer-0.15.2/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 14760134766 0016503 5 ustar 00root root 0000000 0000000 typer-0.15.2/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000001363 14760134766 0020476 0 ustar 00root root 0000000 0000000 blank_issues_enabled: false contact_links: - name: Security Contact about: Please report security vulnerabilities to security@tiangolo.com - name: Question or Problem about: Ask a question or ask about a problem in GitHub Discussions. url: https://github.com/fastapi/typer/discussions/categories/questions - name: Feature Request about: To suggest an idea or ask about a feature, please start with a question saying what you would like to achieve. There might be a way to do it already. url: https://github.com/fastapi/typer/discussions/categories/questions - name: Show and tell about: Show what you built with Typer or to be used with Typer. url: https://github.com/fastapi/typer/discussions/categories/show-and-tell typer-0.15.2/.github/ISSUE_TEMPLATE/privileged.yml 0000664 0000000 0000000 00000001564 14760134766 0021366 0 ustar 00root root 0000000 0000000 name: Privileged description: You are @tiangolo or he asked you directly to create an issue here. If not, check the other options. ๐ body: - type: markdown attributes: value: | Thanks for your interest in Typer! ๐ If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/fastapi/typer/discussions/categories/questions) instead. - type: checkboxes id: privileged attributes: label: Privileged issue description: Confirm that you are allowed to create an issue here. options: - label: I'm @tiangolo or he asked me directly to create an issue here. required: true - type: textarea id: content attributes: label: Issue Content description: Add the content of the issue here. typer-0.15.2/.github/dependabot.yml 0000664 0000000 0000000 00000000465 14760134766 0017155 0 ustar 00root root 0000000 0000000 version: 2 updates: # GitHub Actions - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" commit-message: prefix: โฌ # Python - package-ecosystem: "pip" directory: "/" schedule: interval: "daily" commit-message: prefix: โฌ typer-0.15.2/.github/labeler.yml 0000664 0000000 0000000 00000000776 14760134766 0016463 0 ustar 00root root 0000000 0000000 docs: - all: - changed-files: - any-glob-to-any-file: - docs/** - docs_src/** - all-globs-to-all-files: - '!typer/**' - '!pyproject.toml' internal: - all: - changed-files: - any-glob-to-any-file: - .github/** - scripts/** - .gitignore - .pre-commit-config.yaml - pdm_build.py - requirements*.txt - all-globs-to-all-files: - '!docs/**' - '!typer/**' - '!pyproject.toml' typer-0.15.2/.github/workflows/ 0000775 0000000 0000000 00000000000 14760134766 0016355 5 ustar 00root root 0000000 0000000 typer-0.15.2/.github/workflows/add-to-project.yml 0000664 0000000 0000000 00000000560 14760134766 0021715 0 ustar 00root root 0000000 0000000 name: Add to Project on: pull_request_target: issues: types: - opened - reopened jobs: add-to-project: name: Add to project runs-on: ubuntu-latest steps: - uses: actions/add-to-project@v1.0.2 with: project-url: https://github.com/orgs/fastapi/projects/2 github-token: ${{ secrets.PROJECTS_TOKEN }} typer-0.15.2/.github/workflows/build-docs.yml 0000664 0000000 0000000 00000005474 14760134766 0021137 0 ustar 00root root 0000000 0000000 name: Build Docs on: push: branches: - master pull_request: types: - opened - synchronize env: UV_SYSTEM_PYTHON: 1 jobs: changes: runs-on: ubuntu-latest # Required permissions permissions: pull-requests: read # Set job outputs to values from filter step outputs: docs: ${{ steps.filter.outputs.docs }} steps: - uses: actions/checkout@v4 # For pull requests it's not necessary to checkout the code but for the main branch it is - uses: dorny/paths-filter@v3 id: filter with: filters: | docs: - README.md - docs/** - docs_src/** - requirements-docs.txt - requirements-docs-insiders.txt - pyproject.toml - mkdocs.yml - mkdocs.insiders.yml - mkdocs.maybe-insiders.yml - mkdocs.no-insiders.yml - .github/workflows/build-docs.yml - .github/workflows/deploy-docs.yml - data/** build-docs: needs: - changes if: ${{ needs.changes.outputs.docs == 'true' }} runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Setup uv uses: astral-sh/setup-uv@v5 with: version: "0.4.15" enable-cache: true cache-dependency-glob: | requirements**.txt pyproject.toml - name: Install docs extras run: uv pip install -r requirements-docs.txt - name: Install Material for MkDocs Insiders if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) run: uv pip install -r requirements-docs-insiders.txt env: TOKEN: ${{ secrets.TYPER_MKDOCS_MATERIAL_INSIDERS }} - uses: actions/cache@v4 with: key: mkdocs-cards-${{ github.ref }}-v1 path: .cache - name: Verify README run: python ./scripts/docs.py verify-readme - name: Build Docs run: python ./scripts/docs.py build - uses: actions/upload-artifact@v4 with: name: docs-site path: ./site/** include-hidden-files: true # https://github.com/marketplace/actions/alls-green#why docs-all-green: # This job does nothing and is only used for the branch protection if: always() needs: - build-docs runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} allowed-skips: build-docs typer-0.15.2/.github/workflows/deploy-docs.yml 0000664 0000000 0000000 00000004736 14760134766 0021334 0 ustar 00root root 0000000 0000000 name: Deploy Docs on: workflow_run: workflows: - Build Docs types: - completed permissions: deployments: write issues: write pull-requests: write statuses: write env: UV_SYSTEM_PYTHON: 1 jobs: deploy-docs: runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Setup uv uses: astral-sh/setup-uv@v5 with: version: "0.4.15" enable-cache: true cache-dependency-glob: | requirements**.txt pyproject.toml - name: Install GitHub Actions dependencies run: uv pip install -r requirements-github-actions.txt - name: Deploy Docs Status Pending run: python ./scripts/deploy_docs_status.py env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} RUN_ID: ${{ github.run_id }} - name: Clean site run: | rm -rf ./site mkdir ./site - uses: actions/download-artifact@v4 with: path: ./site/ pattern: docs-site merge-multiple: true github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - name: Deploy to Cloudflare Pages # hashFiles returns an empty string if there are no files if: hashFiles('./site/*') id: deploy env: PROJECT_NAME: typertiangolo BRANCH: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }} uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }} - name: Comment Deploy run: python ./scripts/deploy_docs_status.py env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }} COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} RUN_ID: ${{ github.run_id }} IS_DONE: "true" typer-0.15.2/.github/workflows/issue-manager.yml 0000664 0000000 0000000 00000002251 14760134766 0021640 0 ustar 00root root 0000000 0000000 name: Issue Manager on: schedule: - cron: "13 21 * * *" issue_comment: types: - created issues: types: - labeled pull_request_target: types: - labeled workflow_dispatch: permissions: issues: write pull-requests: write jobs: issue-manager: if: github.repository_owner == 'fastapi' runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: tiangolo/issue-manager@0.5.1 with: token: ${{ secrets.GITHUB_TOKEN }} config: > { "answered": { "delay": 864000, "message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs." }, "waiting": { "delay": 2628000, "message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR." } } typer-0.15.2/.github/workflows/labeler.yml 0000664 0000000 0000000 00000001474 14760134766 0020514 0 ustar 00root root 0000000 0000000 name: Labels on: pull_request_target: types: - opened - synchronize - reopened # For label-checker - labeled - unlabeled jobs: labeler: permissions: contents: read pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }} - run: echo "Done adding labels" # Run this after labeler applied labels check-labels: needs: - labeler permissions: pull-requests: read runs-on: ubuntu-latest steps: - uses: docker://agilepathway/pull-request-label-checker:latest with: one_of: breaking,security,feature,bug,refactor,upgrade,docs,lang-all,internal repo_token: ${{ secrets.GITHUB_TOKEN }} typer-0.15.2/.github/workflows/latest-changes.yml 0000664 0000000 0000000 00000002465 14760134766 0022011 0 ustar 00root root 0000000 0000000 name: Latest Changes on: pull_request_target: branches: - master types: - closed workflow_dispatch: inputs: number: description: PR number required: true debug_enabled: description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' required: false default: 'false' jobs: latest-changes: runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 with: # To allow latest-changes to commit to the main branch token: ${{ secrets.TYPER_LATEST_CHANGES }} # Allow debugging with tmate - name: Setup tmate session uses: mxschmitt/action-tmate@v3 if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }} with: limit-access-to-actor: true - uses: tiangolo/latest-changes@0.3.2 with: token: ${{ secrets.GITHUB_TOKEN }} latest_changes_file: docs/release-notes.md latest_changes_header: '## Latest Changes' end_regex: '^## ' debug_logs: true label_header_prefix: '### ' typer-0.15.2/.github/workflows/publish.yml 0000664 0000000 0000000 00000001702 14760134766 0020546 0 ustar 00root root 0000000 0000000 name: Publish on: release: types: - created jobs: publish: runs-on: ubuntu-latest strategy: matrix: package: - typer-slim - typer - typer-cli permissions: id-token: write steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.10" # Issue ref: https://github.com/actions/setup-python/issues/436 # cache: "pip" # cache-dependency-path: pyproject.toml - name: Install build dependencies run: pip install build - name: Build distribution env: TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }} run: python -m build - name: Publish uses: pypa/gh-action-pypi-publish@v1.12.4 typer-0.15.2/.github/workflows/smokeshow.yml 0000664 0000000 0000000 00000002666 14760134766 0021131 0 ustar 00root root 0000000 0000000 name: Smokeshow on: workflow_run: workflows: - Test types: - completed permissions: statuses: write env: UV_SYSTEM_PYTHON: 1 jobs: smokeshow: if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.9' - name: Setup uv uses: astral-sh/setup-uv@v5 with: version: "0.4.15" enable-cache: true cache-dependency-glob: | requirements**.txt pyproject.toml - run: uv pip install -r requirements-github-actions.txt - uses: actions/download-artifact@v4 with: name: coverage-html path: htmlcov github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - run: smokeshow upload htmlcov env: SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage} SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 100 SMOKESHOW_GITHUB_CONTEXT: coverage SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }} SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }} typer-0.15.2/.github/workflows/test-redistribute.yml 0000664 0000000 0000000 00000003716 14760134766 0022571 0 ustar 00root root 0000000 0000000 name: Test Redistribute on: push: branches: - master pull_request: types: - opened - synchronize jobs: test-redistribute: runs-on: ubuntu-latest strategy: matrix: package: - typer-slim - typer - typer-cli steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.10" # Issue ref: https://github.com/actions/setup-python/issues/436 # cache: "pip" # cache-dependency-path: pyproject.toml - name: Install build dependencies run: pip install build - name: Build source distribution env: TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }} run: python -m build --sdist - name: Decompress source distribution run: | cd dist tar xvf typer*.tar.gz - name: Install test dependencies if: ${{ matrix.package != 'typer-cli' }} run: | cd dist/typer*/ pip install -r requirements-tests.txt env: TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }} - name: Run source distribution tests if: ${{ matrix.package != 'typer-cli' }} run: | cd dist/typer*/ bash scripts/test.sh - name: Build wheel distribution run: | cd dist pip wheel --no-deps typer*.tar.gz # https://github.com/marketplace/actions/alls-green#why test-redistribute-alls-green: # This job does nothing and is only used for the branch protection if: always() needs: - test-redistribute runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} typer-0.15.2/.github/workflows/test.yml 0000664 0000000 0000000 00000007156 14760134766 0020070 0 ustar 00root root 0000000 0000000 name: Test on: push: branches: - master pull_request: types: - opened - synchronize schedule: # cron every week on monday - cron: "0 0 * * 1" env: UV_SYSTEM_PYTHON: 1 jobs: test: strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] python-version: [ "3.13" ] include: - os: ubuntu-22.04 python-version: "3.7" - os: macos-latest python-version: "3.8" - os: windows-latest python-version: "3.9" - os: ubuntu-latest python-version: "3.10" - os: macos-latest python-version: "3.11" - os: windows-latest python-version: "3.12" fail-fast: false runs-on: ${{ matrix.os }} steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Setup uv uses: astral-sh/setup-uv@v5 with: version: "0.4.15" enable-cache: true cache-dependency-glob: | requirements**.txt pyproject.toml - name: Install Dependencies run: uv pip install -r requirements-tests.txt - name: Lint run: bash scripts/lint.sh - run: mkdir coverage - run: bash ./scripts/test-files.sh - name: Test run: bash scripts/test.sh env: COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} - name: Store coverage files uses: actions/upload-artifact@v4 with: name: coverage-${{ runner.os }}-${{ matrix.python-version }} path: coverage include-hidden-files: true coverage-combine: needs: [test] runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.8' - name: Setup uv uses: astral-sh/setup-uv@v5 with: version: "0.4.15" enable-cache: true cache-dependency-glob: | requirements**.txt pyproject.toml - name: Get coverage files uses: actions/download-artifact@v4 with: pattern: coverage-* path: coverage merge-multiple: true - name: Install Dependencies run: uv pip install -r requirements-tests.txt - run: ls -la coverage - run: coverage combine coverage - run: coverage report - run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}" - name: Store coverage HTML uses: actions/upload-artifact@v4 with: name: coverage-html path: htmlcov include-hidden-files: true # https://github.com/marketplace/actions/alls-green#why check: # This job does nothing and is only used for the branch protection if: always() needs: - coverage-combine runs-on: ubuntu-latest steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} typer-0.15.2/.gitignore 0000664 0000000 0000000 00000000166 14760134766 0014753 0 ustar 00root root 0000000 0000000 .vscode *.pyc __pycache__ .venv* env dist .mypy_cache .idea site htmlcov .pytest_cache coverage.xml .coverage* .cache typer-0.15.2/.pre-commit-config.yaml 0000664 0000000 0000000 00000001335 14760134766 0017243 0 ustar 00root root 0000000 0000000 # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks default_language_version: python: python3.10 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: check-added-large-files - id: check-toml - id: check-yaml args: - --unsafe - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.9.7 hooks: - id: ruff args: - --fix - id: ruff-format ci: autofix_commit_msg: ๐จ [pre-commit.ci] Auto format from pre-commit.com hooks autoupdate_commit_msg: โฌ [pre-commit.ci] pre-commit autoupdate typer-0.15.2/CITATION.cff 0000664 0000000 0000000 00000001067 14760134766 0014656 0 ustar 00root root 0000000 0000000 # This CITATION.cff file was generated with cffinit. # Visit https://bit.ly/cffinit to generate yours today! cff-version: 1.2.0 title: Typer message: >- If you use this software, please cite it using the metadata from this file. type: software authors: - given-names: Sebastiรกn family-names: Ramรญrez email: tiangolo@gmail.com identifiers: repository-code: 'https://github.com/fastapi/typer' url: 'https://typer.tiangolo.com' abstract: >- Typer, build great CLIs. Easy to code. Based on Python type hints. keywords: - typer - click license: MIT typer-0.15.2/CONTRIBUTING.md 0000664 0000000 0000000 00000000175 14760134766 0015214 0 ustar 00root root 0000000 0000000 Please read the [Development - Contributing](https://typer.tiangolo.com/contributing/) guidelines in the documentation site. typer-0.15.2/LICENSE 0000664 0000000 0000000 00000002076 14760134766 0013772 0 ustar 00root root 0000000 0000000 The MIT License (MIT) Copyright (c) 2019 Sebastiรกn Ramรญrez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. typer-0.15.2/README.md 0000664 0000000 0000000 00000033177 14760134766 0014252 0 ustar 00root root 0000000 0000000
Typer, build great CLIs. Easy to code. Based on Python type hints.
--- **Documentation**: https://typer.tiangolo.com **Source Code**: https://github.com/fastapi/typer --- Typer is a library for building CLI applications that users will **love using** and developers will **love creating**. Based on Python type hints. It's also a command line tool to run scripts, automatically converting them to CLI applications. The key features are: * **Intuitive to write**: Great editor support. Completion everywhere. Less time debugging. Designed to be easy to use and learn. Less time reading docs. * **Easy to use**: It's easy to use for the final users. Automatic help, and automatic completion for all shells. * **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs. * **Start simple**: The simplest example adds only 2 lines of code to your app: **1 import, 1 function call**. * **Grow large**: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments. * **Run scripts**: Typer includes a `typer` command/program that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally. ## FastAPI of CLIs **Typer** is FastAPI's little sibling, it's the FastAPI of CLIs. ## Installation Create and activate a virtual environment and then install **Typer**:rich
: to show nicely formatted errors automatically.
* shellingham
: to automatically detect the current shell when installing completion.
* With `shellingham` you can just use `--install-completion`.
* Without `shellingham`, you have to pass the name of the shell to install completion for, e.g. `--install-completion bash`.
### `typer-slim`
If you don't want the extra standard optional dependencies, install `typer-slim` instead.
When you install with:
```bash
pip install typer
```
...it includes the same code and dependencies as:
```bash
pip install "typer-slim[standard]"
```
The `standard` extra dependencies are `rich` and `shellingham`.
**Note**: The `typer` command is only included in the `typer` package.
## License
This project is licensed under the terms of the MIT license.
typer-0.15.2/SECURITY.md 0000664 0000000 0000000 00000002210 14760134766 0014544 0 ustar 00root root 0000000 0000000 # Security Policy
Security is very important for Typer and its community. ๐
Learn more about it below. ๐
## Versions
The latest versions of Typer are supported.
You are encouraged to [write tests](https://typer.tiangolo.com/tutorial/testing/) for your application and update your Typer version frequently after ensuring that your tests are passing. This way you will benefit from the latest features, bug fixes, and **security fixes**.
## Reporting a Vulnerability
If you think you found a vulnerability, and even if you are not sure about it, please report it right away by sending an email to: security@tiangolo.com. Please try to be as explicit as possible, describing all the steps and example code to reproduce the security issue.
I (the author, [@tiangolo](https://twitter.com/tiangolo)) will review it thoroughly and get back to you.
## Public Discussions
Please restrain from publicly discussing a potential security vulnerability. ๐
It's better to discuss privately and try to find a solution first, to limit the potential impact as much as possible.
---
Thanks for your help!
The Typer community and I thank you for that. ๐
typer-0.15.2/data/ 0000775 0000000 0000000 00000000000 14760134766 0013671 5 ustar 00root root 0000000 0000000 typer-0.15.2/data/members.yml 0000664 0000000 0000000 00000000100 14760134766 0016035 0 ustar 00root root 0000000 0000000 members:
- login: tiangolo
- login: svlandeg
- login: patrick91
typer-0.15.2/docs/ 0000775 0000000 0000000 00000000000 14760134766 0013710 5 ustar 00root root 0000000 0000000 typer-0.15.2/docs/about/ 0000775 0000000 0000000 00000000000 14760134766 0015022 5 ustar 00root root 0000000 0000000 typer-0.15.2/docs/about/index.md 0000664 0000000 0000000 00000000102 14760134766 0016444 0 ustar 00root root 0000000 0000000 # About
About **Typer**, its design, inspiration, and more. ๐ค
typer-0.15.2/docs/alternatives.md 0000664 0000000 0000000 00000011505 14760134766 0016735 0 ustar 00root root 0000000 0000000 # Alternatives, Inspiration and Comparisons
What inspired **Typer**, how it compares to other alternatives and what it learned from them.
## Intro
**Typer** wouldn't exist if not for the previous work of others.
There have been many tools created before that have helped inspire its creation.
## Previous tools
### `argparse`
`argparse` is the Python standard library's module to write CLIs.
It provides a better alternative than reading the *CLI Parameters* as a `list` of `str` and parsing everything by hand.
/// check | Inspired **Typer** to
Provide a better development experience than just reading *CLI Parameters* by hand.
///
### Hug
Hug is a library to create APIs and CLIs, it uses parameters in functions to declare the required data.
It inspired a lot of the ideas in **FastAPI** and **Typer**.
/// check | Inspired **Typer** to
Use function parameters to declare *CLI arguments* and *CLI options* as it simplifies a lot the development experience.
///
### Plac
Plac is another library to create CLIs using parameters in functions, similar to Hug.
/// check | Inspired **Typer** to
Provide a simple way to use a function as a command line app, without having to create a complete app, with `typer.run(some_function)`.
///
### Pydantic
Pydantic is a library to handle data validation using standard modern Python type annotations.
It powers **FastAPI** underneath.
It is not used by **Typer**, but it inspired a lot of the design (through **FastAPI**).
/// check | Inspired **Typer** to
Use standard Python type annotations to declare types instead of library-specific types or classes and use them for data validation and documentation.
///
### Click
Click is one of the most widely used libraries to create CLIs in Python.
It's a very powerful tool and there are many CLIs built with it. It is what powers **Typer** underneath.
It also uses functions with parameters for *CLI arguments* and *CLI options*, but the declaration of the specific *CLI arguments*, *CLI options*, types, etc, is done in decorators on top of the function. This requires some code repetition (e.g. a *CLI Option* name `--verbose` and a variable name `verbose`) and synchronization between two places related to the same information (the decorator and the parameter function).
It uses decorators on top of functions to modify the actual value of those functions, converting them to instances of a specific class. This is a clever trick, but code editors can't provide great support for autocompletion that way.
It was built with some great ideas and design using the features available in the language at the time (Python 2.x).
/// check | **Typer** uses it for
Everything. ๐
**Typer** mainly adds a layer on top of Click, making the code simpler and easier to use, with autocompletion everywhere, etc, but providing all the powerful features of Click underneath.
As someone pointed out: "Nice to see it is built on Click but adds the type stuff. Me gusta!"
///
### `click-completion`
`click-completion` is a plug-in for Click. It was created to extend completion support for shells when Click only had support for Bash completion.
Previous versions of **Typer** had deep integrations with `click-completion` and used it as an optional dependency. But now all the completion logic is implemented internally in **Typer** itself, the internal logic was heavily inspired and using some parts of `click-completion`.
And now **Typer** improved it to have new features, tests, some bug fixes (for issues in plain `click-completion` and Click), and better support for shells, including modern versions of PowerShell (e.g. the default versions that come with Windows 10).
/// check | Inspired **Typer** to
Provide auto completion for all the shells.
///
### FastAPI
I created **FastAPI** to provide an easy way to build APIs with autocompletion for everything in the code (and some other features).
**Typer** is the "FastAPI of CLIs".
It uses the same design and usage of FastAPI as much as possible. So, if you have used FastAPI, you know how to use Typer.
typer-0.15.2/docs/contributing.md 0000664 0000000 0000000 00000017252 14760134766 0016750 0 ustar 00root root 0000000 0000000 # Development - Contributing
First, you might want to see the basic ways to [help Typer and get help](help-typer.md){.internal-link target=_blank}.
## Developing
If you already cloned the typer repository and you want to deep dive in the code, here are some guidelines to set up your environment.
### Virtual Environment
Follow the instructions to create and activate a [virtual environment](virtual-environments.md){.internal-link target=_blank} for the internal code of `typer`.
### Install Requirements Using `pip`
After activating the environment, install the required packages: