Skip to content

JsonProviderBase

Sub classes

Name Children Inherits
OrJsonProvider
anyenv.json_tools.orjson_provider.provider
OrJSON implementation of the JSON provider interface.
    MsgSpecProvider
    anyenv.json_tools.msgspec_provider.provider
    MsgSpec implementation of the JSON provider interface.
      StdLibProvider
      anyenv.json_tools.stdlib_provider.provider
      Standard library implementation of the JSON provider interface.
        PydanticProvider
        anyenv.json_tools.pydantic_provider.provider
        Pydantic implementation of the JSON provider interface.

          Base classes

          Name Children Inherits
          ABC
          abc
          Helper class that provides a standard way to create an ABC using

          ⋔ Inheritance diagram

          graph TD
            2738509685["base.JsonProviderBase"]
            925645236["abc.ABC"]
            2751680898["builtins.object"]
            925645236 --> 2738509685
            2751680898 --> 925645236

          🛈 DocStrings

          Bases: ABC

          Base class for all JSON providers.

          Source code in src/anyenv/json_tools/base.py
          class JsonProviderBase(abc.ABC):
              """Base class for all JSON providers."""
          
              @staticmethod
              @abc.abstractmethod
              def load_json(data: str | bytes | TextIOWrapper) -> Any:
                  """Load JSON data into Python objects."""
          
              @staticmethod
              @abc.abstractmethod
              def dump_json(
                  data: Any,
                  indent: bool = False,
                  naive_utc: bool = False,
                  serialize_numpy: bool = False,
                  sort_keys: bool = False,
              ) -> str:
                  """Dump Python objects to JSON string."""
          

          dump_json abstractmethod staticmethod

          dump_json(
              data: Any,
              indent: bool = False,
              naive_utc: bool = False,
              serialize_numpy: bool = False,
              sort_keys: bool = False,
          ) -> str
          

          Dump Python objects to JSON string.

          Source code in src/anyenv/json_tools/base.py
          @staticmethod
          @abc.abstractmethod
          def dump_json(
              data: Any,
              indent: bool = False,
              naive_utc: bool = False,
              serialize_numpy: bool = False,
              sort_keys: bool = False,
          ) -> str:
              """Dump Python objects to JSON string."""
          

          load_json abstractmethod staticmethod

          load_json(data: str | bytes | TextIOWrapper) -> Any
          

          Load JSON data into Python objects.

          Source code in src/anyenv/json_tools/base.py
          @staticmethod
          @abc.abstractmethod
          def load_json(data: str | bytes | TextIOWrapper) -> Any:
              """Load JSON data into Python objects."""
          

          :fa-brands-github: Show source on GitHub