<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/extmod/modujson.c, branch 6.1.0-beta.1</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0-beta.1</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0-beta.1'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-07-16T18:33:33+00:00</updated>
<entry>
<title>Merge pull request #3143 from tannewt/improve_json</title>
<updated>2020-07-16T18:33:33+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@adafruit.com</email>
</author>
<published>2020-07-16T18:33:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=88d89563783771daba2973eb8dc3faa237ba4b62'/>
<id>urn:sha1:88d89563783771daba2973eb8dc3faa237ba4b62</id>
<content type='text'>
Add support to json.load for any object with readinto</content>
</entry>
<entry>
<title>Fix stream version and add basic readinto test</title>
<updated>2020-07-11T00:33:17+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-07-11T00:33:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=372bcf8a956c8b20c423333114d7aa061dd54751'/>
<id>urn:sha1:372bcf8a956c8b20c423333114d7aa061dd54751</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add support to json.load for any object with readinto</title>
<updated>2020-07-10T23:42:32+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-07-10T23:42:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=734661e79cc2b108079377642ef24fab1217c484'/>
<id>urn:sha1:734661e79cc2b108079377642ef24fab1217c484</id>
<content type='text'>
This way we don't need to load the whole string version of the
json into memory.
</content>
</entry>
<entry>
<title>Add license to some obvious files.</title>
<updated>2020-07-06T18:16:25+00:00</updated>
<author>
<name>Diego Elio Pettenò</name>
<email>flameeyes@flameeyes.com</email>
</author>
<published>2020-06-03T22:40:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=34b4993d63a6b576f29d624385c681f679b4124c'/>
<id>urn:sha1:34b4993d63a6b576f29d624385c681f679b4124c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ujson: back out overeager loads() change; only change load()</title>
<updated>2020-05-11T04:56:01+00:00</updated>
<author>
<name>warriorofwire</name>
<email>3454741+WarriorOfWire@users.noreply.github.com</email>
</author>
<published>2020-05-11T04:56:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d8491f31768b04322728bc436b2f8e6c5f2bf0d6'/>
<id>urn:sha1:d8491f31768b04322728bc436b2f8e6c5f2bf0d6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ujson: do not eat trailing whitespace</title>
<updated>2020-05-11T03:45:42+00:00</updated>
<author>
<name>warriorofwire</name>
<email>3454741+WarriorOfWire@users.noreply.github.com</email>
</author>
<published>2020-05-11T03:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=eb3d5fa453bd04cc116e704c36a97250c93b7b4b'/>
<id>urn:sha1:eb3d5fa453bd04cc116e704c36a97250c93b7b4b</id>
<content type='text'>
Ujson should only worry about whitespace before JSON.  This becomes apparent when you are using MP stream protocol to read directly from input buffers.

When you attempt to read(1) on a UART (and possibly other protocols) you have to wait for either the byte or the timeout.

Fixes:
- Waiting for a timeout after you have completed reading a correct and complete JSON off the input.
- Raising an OSError after reading a correct and complete JSON off the input.
- Eating more data than semantically owned off the input buffer.
- Blocking to start parsing JSON until the entire JSON body has been loaded into a potentially large, contiguous Python object.

Code you would write before:
```
line = board_busio_uart_port.read_line()
json_dict = json.loads(line)
```
or reaching for fixed buffers and swapping them around in Python.

Code that did not work before that does now:
```
json_dict = json.load(board_busio_uart_port)
```

- This removes the need for intermediate copies of data when reading JSON from micropython stream protocol inputs.
- It also increases total application speed by parsing JSON concurrently with receiving on boards that read from UART via DMA.
- It simplifies code that users write while improving their apps.
</content>
</entry>
<entry>
<title>Add CIRCUITPY macro; rename u* only when CIRCUITPY=1</title>
<updated>2019-02-21T16:09:44+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-02-21T16:09:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=10d3a20f8a639ad8ef5555e2142052190e8a7e13'/>
<id>urn:sha1:10d3a20f8a639ad8ef5555e2142052190e8a7e13</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rename ure, ujson, and uerrno to re, json, and errno</title>
<updated>2019-02-21T05:33:36+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-02-21T05:33:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c5dbdbe88c099494cd14790b8c645020538eed27'/>
<id>urn:sha1:c5dbdbe88c099494cd14790b8c645020538eed27</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix esp and samd</title>
<updated>2018-08-17T00:41:35+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-08-16T20:34:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2cd166b57370ab4877ec2d9666225faeac6127ce'/>
<id>urn:sha1:2cd166b57370ab4877ec2d9666225faeac6127ce</id>
<content type='text'>
</content>
</entry>
<entry>
<title>extmod: Update to use new mp_get_stream helper.</title>
<updated>2018-06-18T02:35:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-06-13T02:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e8398a58567cc94b866d46721fd06289601f5c8a'/>
<id>urn:sha1:e8398a58567cc94b866d46721fd06289601f5c8a</id>
<content type='text'>
With this patch objects are only checked that they have the stream protocol
at the start of their use as a stream, and afterwards the efficient
mp_get_stream() helper is used to extract the stream protocol C methods.
</content>
</entry>
</feed>
