Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
statham
is a Python Model Parsing Library for JSON Schema. Read the documentation.
This project includes tools for writing and generating extensible Python classes based on JSON Schema documents.
statham
can be used to write JSON Schema documents and their corresponding application-level models in one go:
from typing import List
from statham.schema.elements import Array, Integer, Object, String
from statham.schema.property import Property
class Choice(Object):
choice_text: str = Property(String(maxLength=200), required=True)
votes: int = Property(Integer(default=0))
class Poll(Object):
question: str = Property(String(), required=True)
choices: List[Choice] = Property(Array(Choice), required=True)
Alternatively, Python models may be generated automatically from an existing schema:
statham --input http://example.com/schema.json
Required arguments:
--input INPUT Specify the path to the JSON Schema to be generated.
If the target schema is not at the root of a document, specify the
JSON Pointer in the same format as a JSON Schema `$ref`, e.g.
`--input path/to/document.json#/definitions/schema`
Optional arguments:
--output OUTPUT Output directory or file in which to write the output.
If the provided path is a directory, the command will derive the name
from the input argument. If not passed, the command will write to
stdout.
-h, --help Display this help message and exit.
This project requires Python 3.6+ and may be installed using pip:
pip install statham-schema
See Compatibility for information regarding the currently supported JSON Schema draft and exceptions.
git clone git@github.com:jacksmith15/statham-schema.git && cd statham-schema
git submodule update --init --recursive
pip install -r requirements.txt -r requirements-test.txt
pre-commit install
bash run_test.sh -c -a
This project uses the following QA tools:
Documentation is written using Sphinx.
This project is distributed under the MIT license.
FAQs
Tools for generating Python models from JSON Schema documents.
We found that statham-schema demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.