Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

This package provides basic JSON components like JSON reader and writer utilities and a JSON-RPC client proxy including the transport implementation for Zope3.

Detailed Documentation

README

We can use the JSONReader and JSONWriter if we need to convert a data structure to or from JSON syntax – in other words a EcmaScript mapping object. Let’s check the utilities:

>>> import zope.component
>>> from z3c.json import interfaces
>>> from z3c.json import testing
>>> testing.setUpJSONConverter()

JSONWriter Utility

>>> jsonWriter = zope.component.getUtility(interfaces.IJSONWriter)
>>> jsonWriter
<z3c.json.converter.JSONWriter object at ...>

Read some data:

>>> input = {u'a': ['fred', 7],
...          u'b': ['mary', 1.234]}
>>> jsonStr = jsonWriter.write(input)
>>> jsonStr
u'{"a":["fred",7],"b":["mary",1.234]}'

JSONReader Utility

>>> jsonReader = zope.component.getUtility(interfaces.IJSONReader)
>>> jsonReader
<z3c.json.converter.JSONReader object at ...>

Convert the data back to python:

>>> output = jsonReader.read(jsonStr)
>>> output
{u'a': [u'fred', 7], u'b': [u'mary', 1.234]}
>>> input == output
True

CHANGES

0.5.5 (2013-02-26)

  • More informative error message when the server returns an error.

0.5.4 (2010-08-30)

  • Fix my previous SafeBasicAuthTransport refactoring. Tests are still missing for SSL transports.

0.5.3 (2010-08-29)

  • Refactor BasicAuthTransport to reuse as much as possible from Transport that enables to do a simple SafeBasicAuthTransport

0.5.2 (2009-02-24)

  • raise ValueError for mixed parameters on any JSON-RPC version

  • do not test for response len if response is an int

  • fixed possible unicode error in case of response error

  • made all tests pass (JSONWriter inserts no whitespace)

  • added parse_response_headers to allow subclasses to handle header values if needed.

  • Implemented JSON-RPC 2.0 specification. Use JSON-RPC 2.0 version as default. Optional the version 1.0 and 1.1 can be set. See JSON-RPC 2.0 specification for more information.

0.5.1 (2008-01-24)

  • Improved meta-data.

0.5.0 (2008-01-21)

  • Initial Release

Metadata

Release files for z3c.json 0.5.5

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

Source distribution (sdist)

Source distribution for z3c.json 0.5.5
File Size Uploaded Provenance Actions
z3c.json-0.5.5.zip 32.0 kB Without provenance Details for z3c.json-0.5.5.zip

Release files / z3c.json-0.5.5.zip

Download URL z3c.json-0.5.5.zip
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2e4bc44003c75fd2ae4379c5116f08009be768ef5a274b784f0ce9fbc332aba0
BLAKE2b-256 checksum
How to use checksums
e2fbb81f6208f597cea8c2b087065b39e585a87e9c28934f07bc90464e2a5a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for z3c.json 0.5.5

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