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
Built Distribution
File details
Details for the file wstd2daisy-0.5.3.tar.gz
.
File metadata
- Download URL: wstd2daisy-0.5.3.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf6bbc6d08cf1f4d36c1aac2f1ca0c7a7b393c49308757bb3f91b05f8cf397a |
|
MD5 | d84eb185fb0bc9308adcd47aa350244a |
|
BLAKE2b-256 | d7959694ab6fa53b9a84f27b7e7e9a9d1a876aca458fd19c554425d833f5681b |
File details
Details for the file wstd2daisy-0.5.3-py3-none-any.whl
.
File metadata
- Download URL: wstd2daisy-0.5.3-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd566d89bb36ec9fb245acff166f401a71374f044ec8db421a08eedd52bbe07b |
|
MD5 | 940ed14a02f7c67ceccb686d90e8c72e |
|
BLAKE2b-256 | 842e864b0f8a6aa663743608769d59bb175636468a3aa7e355b2af5837cc4d52 |