
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
ldapper is a hassle-free Python LDAP ORM for getting real work done.
It extends the robust capabilities of python-ldap and augments it with higher-level interfaces to define your schema. Listing and fetching all your LDAP objects is easy and straightforward. Modifications and validation can be made with assurance using ldapper.
ldapper requires:
Version 0.9.0 was the last to support Python 2.
from ldapper.connection import BaseConnection
from ldapper.ldapnode import LDAPNode
from ldapper import fields
# define a connection
class Connection(BaseConnection):
BASE_DN = 'dc=example,dc=com'
URI = 'ldaps://ldap.example.com'
# define a common LDAPNode that holds the connection class you defined
class BaseModel(LDAPNode):
connection = Connection
# define a class to represent people
class Person(BaseModel):
uid = fields.StringField('uid', primary=True)
uidnumber = fields.IntegerField('uidNumber')
firstname = fields.StringField('givenName')
lastname = fields.StringField('sn')
email_addresses = fields.ListField('mailLocalAddress')
photo = fields.BinaryField('jpegPhoto', optional=True)
class Meta:
objectclasses = ['top', 'inetOrgPerson', 'inetLocalMailRecipient']
dn_format = 'uid=%(uid)s,ou=people'
primary_dnprefix = 'ou=people'
secondary_dnprefix = 'ou=people'
identifying_attrs = ['uid']
searchable_fields = [
'uid', 'uidNumber', 'givenName', 'sn', 'mailLocalAddress']
# use the Person class
person = Person.fetch('liam')
person.displayname = 'Chuck Yeager'
person.save()
person.delete()
from ldapper.query import Q
Person.filter(Q(firstname='Foo') | Q(lastname='Bar'))
Available at https://ldapper.readthedocs.io/
Please see the README.md file in the test directory for information on running unit tests.
FAQs
LDAP ORM for Python
We found that ldapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.