.. automodule:: pysjtu.session :members:
.. automodule:: pysjtu.client :members:
Note
Anything that has request-compatible get, post methods and a _cache_store dict can be accepted as a Session.
.. automodule:: pysjtu.ocr :members:
Utilities helpful for creating the model for a new API. If you want to contribute to this project, you may want to read this.
This package uses marshmallow and marshmallow_dataclass to define the schema of the data.
Example
from marshmallow_dataclass import dataclass
from marshmallow import EXCLUDE
from pysjtu.fields import SplitField
@dataclass(base_schema=FinalizeHook(LoadDumpSchema)) # to support separate alias for load and dump
class Foo(Result):
bar: str
baz: int = mfield(required=True, load_key="baz_id")
names: WithField(List[str], field=SplitField, sep=",") = mfield(required=True)
For more complex use cases, you can read the schema of GPAQueryParams for reference.
.. automodule:: pysjtu.schema :members:
.. automodule:: pysjtu.exceptions :members: