Skip to main content

afpy.ldap

This module provide an easy way to deal with ldap stuff in python.

This module is actively used on http://www.afpy.org to manage the french python comunity members.

Get a connection:

>>> from afpy.ldap import custom as ldap
>>> conn = ldap.get_conn()
>>> dn = 'uid=gawel,ou=members,dc=afpy,dc=org'
>>> node = conn.get_node(dn)
>>> node
<Node at uid=gawel,ou=members,dc=afpy,dc=org>

>>> print node.birthDate
19750410000000Z


>>> from afpy.ldap.node import Node
>>> from afpy.ldap import schema
>>> class User(Node):
...     uid=schema.StringProperty('uid')
...     birthDate = schema.DateProperty('birthDate', title='Date de naissance')
>>> node = conn.get_node(dn, node_class=User)
>>> node
<User at uid=gawel,ou=members,dc=afpy,dc=org>
>>> node.birthDate
datetime.date(1975, 4, 10)

Generate forms with FormAlchemy:

>>> from afpy.ldap import forms
>>> fs = forms.FieldSet(User)
>>> user = User()
>>> fs.rebind(user)
>>> print fs.render().strip() # doctest: +ELLIPSIS
<div>
  <label class="field_opt" for="User--uid">uid</label>
  <input id="User--uid" name="User--uid" type="text" />
</div>
...
<div>
  <label class="field_opt" for="User--birthDate">Date de naissance</label>
...

The source code can be find on the AFPy repository

Metadata

Release files for afpy.ldap 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for afpy.ldap 0.1
File Size Uploaded Provenance Actions
afpy.ldap-0.1.tar.gz 25.8 kB Without provenance Details for afpy.ldap-0.1.tar.gz

Release files / afpy.ldap-0.1.tar.gz

Download URL afpy.ldap-0.1.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
aad37350dce7d2519bf0452258a895a27628d6cbb80a346565150ea8309dec24
BLAKE2b-256 checksum
How to use checksums
a4f91f2fd86195ce27d48eae789eb01507e7781058716a9118242489730eaa75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for afpy.ldap 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page