Compare commits

..

1 Commits

Author SHA1 Message Date
af0d36d01f biump
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2022-01-28 15:06:10 -08:00
5318 changed files with 23382 additions and 1665430 deletions

View File

@ -1 +0,0 @@
.venv

1
.gitattributes vendored
View File

@ -1 +0,0 @@
docs/html/.doctrees/environment.pickle filter=lfs diff=lfs merge=lfs -text

View File

@ -1,38 +0,0 @@
name: black
on:
push:
branches: main
paths:
- '**.py'
- .github/workflows/black.yml
- 'pyproject.toml'
pull_request:
paths:
- '**.py'
- .github/workflows/black.yml
- 'pyproject.toml'
jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
# Installation instructions are from: https://python-poetry.org/docs/
- name: Install dependencies
shell: bash
run: |
pip install \
poetry
- name: Build
shell: bash
run: |
poetry install
poetry build
- name: Run black
shell: bash
run: |
poetry run black --check --diff . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py

View File

@ -5,26 +5,22 @@ on:
paths: paths:
- '**.py' - '**.py'
- .github/workflows/build-test.yml - .github/workflows/build-test.yml
- 'pyproject.toml'
- 'spec.json'
pull_request: pull_request:
paths: paths:
- '**.py' - '**.py'
- .github/workflows/build-test.yml - .github/workflows/build-test.yml
- 'pyproject.toml'
- 'spec.json'
jobs: jobs:
build-test: build-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: [3.8, 3.9] python-version: [3.6, 3.7, 3.8, 3.9]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
@ -41,6 +37,14 @@ jobs:
poetry install poetry install
poetry build poetry build
- name: Lint with flake8
shell: bash
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run pytest - name: Run pytest
shell: bash shell: bash
run: | run: |
@ -49,7 +53,7 @@ jobs:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v4 uses: codecov/codecov-action@v2
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true fail_ci_if_error: true

View File

@ -9,15 +9,21 @@ on:
- '**.rst' - '**.rst'
- '**.py' - '**.py'
- .github/workflows/generate-docs.yml - .github/workflows/generate-docs.yml
pull_request:
paths:
- docs/conf.py
- '**.rst'
- '**.py'
- .github/workflows/generate-docs.yml
jobs: jobs:
generate-docs: generate-docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v2
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.x python-version: 3.x
@ -40,7 +46,6 @@ jobs:
shell: bash shell: bash
run: | run: |
rm -rf docs/html rm -rf docs/html
rm -rf docs/_autosummary
poetry install poetry install
poetry run sphinx-build -b html docs/ docs/html/ poetry run sphinx-build -b html docs/ docs/html/

View File

@ -6,8 +6,6 @@ on:
paths: paths:
- 'Makefile' - 'Makefile'
- .github/workflows/generate.yml - .github/workflows/generate.yml
- 'spec.json'
- 'generate/generate.py'
workflow_dispatch: workflow_dispatch:
inputs: inputs:
jobs: jobs:
@ -16,15 +14,13 @@ jobs:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v2
with: with:
ref: ${{ github.event.pull_request.head.ref }} ref: ${{ github.event.pull_request.head.ref }}
- name: Run generate - name: Run generate
shell: bash shell: bash
run: | run: |
make generate make generate
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
- name: Check for modified files - name: Check for modified files
id: git-check id: git-check
@ -37,6 +33,5 @@ jobs:
git config --local user.name "github-actions[bot]" git config --local user.name "github-actions[bot]"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git fetch origin git fetch origin
git add .
git commit -am "I have generated the latest API!" || true git commit -am "I have generated the latest API!" || true
git push origin ${{github.event.pull_request.head.ref }} || true git push origin ${{github.event.pull_request.head.ref }} || true

View File

@ -2,16 +2,14 @@ on:
push: push:
tags: tags:
- v* - v*
permissions:
contents: write
name: make-release name: make-release
jobs: jobs:
makerelease: makerelease:
name: make-release name: make-release
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v2
- uses: actions/setup-python@v5 - uses: actions/setup-python@v2
with: with:
python-version: '3.x' python-version: '3.x'
# Installation instructions are from: https://python-poetry.org/docs/ # Installation instructions are from: https://python-poetry.org/docs/
@ -30,4 +28,4 @@ jobs:
# TODO: generate a nice little doc for the release text like we do for the # TODO: generate a nice little doc for the release text like we do for the
# cli repo. # cli repo.
- name: Create a Release - name: Create a Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v1

