
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
.. image:: https://img.shields.io/pypi/v/metabooby.svg :target: https://pypi.python.org/pypi/metabooby :alt: Latest version
.. image:: https://img.shields.io/badge/Licence-Apache2-brightgreen.svg :target: https://www.tldrlegal.com/l/apache2 :alt: License
.. image:: https://img.shields.io/circleci/build/github/metabolize-forks/booby/master :target: https://app.circleci.com/pipelines/github/metabolize-forks/booby :alt: Build status
Booby is a standalone data modeling
and validation
library written in Python. Booby is under active development (visit this blog post <http://jaimegildesagredo.github.io/2014/01/04/booby-05-introducing-inspection-api.html>
_ for more info and the roadmap) and licensed under the Apache2 license <http://www.apache.org/licenses/LICENSE-2.0.html>
, so feel free to contribute <https://github.com/jaimegildesagredo/booby/pulls>
and report errors and suggestions <https://github.com/jaimegildesagredo/booby/issues>
_.
This is an active fork.
See the sample code below to get an idea of the main features.
.. code-block:: python
from booby import Model, fields
class Token(Model):
key = fields.String()
secret = fields.String()
class Address(Model):
line_1 = fields.String()
line_2 = fields.String()
class User(Model):
login = fields.String(required=True)
name = fields.String()
email = fields.Email()
token = fields.Embedded(Token, required=True)
addresses = fields.Collection(Address)
jack = User(
login='jack',
name='Jack',
email='jack@example.com',
token={
'key': 'vs7dfxxx',
'secret': 'ds5ds4xxx'
},
addresses=[
{'line_1': 'Main Street'},
{'line_1': 'Main St'}
]
)
if jack.is_valid:
print jack.to_json(indent=2)
else:
print json.dumps(dict(jack.validation_errors))
.. code-block:: json
{
"email": "jack@example.com",
"login": "jack",
"token": {
"secret": "ds5ds4xxx",
"key": "vs7dfxxx"
},
"name": "Jack",
"addresses": [
{
"line_1": "Main St",
"line_2": null
},
{
"line_1": "Main Street",
"line_2": null
}
]
}
You can install the last stable release of Booby from PyPI using pip or easy_install.
.. code-block:: bash
$ pip install booby
Also you can install the latest sources from Github.
.. code-block:: bash
$ pip install -e git+git://github.com/jaimegildesagredo/booby.git#egg=booby
To run the Booby test suite you should install the development requirements and then run nosetests.
.. code-block:: bash
$ pip install -r test-requirements.txt
$ nosetests tests/unit
$ nosetests tests/integration
See Changes <https://booby.readthedocs.org/en/latest/changes.html>
_.
FAQs
Data modeling and validation Python library
We found that metabooby 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.