Giter VIP home page Giter VIP logo

kittycad.py's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar hanbollar avatar irev-dev avatar jessfraz avatar zoo-github-actions-auth[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kittycad.py's Issues

refactor to test docs generation

part of https://github.com/KittyCAD/website/issues/485

  • mypy static type checking
  • generate types w jinja templates or something like it
  • jsonpatch generation versus changing the spec
  • doctest tests the docs in code (but we don't want to test things like delete, perhaps we cn just test that they static type check for example golang and rust do this)
  • #83
  • make code way more dry, it super sucks right now

File conversion - inconsistent return types

Return types for create_file_conversion_with_base64_helper.sync() and .asyncio are generated as Optional[Union[Any, Tuple[FileConversion, bytes], Error]]

  1. We should remove Any type because it negates type checking
  2. Remove 'Optional` and return either a Success or Failure instead of None

The desired return type is Union[Tuple[FileConversion, bytes], Error]] or a hypothetical equivalent Union[FileConversionSuccess, Error]

to_dict() errors for mass and volume classes

fv: FileVolume = create_file_volume.sync(
        client=client,
        body=content,
        src_format=FileSourceFormat.OBJ)

fv.to_dict()

Errors with

Traceback (most recent call last):
  File "/Users/kurthutten/kittycad/litterbox/tutorials/get_mass/get_mass.py", line 26, in <module>
    fm.to_dict()
  File "/Users/kurthutten/kittycad/litterbox/my_env/lib/python3.9/site-packages/kittycad/models/file_mass.py", line 42, in to_dict
    id = self.id.value
AttributeError: 'Uuid' object has no attribute 'value'

Same thing for mass, and maybe others?

Library not functioning properly

When I try to create CAD models from text using the exact code from the documentation, I get this error:

File "------\venv\lib\site-packages\h11\_connection.py", line 520, in send return b"".join(data_list) TypeError: sequence item 1: expected a bytes-like object, tuple found

I realised this is beause the data_list that is being created in the send function has a tuple: ("prompt": <"whatever you put as prompt">)

If i manually change data_list to contain only the user prompt, I get this error:
error_code=None message='unable to parse JSON body: expected value at line 1 column 1' request_id='2cb8924a-3fb0-4224-8047-dbc2f746291c'

List_users_extended pagination token error

Our Python client library still has the pagination token bug. The raw API command works as intended, but the client lib does not. See below:

curl "https://api.kittycad.io/users-extended?limit=10&sort_by=created-at-ascending" \ --header "Authorization: Bearer bb403021-6de8-4191-ae3f-c3015b4458a4" | jq

Result:

{
  "next_page": "eyJ2IjoidjEiLCJwYWdlX3N0YXJ0Ijp7InNvcnRfYnkiOiJjcmVhdGVkLWF0LWFzY2VuZGluZyIsImxhc3Rfc2VlbiI6IjIwMjItMDEtMjdUMTk6NDM6MDIuMDU3WiJ9fQ==",
  "items": [
    {
      "id": "ckv5prd3j000609mlnmwlpyw8",
      "name": "Jess Frazelle",
      "email": "[email protected]",
      "image": "https://avatars.githubusercontent.com/u/1445228?v=4",
      "phone": "",
      "created_at": "2022-01-27T19:43:02.057Z",
      "updated_at": "2022-01-30T02:46:07.284Z",
      "github": "jessfraz",
      "mailchimp_id": "f167b0eaf91fc1348ba18042504b7898",
      "stripe_id": "cus_KTDi3DDw78NL4L",
      "front_id": "crd_2cbq32k"
    },
    {
      "id": "ckv5qow3c000608l03wos8i6c",
      "email": "[email protected]",
      "email_verified": "2022-03-11T01:57:51.293Z",
      "image": "",
      "phone": "",
      "created_at": "2022-01-27T19:43:02.057Z",
      "updated_at": "2022-03-11T01:57:51.425Z",
      "mailchimp_id": "a54ba22c38f91ae92f3c3141a224ca31",
      "stripe_id": "cus_KTTNd0YAsD59aR",
      "front_id": "crd_2cbq1fw"
.
.
Continued

Using the client lib:

from kittycad.client import Client as Kittycad_Client
from kittycad.api.users.list_users_extended import *
import json

kittycad_client = Kittycad_Client(token="bb403021-6de8-4191-ae3f-c3015b4458a4")

response = sync(
    sort_by = "created-at-ascending",
    client=kittycad_client,
    limit = 10)
print(response)

Result:

Error(error_code=<kittycad.types.Unset object at 0x104ec1e20>, message='unable to parse query string: failed to parse pagination token: corrupted token', request_id='8d1216fe-7be3-42f6-86e4-bb45aa3349c9', additional_properties={})

This also fails if you use the following:
page_token=""
page_token=None

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.