Skip to main content

A utility for generating Daisy board support files from JSON descriptions

Project description

json2daisy

Utility for converting JSON board definitions into valid, libDaisy compatible C++ board support files for the Daisy platform.

Install

Note that this module is not intended as a standalone application at this time. You should not need to install it manually for most use cases.

You can install this package with pip:

python -m pip install json2daisy

If you'd like to build the package and install locally, you'll need the build package:

python -m pip install build

Once that's set up, navigate to the root directory of json2daisy and run:

python3 -m build
python3 -m pip install dist/json2daisy-0.2.0.tar.gz

If pip complains about a missing file, make sure you've entered the correct version number in the archive path.

Usage

This package can be used as a standalone program on the command line or as an imported module.

On the command line:

python -m json2daisy path/to/board_description.json

As a module:

import json2daisy

# If you want to generate from an Electrosmith board:
header_string, board_name, component_info, component_aliases = json2daisy.generate_header_from_board('field')
# If you're supplying custom JSON
header_string, board_name, component_info, component_aliases = json2daisy.generate_header_from_file('path/to/board_description.json')

As you can see, the two functions above will return a number of supplementary objects in addition to the header string. These provide detailed information for how to interact with the generated header. The component_info dictionary provides getters and setters for I/O, and the component_aliases dictionary provides valid aliases for everything in component_info.

For examples of how to structure the board description, take a look at the JSON files in src/json2daisy/resources.

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

json2daisy-0.4.2.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

json2daisy-0.4.2-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file json2daisy-0.4.2.tar.gz.

File metadata

  • Download URL: json2daisy-0.4.2.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for json2daisy-0.4.2.tar.gz
Algorithm Hash digest
SHA256 4a568eb503bd203c12fc17594a27fc4cc6b2eede8590ed150cb9cd8be3f4e6f8
MD5 0c6f9b525c124d2df35b2dd11a9db6e7
BLAKE2b-256 e1a15eec0c1922f6958d057e9c9cde6590582dcf7b8c9dbea0ec70af1cac4c37

See more details on using hashes here.

File details

Details for the file json2daisy-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: json2daisy-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for json2daisy-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2ba86735ade2fd76e12885ed5b6b553a3efcda05a71a052e9006f508c6f8f89
MD5 c1e3ea6f206493da9da328f124e92df9
BLAKE2b-256 5fa9bdc39fdd4bc71c282d1379c39863cec382005c88b30e4a7f60474486e58d

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