Skip to main content

GRANOLA

GRANOLA (Generating Real-time Autonomous N-device Output without Linked Apparatuses) is a package aiming to mock Pyserial's Serial with the goal of enabling automated testing, faster QA, and faster delivery. The core of this package is the class Cereal. Cereal allows you to define complicated command and response sequences, getters and setters for commands that set attributes on your device (such as the serial number), a hook system to inject your own needed functionality, and a Serial Sniffer to capture serial command output from a real device as the basis of mocking later.

warning!

This project is still in it's beta, pre 1.0 stage with active development moving towards its 1.0 release.
We try and not break previous interfaces when we move to new releases, but until it is ready for 1.0, it is still
unstable.

Package Installation

To install:

pip install granola

A Simple Example

>>> from granola import Cereal
>>> command_readers = {"CannedQueries": {"data": [{"1\r": "1", "2\r": ["2a", "2b"]}]}}
>>> mock_cereal = Cereal(command_readers)

>>> mock_cereal.write(b"2\r")
2
>>> mock_cereal.read(2)
b'2a'
>>> mock_cereal.write(b"1\r")
2
>>> mock_cereal.read(1)
b'1'

Metadata

Release files for granola 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for granola 0.9.3
File Size Uploaded Provenance Actions
granola-0.9.3.tar.gz 53.8 kB Without provenance Details for granola-0.9.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for granola 0.9.3
File Interpreter ABI Platform Actions
granola-0.9.3-py3-none-any.whl Python 3 none any Details for granola-0.9.3-py3-none-any.whl

Total release size: 97.9 kB

Release files / granola-0.9.3.tar.gz

Download URL granola-0.9.3.tar.gz
Size 53.8 kB
Tags Source
SHA-256 checksum
How to use checksums
098edf4b6aaf6e43ce7e2c3040a3d069659eef5636817dc33f484ab8214153fa
BLAKE2b-256 checksum
How to use checksums
e0401b521cd2efb7fac978da1be9c540b6824b6476221d529b088634ebc13ad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

Release files / granola-0.9.3-py3-none-any.whl

Download URL granola-0.9.3-py3-none-any.whl
Size 44.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f554d00a22899347fe446925ad14219cf1783e078c11bfa21da5736fd5ee5eae
BLAKE2b-256 checksum
How to use checksums
9cea39689cdcd315c6264ef200efd5c767faeb18ba3ff526b8e07684f1d0bf50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

Security for granola 0.9.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page