View File

@ -1,38 +0,0 @@
name: mypy
on:
push:
branches: main
paths:
- '**.py'
- .github/workflows/mypy.yml
- 'pyproject.toml'
pull_request:
paths:
- '**.py'
- .github/workflows/mypy.yml
- 'pyproject.toml'
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
# Installation instructions are from: https://python-poetry.org/docs/
- name: Install dependencies
shell: bash
run: |
pip install \
poetry
- name: Build
shell: bash
run: |
poetry install
poetry build
- name: Run mypy
shell: bash
run: |
poetry run mypy .

View File

@ -1,38 +0,0 @@
name: ruff
on:
push:
branches: main
paths:
- '**.py'
- .github/workflows/ruff.yml
- 'pyproject.toml'
pull_request:
paths:
- '**.py'
- .github/workflows/ruff.yml
- 'pyproject.toml'
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
# Installation instructions are from: https://python-poetry.org/docs/
- name: Install dependencies
shell: bash
run: |
pip install \
poetry
- name: Build
shell: bash
run: |
poetry install
poetry build
- name: Run ruff
shell: bash
run: |
poetry run ruff check --output-format=github .

View File

@ -1,77 +0,0 @@
on:
push:
tags:
- v*
pull_request:
paths:
- .github/workflows/update-spec-for-docs.yml
workflow_dispatch:
name: update spec for docs
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
update-spec:
name: update-spec
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ secrets.GH_ORG_APP_ID }}
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
- name: make generate
shell: bash
run: |
make generate
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
# Ensure no files changed.
- name: Ensure no files changed
shell: bash
run: |
if [[ `git status --porcelain kittycad/` ]]; then
echo "Files changed, exiting";
exit 1;
else
# No changes
echo "No files changed, proceeding";
fi
# Checkout the docs repo since we will want to update the files there.
- uses: actions/checkout@v4
with:
repository: 'kittycad/website'
path: 'docs'
token: ${{ steps.app-token.outputs.token }}
- name: move spec to docs
shell: bash
run: |
rm docs/kittycad.py.patch.json || true
cp kittycad.py.patch.json docs/kittycad.py.patch.json
- name: commit the changes in the docs repo
shell: bash
run: |
cd docs
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -am "YOYO NEW SPEC PYTHON DOCS!" || exit 0
git fetch origin
git rebase origin/main || exit 0
export NEW_BRANCH="update-spec-python"
git checkout -b "$NEW_BRANCH"
git push -f origin "$NEW_BRANCH"
gh pr create --title "Update lang spec docs for python" \
--body "Updating the generated docs for python" \
--head "$NEW_BRANCH" \
--reviewer jessfraz \
--reviewer irev-dev \
--reviewer franknoirot \
--base main || true
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

10
.gitignore vendored
View File

@ -10,7 +10,6 @@ dist/
# Environments # Environments
.env .env
.venv .venv
venv
# mypy # mypy
.mypy_cache/ .mypy_cache/
@ -23,11 +22,4 @@ dmypy.json
/coverage.xml /coverage.xml
/.coverage /.coverage
testing poetry.lock
# Sphinx documentation
docs/_build/
docs/_autosummary/
docs/html/_sources/
snapshot.png

View File

@ -1,13 +1,7 @@
FROM python:3.9 FROM python:latest
RUN pip install \ RUN pip install \
poetry openapi-python-client
WORKDIR /home/user/src/
COPY . /home/user/src/
RUN poetry update && poetry install
# Set the default command to bash. # Set the default command to bash.
CMD ["bash"] CMD ["bash"]

View File

@ -10,25 +10,14 @@ endif
VERSION := $(shell toml get $(CURDIR)/pyproject.toml tool.poetry.version | jq -r .) VERSION := $(shell toml get $(CURDIR)/pyproject.toml tool.poetry.version | jq -r .)
.PHONY: generate .PHONY: generate
generate: docker-image ## Generate the api client. generate: docker-image
docker run --rm -i $(DOCKER_FLAGS) \ docker run --rm -i $(DOCKER_FLAGS) \
--name python-generator \ --name python-generator \
-e KITTYCAD_API_TOKEN \ -v $(CURDIR):/usr/kittycad \
--disable-content-trust \ --workdir /usr \
-v $(CURDIR):/home/user/src \ $(DOCKER_IMAGE_NAME) openapi-python-client update \
--workdir /home/user/src \ --url https://api.kittycad.io \
$(DOCKER_IMAGE_NAME) ./generate/run.sh --config /usr/kittycad/config.yml
.PHONY: shell
shell: docker-image ## Pop into a shell in the docker image.
docker run --rm -i $(DOCKER_FLAGS) \
--name python-generator-shell \
-e KITTYCAD_API_TOKEN \
--disable-content-trust \
-v $(CURDIR):/home/user/src \
--workdir /home/user/src \
$(DOCKER_IMAGE_NAME) /bin/bash
.PHONY: docker-image .PHONY: docker-image
docker-image: docker-image:

