![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
An ORM-like Pymongo extension that adds json schema validation, index management and intermediate data manipulators
Pymongoext is an ORM-like Pymongo extension that adds json schema validation, index management and intermediate data manipulators. Pymongoext simplifies working with MongoDB, while maintaining a syntax very identical to Pymongo.
pymongoext.Model
is simply a wrapper around pymongo.Collection
.
As such, all of the pymongo.Collection API is exposed through pymongoext.Model.
If you don't find what you want in the pymongoext.Model API,
please take a look at pymongo's Collection documentation.
Documentation is available at https://pymongoext.readthedocs.io
The code is hosted on Github https://github.com/musyoka-morris/pymongoext
Pymongoext uses JSON Schema for validation and thus we only support MongoDB v3.6+.
Pymongoext supports python v3+. Support for python v2.7 is currently under consideration.
We recommend the use of virtualenv <https://virtualenv.pypa.io>
_ and of
pip <https://pip.pypa.io>
_. You can then use pip install -U pymongoext
.
You may also have setuptools <http://peak.telecommunity.com/DevCenter/setuptools>
_
and thus you can use easy_install -U pymongoext
. Another option is
pipenv <https://docs.pipenv.org>
_. You can then use pipenv install pymongoext
to both create the virtual environment and install the package.
Alternatively, you can download the source from GitHub <https://github.com/musyoka-morris/pymongoext>
_ and
run python setup.py install
.
Some simple examples of what pymongoext code looks like:
.. code :: python
from datetime import datetime
from pymongo import MongoClient, IndexModel
from pymongoext import *
class User(Model):
@classmethod
def db(cls):
return MongoClient()['my_database_name']
__schema__ = DictField(dict(
email=StringField(required=True),
name=StringField(required=True),
yob=IntField(minimum=1900, maximum=2019)
))
__indexes__ = [IndexModel('email', unique=True), 'name']
class AgeManipulator(Manipulator):
def transform_outgoing(self, doc, model):
doc['age'] = datetime.now().year - doc['yob']
return doc
# Create a user
>>> User.insert_one({'email': 'jane@gmail.com', 'name': 'Jane Doe', 'yob': 1990})
# Fetch one user
>>> user = User.find_one()
# Print the users age
>>> print(user.age)
We welcome contributions!
See the Contribution guidelines <https://github.com/musyoka-morris/pymongoext/blob/master/CONTRIBUTING.rst>
_
FAQs
An ORM-like Pymongo extension that adds json schema validation, index management and intermediate data manipulators
We found that pymongoext 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.