Skip to main content

Python Package made by Mhadhbi Issam.

Project description

pydefoldsdk

defold protobuffers messages ported to python

install :

pip install pydefoldsdk

usage :

from pydefoldsdk import sdk 
from google.protobuf.json_format import MessageToJson
from google.protobuf.text_format import MessageToString, Parse
print(sdk)

content = '''
name: "menu"
scale_along_z: 0
embedded_instances {
  id: "go"
  data: "components {\\n"
  "  id: \\"menu\\"\\n"
  "  component: \\"/examples/collection/proxy/menu.gui\\"\\n"
  "  position {\\n"
  "    x: 0.0\\n"
  "    y: 0.0\\n"
  "    z: 0.0\\n"
  "  }\\n"
  "  rotation {\\n"
  "    x: 0.0\\n"
  "    y: 0.0\\n"
  "    z: 0.0\\n"
  "    w: 1.0\\n"
  "  }\\n"
  "}\\n"
  ""
  position {
    x: 0.0
    y: 0.0
    z: 0.0
  }
  rotation {
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0
  }
  scale3 {
    x: 1.0
    y: 1.0
    z: 1.0
  }
}
'''


collection = sdk.CollectionDesc()
Parse(content.encode('utf-8'), collection)
print(MessageToString(collection))
print(MessageToJson(collection,preserving_proto_field_name=True))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydefoldsdk-1.12.2.tar.gz (35.5 kB view details)

Uploaded Source

File details

Details for the file pydefoldsdk-1.12.2.tar.gz.

File metadata

  • Download URL: pydefoldsdk-1.12.2.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for pydefoldsdk-1.12.2.tar.gz
Algorithm Hash digest
SHA256 7be5381551ec0ae340b4f4e5e1a116faa88da782914c3a6173c621b6d414976e
MD5 216ec17b536f05858a0e47d036771116
BLAKE2b-256 131aa8068aadbba2231a952479cd6c6886728f05a42ea8a63a1a686e53a3be2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page