View File

@ -2,15 +2,18 @@
The Python API client for KittyCAD. The Python API client for KittyCAD.
This is generated from
[openapi-generators/openapi-python-client](https://github.com/openapi-generators/openapi-python-client).
- [PyPI](https://pypi.org/project/kittycad/) - [PyPI](https://pypi.org/project/kittycad/)
- [Python docs](https://python.api.docs.zoo.dev/) - [Python docs](https://python.api.docs.kittycad.io/)
- [KittyCAD API Docs](https://zoo.dev/docs/api?lang=python) - [KittyCAD API Docs](https://docs.kittycad.io/?lang=python)
## Generating ## Generating
You can trigger a build with the GitHub action to generate the client. This will You can trigger a build with the GitHub action to generate the client. This will
automatically update the client to the latest version based on the spec hosted automatically update the client to the latest version based on the spec hosted
at [api.zoo.dev](https://api.zoo.dev/). at [api.kittycad.io](https://api.kittycad.io/).
Alternatively, if you wish to generate the client locally, make sure you have Alternatively, if you wish to generate the client locally, make sure you have
[Docker installed](https://docs.docker.com/get-docker/) and run: [Docker installed](https://docs.docker.com/get-docker/) and run:
@ -23,3 +26,44 @@ $ make generate
Please do not change the code directly since it is generated. PRs that change Please do not change the code directly since it is generated. PRs that change
the code directly will be automatically closed by a bot. the code directly will be automatically closed by a bot.
## Usage
First, create an authenticated client:
```python
from kittycad import AuthenticatedClient
client = AuthenticatedClient(token="your_token")
```
If you want to use the environment variable `KITTYCAD_API_TOKEN` to do
authentication and not pass one to the client, do the following:
```python
from kittycad import AuthenticatedClientFromEnv
client = AuthenticatedClientFromEnv()
```
Now call your endpoint and use your models:
```python
from kittycad.models import AuthSession
from kittycad.api.meta import meta_debug_session
from kittycad.types import Response
session: AuthSession = meta_debug_session.sync(client=client)
# or if you need more info (e.g. status_code)
response: Response[AuthSession] = meta_debug_session.sync_detailed(client=client)
```
Or do the same thing with an async version:
```python
from kittycad.models import AuthSession
from kittycad.api.meta import meta_debug_session
from kittycad.types import Response
session: AuthSession = await meta_debug_session.asyncio(client=client)
response: Response[AuthSession] = await meta_debug_session.asyncio_detailed(client=client)
```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2
config.yml Normal file
View File

@ -0,0 +1,2 @@
project_name_override: kittycad
package_name_override: kittycad

View File

@ -1,33 +0,0 @@
{{ fullname | escape | underline}}
.. currentmodule:: {{ module }}
.. autoclass:: {{ objname }}
:members:
:show-inheritance:
:inherited-members:
{% block methods %}
.. automethod:: __init__
{% if methods %}
.. rubric:: {{ _('Methods') }}
.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}
.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

View File

@ -1,67 +0,0 @@
{{ fullname | escape | underline}}
.. automodule:: {{ fullname }}
{% block attributes %}
{% if attributes %}
.. rubric:: Module Attributes
.. autosummary::
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}
.. autosummary::
:toctree:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}
.. autosummary::
:toctree:
:template: custom-class-template.rst
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}
.. autosummary::
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% block modules %}
{% if modules %}
.. rubric:: Modules
.. autosummary::
:toctree:
:template: custom-module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

View File

@ -0,0 +1,17 @@
AuthenticatedClient
===================
.. currentmodule:: kittycad
.. autoclass:: AuthenticatedClient
:show-inheritance:
.. rubric:: Methods Summary
.. autosummary::
~AuthenticatedClient.get_headers
.. rubric:: Methods Documentation
.. automethod:: get_headers

View File

@ -0,0 +1,27 @@
Client
======
.. currentmodule:: kittycad
.. autoclass:: Client
:show-inheritance:
.. rubric:: Methods Summary
.. autosummary::
~Client.get_cookies
~Client.get_headers
~Client.get_timeout
~Client.with_cookies
~Client.with_headers
~Client.with_timeout
.. rubric:: Methods Documentation
.. automethod:: get_cookies
.. automethod:: get_headers
.. automethod:: get_timeout
.. automethod:: with_cookies
.. automethod:: with_headers
.. automethod:: with_timeout

View File

@ -0,0 +1,6 @@
asyncio
=======
.. currentmodule:: kittycad.api.file.file_conversion_by_id
.. autofunction:: asyncio

View File

@ -0,0 +1,6 @@
asyncio_detailed
================
.. currentmodule:: kittycad.api.file.file_conversion_by_id
.. autofunction:: asyncio_detailed

View File

@ -0,0 +1,6 @@
sync
====
.. currentmodule:: kittycad.api.file.file_conversion_by_id
.. autofunction:: sync

View File

@ -0,0 +1,6 @@
sync_detailed
=============
.. currentmodule:: kittycad.api.file.file_conversion_by_id
.. autofunction:: sync_detailed

View File

@ -0,0 +1,6 @@
asyncio
=======
.. currentmodule:: kittycad.api.file.file_conversion_by_id_with_base64_helper
.. autofunction:: asyncio

View File

@ -0,0 +1,6 @@
sync
====
.. currentmodule:: kittycad.api.file.file_conversion_by_id_with_base64_helper
.. autofunction:: sync

View File

@ -0,0 +1,6 @@
asyncio
=======
.. currentmodule:: kittycad.api.file.file_convert
.. autofunction:: asyncio

View File

@ -0,0 +1,6 @@
asyncio_detailed
================
.. currentmodule:: kittycad.api.file.file_convert
.. autofunction:: asyncio_detailed

View File

@ -0,0 +1,6 @@
sync
====
.. currentmodule:: kittycad.api.file.file_convert
.. autofunction:: sync

View File

@ -0,0 +1,6 @@
sync_detailed
=============
.. currentmodule:: kittycad.api.file.file_convert
.. autofunction:: sync_detailed

View File

@ -0,0 +1,6 @@
asyncio
=======
.. currentmodule:: kittycad.api.file.file_convert_with_base64_helper
.. autofunction:: asyncio

View File

@ -0,0 +1,6 @@
sync
====
.. currentmodule:: kittycad.api.file.file_convert_with_base64_helper
.. autofunction:: sync

View File

@ -0,0 +1,6 @@
asyncio
=======
.. currentmodule:: kittycad.api.meta.meta_debug_instance
.. autofunction:: asyncio

View File

@ -0,0 +1,6 @@
asyncio_detailed
================
.. currentmodule:: kittycad.api.meta.meta_debug_instance
.. autofunction:: asyncio_detailed

View File

@ -0,0 +1,6 @@
sync
====
.. currentmodule:: kittycad.api.meta.meta_debug_instance
.. autofunction:: sync

View File

@ -0,0 +1,6 @@
sync_detailed
=============
.. currentmodule:: kittycad.api.meta.meta_debug_instance
.. autofunction:: sync_detailed

View File

@ -0,0 +1,6 @@
asyncio
=======
.. currentmodule:: kittycad.api.meta.meta_debug_session
.. autofunction:: asyncio

View File

@ -0,0 +1,6 @@
asyncio_detailed
================
.. currentmodule:: kittycad.api.meta.meta_debug_session
.. autofunction:: asyncio_detailed

View File

@ -0,0 +1,6 @@
sync
====
.. currentmodule:: kittycad.api.meta.meta_debug_session
.. autofunction:: sync

View File

@ -0,0 +1,6 @@
sync_detailed
=============
.. currentmodule:: kittycad.api.meta.meta_debug_session
.. autofunction:: sync_detailed

View File

@ -0,0 +1,6 @@
asyncio
=======
.. currentmodule:: kittycad.api.meta.ping
.. autofunction:: asyncio

View File

@ -0,0 +1,6 @@
asyncio_detailed
================
.. currentmodule:: kittycad.api.meta.ping
.. autofunction:: asyncio_detailed

View File

@ -0,0 +1,6 @@
sync
====
.. currentmodule:: kittycad.api.meta.ping
.. autofunction:: sync

View File

@ -0,0 +1,6 @@
sync_detailed
=============
.. currentmodule:: kittycad.api.meta.ping
.. autofunction:: sync_detailed

View File

@ -0,0 +1,17 @@
AuthenticatedClient
===================
.. currentmodule:: kittycad.client
.. autoclass:: AuthenticatedClient
:show-inheritance:
.. rubric:: Methods Summary
.. autosummary::
~AuthenticatedClient.get_headers
.. rubric:: Methods Documentation
.. automethod:: get_headers

View File

@ -0,0 +1,17 @@
AuthenticatedClientFromEnv
==========================
.. currentmodule:: kittycad.client
.. autoclass:: AuthenticatedClientFromEnv
:show-inheritance:
.. rubric:: Methods Summary
.. autosummary::
~AuthenticatedClientFromEnv.get_headers
.. rubric:: Methods Documentation
.. automethod:: get_headers

View File

@ -0,0 +1,27 @@
Client
======
.. currentmodule:: kittycad.client
.. autoclass:: Client
:show-inheritance:
.. rubric:: Methods Summary
.. autosummary::
~Client.get_cookies
~Client.get_headers
~Client.get_timeout
~Client.with_cookies
~Client.with_headers
~Client.with_timeout
.. rubric:: Methods Documentation
.. automethod:: get_cookies
.. automethod:: get_headers
.. automethod:: get_timeout
.. automethod:: with_cookies
.. automethod:: with_headers
.. automethod:: with_timeout

View File

@ -0,0 +1,29 @@
AuthSession
===========
.. currentmodule:: kittycad.models
.. autoclass:: AuthSession
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~AuthSession.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~AuthSession.from_dict
~AuthSession.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,21 @@
Environment
===========
.. currentmodule:: kittycad.models
.. autoclass:: Environment
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~Environment.DEVELOPMENT
~Environment.PREVIEW
~Environment.PRODUCTION
.. rubric:: Attributes Documentation
.. autoattribute:: DEVELOPMENT
.. autoattribute:: PREVIEW
.. autoattribute:: PRODUCTION

View File

@ -0,0 +1,29 @@
ErrorMessage
============
.. currentmodule:: kittycad.models
.. autoclass:: ErrorMessage
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~ErrorMessage.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~ErrorMessage.from_dict
~ErrorMessage.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,29 @@
FileConversion
==============
.. currentmodule:: kittycad.models
.. autoclass:: FileConversion
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~FileConversion.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~FileConversion.from_dict
~FileConversion.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,25 @@
FileConversionStatus
====================
.. currentmodule:: kittycad.models
.. autoclass:: FileConversionStatus
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~FileConversionStatus.COMPLETED
~FileConversionStatus.FAILED
~FileConversionStatus.IN_PROGRESS
~FileConversionStatus.QUEUED
~FileConversionStatus.UPLOADED
.. rubric:: Attributes Documentation
.. autoattribute:: COMPLETED
.. autoattribute:: FAILED
.. autoattribute:: IN_PROGRESS
.. autoattribute:: QUEUED
.. autoattribute:: UPLOADED

View File

@ -0,0 +1,29 @@
InstanceMetadata
================
.. currentmodule:: kittycad.models
.. autoclass:: InstanceMetadata
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~InstanceMetadata.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~InstanceMetadata.from_dict
~InstanceMetadata.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,29 @@
Message
=======
.. currentmodule:: kittycad.models
.. autoclass:: Message
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~Message.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~Message.from_dict
~Message.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,25 @@
ValidFileTypes
==============
.. currentmodule:: kittycad.models
.. autoclass:: ValidFileTypes
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~ValidFileTypes.DWG
~ValidFileTypes.DXF
~ValidFileTypes.OBJ
~ValidFileTypes.STEP
~ValidFileTypes.STL
.. rubric:: Attributes Documentation
.. autoattribute:: DWG
.. autoattribute:: DXF
.. autoattribute:: OBJ
.. autoattribute:: STEP
.. autoattribute:: STL

View File

@ -0,0 +1,29 @@
AuthSession
===========
.. currentmodule:: kittycad.models.auth_session
.. autoclass:: AuthSession
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~AuthSession.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~AuthSession.from_dict
~AuthSession.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,21 @@
Environment
===========
.. currentmodule:: kittycad.models.environment
.. autoclass:: Environment
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~Environment.DEVELOPMENT
~Environment.PREVIEW
~Environment.PRODUCTION
.. rubric:: Attributes Documentation
.. autoattribute:: DEVELOPMENT
.. autoattribute:: PREVIEW
.. autoattribute:: PRODUCTION

View File

@ -0,0 +1,29 @@
ErrorMessage
============
.. currentmodule:: kittycad.models.error_message
.. autoclass:: ErrorMessage
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~ErrorMessage.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~ErrorMessage.from_dict
~ErrorMessage.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,29 @@
FileConversion
==============
.. currentmodule:: kittycad.models.file_conversion
.. autoclass:: FileConversion
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~FileConversion.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~FileConversion.from_dict
~FileConversion.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,25 @@
FileConversionStatus
====================
.. currentmodule:: kittycad.models.file_conversion
.. autoclass:: FileConversionStatus
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~FileConversionStatus.COMPLETED
~FileConversionStatus.FAILED
~FileConversionStatus.IN_PROGRESS
~FileConversionStatus.QUEUED
~FileConversionStatus.UPLOADED
.. rubric:: Attributes Documentation
.. autoattribute:: COMPLETED
.. autoattribute:: FAILED
.. autoattribute:: IN_PROGRESS
.. autoattribute:: QUEUED
.. autoattribute:: UPLOADED

View File

@ -0,0 +1,25 @@
FileConversionStatus
====================
.. currentmodule:: kittycad.models.file_conversion_status
.. autoclass:: FileConversionStatus
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~FileConversionStatus.COMPLETED
~FileConversionStatus.FAILED
~FileConversionStatus.IN_PROGRESS
~FileConversionStatus.QUEUED
~FileConversionStatus.UPLOADED
.. rubric:: Attributes Documentation
.. autoattribute:: COMPLETED
.. autoattribute:: FAILED
.. autoattribute:: IN_PROGRESS
.. autoattribute:: QUEUED
.. autoattribute:: UPLOADED

View File

@ -0,0 +1,29 @@
InstanceMetadata
================
.. currentmodule:: kittycad.models.instance_metadata
.. autoclass:: InstanceMetadata
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~InstanceMetadata.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~InstanceMetadata.from_dict
~InstanceMetadata.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,29 @@
Message
=======
.. currentmodule:: kittycad.models.message
.. autoclass:: Message
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~Message.additional_keys
.. rubric:: Methods Summary
.. autosummary::
~Message.from_dict
~Message.to_dict
.. rubric:: Attributes Documentation
.. autoattribute:: additional_keys
.. rubric:: Methods Documentation
.. automethod:: from_dict
.. automethod:: to_dict

View File

@ -0,0 +1,25 @@
ValidFileTypes
==============
.. currentmodule:: kittycad.models.valid_file_types
.. autoclass:: ValidFileTypes
:show-inheritance:
.. rubric:: Attributes Summary
.. autosummary::
~ValidFileTypes.DWG
~ValidFileTypes.DXF
~ValidFileTypes.OBJ
~ValidFileTypes.STEP
~ValidFileTypes.STL
.. rubric:: Attributes Documentation
.. autoattribute:: DWG
.. autoattribute:: DXF
.. autoattribute:: OBJ
.. autoattribute:: STEP
.. autoattribute:: STL

View File

@ -0,0 +1,17 @@
File
====
.. currentmodule:: kittycad.types
.. autoclass:: File
:show-inheritance:
.. rubric:: Methods Summary
.. autosummary::
~File.to_tuple
.. rubric:: Methods Documentation
.. automethod:: to_tuple

View File

@ -0,0 +1,7 @@
Response
========
.. currentmodule:: kittycad.types
.. autoclass:: Response
:show-inheritance:

View File

@ -4,39 +4,36 @@
# list see the documentation: # list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html # https://www.sphinx-doc.org/en/master/usage/configuration.html
import datetime # -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os import os
import pathlib
import sys import sys
from typing import List
import toml
# The full version, including alpha/beta/rc tags
# Get the version from the pyproject file.
ROOT = pathlib.Path(__file__).parent.parent
PACKAGE_SRC = ROOT / "kittycad"
sys.path.insert(1, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(1, os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.abspath("../kittycad")) sys.path.append(os.path.abspath('../kittycad'))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = "kittycad" project = 'kittycad'
author = "KittyCAD Team Members" author = 'KittyCAD Team Members'
year = datetime.date.today().year copyright = author
copyright = str(year) + ", " + author
with open(os.path.abspath("../pyproject.toml"), "r") as f: # The full version, including alpha/beta/rc tags
# Get the version from the poetry file.
import toml
with open(os.path.abspath('../pyproject.toml'), 'r') as f:
parsed_toml = toml.load(f) parsed_toml = toml.load(f)
version = parsed_toml["tool"]["poetry"]["version"] version = parsed_toml['tool']['poetry']['version']
version = "v" + version version = 'v'+version
release = version release = version
language = "en"
default_role = "any"
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
@ -45,34 +42,25 @@ default_role = "any"
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [ extensions = [
"autoclasstoc", 'sphinx.ext.autodoc',
"sphinx.ext.autodoc", 'sphinx_autodoc_typehints',
"sphinx.ext.autosectionlabel", 'sphinx.ext.intersphinx',
"sphinx.ext.autosummary", 'sphinx.ext.linkcode',
"sphinx.ext.coverage", 'sphinx_automodapi.automodapi',
"sphinx.ext.doctest", 'sphinx_rtd_theme'
"sphinx.ext.graphviz",
"sphinx.ext.imgconverter",
"sphinx.ext.intersphinx",
"sphinx.ext.linkcode",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
"sphinx_rtd_theme",
"sphinx_copybutton",
"sphinxext.opengraph",
] ]
numpydoc_show_class_members = False numpydoc_show_class_members = False
automodapi_inheritance_diagram = False
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"] templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path. # This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output ------------------------------------------------- # -- Options for HTML output -------------------------------------------------
@ -80,62 +68,35 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
# #
html_theme = "sphinx_rtd_theme" html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom themes here, relative to this directory. # Add any paths that contain custom themes here, relative to this directory.
html_theme_path: List[str] = [] html_theme_path = [
]
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path: List[str] = [] html_static_path = []
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = "trac" pygments_style = 'trac'
# pygments_style = "lovelace"
# pygments_dark_style = "one-dark"
# -- autodoc --
autodoc_default_options = {
"members": True,
"special-members": True,
"private-members": True,
"inherited-members": True,
"undoc-members": True,
"exclude-members": "__weakref__",
}
autodoc_inherit_docstrings = True
# -- autosummary --
autosummary_generate = True
autoclass_content = "both"
html_show_sourcelink = False
set_type_checking_flag = True
# -- autosectionlabel --
autosectionlabel_prefix_document = True
# -- intersphinx --
# Intersphinx configuration.
# FROM: https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#module-sphinx.ext.intersphinx
intersphinx_mapping = { intersphinx_mapping = {
"python": ("https://docs.python.org/3", None), 'python': ('https://python.readthedocs.io/en/latest/', None),
} }
# This is a function linkcode_resolve(domain, info), which should return the URL # This is a function linkcode_resolve(domain, info), which should return the URL
# to source code corresponding to the object in given domain with given information. # to source code corresponding to the object in given domain with given information.
# FROM: https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html # FROM: https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html
def linkcode_resolve(domain, info): def linkcode_resolve(domain, info):
if domain != "py": if domain != 'py':
return None return None
if not info["module"]: if not info['module']:
return None return None
filename = info["module"].replace(".", "/") filename = info['module'].replace('.', '/')
return "https://github.com/kittycad/kittycad.py/%s.py" % filename return "https://github.com/kittycad/kittycad.py/%s.py" % filename
@ -143,10 +104,10 @@ def linkcode_resolve(domain, info):
try: try:
import enchant # noqa # pylint: disable=unused-import import enchant # noqa # pylint: disable=unused-import
except ImportError as ex: except ImportError as ex:
print( print("enchant module import failed:\n"
"enchant module import failed:\n" "{0}\n" "Spell checking disabled.".format(ex), "{0}\n"
file=sys.stderr, "Spell checking disabled.".format(ex),
) file=sys.stderr)
else: else:
extensions.append("sphinxcontrib.spelling") extensions.append('sphinxcontrib.spelling')
spelling_show_suggestions = True spelling_show_suggestions = True

View File

@ -1,4 +1,4 @@
# Sphinx build info version 1 # Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 0b5dd250bc7c7094bb05ab8e56ad5292 config: fedaf56120cb91b327d8a023250f850a
tags: 645f666f9bcd5a90fca523b33c5a78b7 tags: 645f666f9bcd5a90fca523b33c5a78b7

Some files were not shown because too many files have changed in this diff Show More