Saravanan666/pypi-org huggingface dataset:
Package: ldap_paged_search
Summaryldap_paged_search is a python library to easily perform LDAP queries with more
than 1000 results, or to break down queries into smaller result sets to reduce
server loads.Many LDAP servers, such as active directory, will not return more than 1000
results unless paged requests are used.  The existing python ldap library does
support pageing, but requires some not very intuitive coding to perform it.
This library is simply a wrapper to make paged searches easy.Its interface is also slightly easier to perform queries than the LDAP library
it wraps.RequirementsTested on python 2.8Default python library includes ldap libraryInstallationVia pip or easy_install$sudopipinstallldap_paged_search# If you prefer PIP$sudoeasy_installldap_paged_search# If you prefer easy_installManual installation$gitclonehttps://github.com/neoCrimeLabs/python-ldap_paged_search.git$cdpython-ldap_paged_search$sudopythonsetup.pyinstallUsageInitial setupfromldap_paged_searchimportLdapPagedSearch# Required valuesurl='ldap://your.ldap.server'username='username'# for anything but active directoryusername='domain\\user'# for active directorypassword='yourPassword'baseDN='dc=company,dc=com'searchFilter='(&(objectCategory=user))'# Optional valuesmaxPages=0# 0 = everythingmaxPages=10# Return first 10 pages onlyattributes=['*']# Return all fieldsattributes=['FieldName','AnotherField']# Return specific fields onlypageSize=1000# How many records per page# Usual max is 1000; check your LDAP server docsDefining a callback method# Using a callback method to process results uses less memory on large queries# Not using a callback search() will return all results as a single listdefmyCallback(dn,record):printdn,recordQuery using ‘with’# maxPages, pageSize, attributes, and callback are all OPTIONALwithLdapPagedSearch(url,username,password,maxPages=2,pageSize=2)asl:results=l.search(baseDN,searchFilter,attributes=attributes,callback=myCallback)Alternative query method# maxPages, pageSize, attributes, and callback are all OPTIONALl=LdapPagedSearch(url,username,password,maxPages=2,pageSize=2)results=l.search(baseDN,searchFilter,attributes=attributes,callback=myCallback)Results format# If you don't set a callback, your results will be returned as follows[('DistinctName1',{'FieldName':['value1','value2'],'AnotherField':['value'],}),('DistinctName2',{'FieldName':['value1','value2'],'AnotherField':['value'],}),...]Conditions of UseI wrote this library for my own use, but realized others may find it useful as
there were many forum topics describing this problem.Unfortunately I cannot guarentee any active support, but will do my best as time
permits.  That said, I’ll happily accept push requests with suitable changes
that address the general audience of this library.Put simply, use this at your own risk.  If it works, great!  If not, I may not
be able to help you.  If you fix anything, however, please push it back and I’ll
likely accept it.  :-)Also, if you use this library in your package, tool, or comercial software, let
me know, and I’ll list it here!
Package: ldappas
0.8.3 (2011-02-10)Change conditional usage of ZCML registrations for views to use
‘have’ instead of ‘installed’ to account for consumers of zope.app.form
which aren’t using the meta.zcml of that package.Display this changelog on PyPI.0.8.2 (2011-01-25)Actuallyremovezope.app.testing from the non-testing dependencies!0.8.1 (2011-01-25)Make registration of ZCML forms conditional on the presence of
zope.app.form. This is probably a deprecated feature by now.0.8 (2011-01-25)Changes to use the ZTK import locations.Use newer version of openldap for test builds.zest.releaser support in buildoutReduce dependencies. zope.app.testing dependency still exists, though,
and should be removed by adjusting the tests.0.7 - 04.07.2008Updated install_requires to include all dependencies.Removed deprecated localUtility ZCML.buildout.cfg compiles openldap and creates a python-ldap eggCompatible with Grok 0.12 and 0.13 releases.0.6 - 20.11.2006Fixed Zope 3.3 induced deprecation warnings.principalInfo will try to look up a group if it cannot find a
user. This is to make ldappas support groups in a minimal way. It is
still the responsibility of the application to add LDAP-based groups
to the principal (for instance by subscribing to the
IAuthenticatedPrincipalCreated).
Package: ldapper
ldapperldapper 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.Requirementsldapper requires:Python 3.6+inflectionVersion 0.9.0 was the last to support Python 2.Usagefromldapper.connectionimportBaseConnectionfromldapper.ldapnodeimportLDAPNodefromldapperimportfields# define a connectionclassConnection(BaseConnection):BASE_DN='dc=example,dc=com'URI='ldaps://ldap.example.com'# define a common LDAPNode that holds the connection class you definedclassBaseModel(LDAPNode):connection=Connection# define a class to represent peopleclassPerson(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)classMeta: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 classperson=Person.fetch('liam')person.displayname='Chuck Yeager'person.save()person.delete()fromldapper.queryimportQPerson.filter(Q(firstname='Foo')|Q(lastname='Bar'))DocumentationAvailable athttps://ldapper.readthedocs.io/TestingPlease see the README.md file in the test directory for information on running unit tests.
Package: ldappool
A simple connector pool for python-ldap.The pool keeps LDAP connectors alive and let you reuse them,
drastically reducing the time spent to initiate a ldap connection.The pool has useful features like:transparent reconnection on failures or server restartsconfigurable pool size and connectors timeoutsconfigurable max lifetime for connectorsa context manager to simplify acquiring and releasing a connectorYou need python-ldap in order to use this libraryQuickstartTo work with the pool, you just need to create it, then use it as a
context manager with theconnectionmethod:from ldappool import ConnectionManager

cm = ConnectionManager('ldap://localhost')

with cm.connection('uid=adminuser,ou=logins,dc=mozilla', 'password') as conn:
    .. do something with conn ..The connector returned byconnectionis a LDAPObject, that’s binded to the
server. Seehttps://pypi.org/project/python-ldap/for details on how to use a connector.It is possible to check the state of the pool by representing the pool as a string:from ldappool import ConnectionManager

cm = ConnectionManager('ldap://localhost', size=2)

.. do something with cm ..

print(cm)This will result in output similar to this table:+--------------+-----------+----------+------------------+--------------------+------------------------------+
| Slot (2 max) | Connected |  Active  |       URI        | Lifetime (600 max) |           Bind DN            |
+--------------+-----------+----------+------------------+--------------------+------------------------------+
|      1       | connected | inactive | ldap://localhost |  0.00496101379395  | uid=tuser,dc=example,dc=test |
|      2       | connected | inactive | ldap://localhost |  0.00532603263855  | uid=tuser,dc=example,dc=test |
+--------------+-----------+----------+------------------+--------------------+------------------------------+ConnectionManager optionsHere are the options you can use when instanciating the pool:uri: ldap server uri[mandatory]bind: default bind that will be used to bind a connector.default: Nonepasswd: default password that will be used to bind a connector.default: Nonesize: pool size.default: 10retry_max: number of attempts when a server is down.default: 3retry_delay: delay in seconds before a retry.default: .1use_tls: activate TLS when connecting.default: Falsetimeout: connector timeout.default: -1use_pool: activates the pool. If False, will recreate a connector
each time.default: TrueTheurioption will accept a comma or whitespace separated list of LDAP
server URIs to allow for failover behavior when connection errors are
encountered.  Connections will be attempted against the servers in order,
withretry_maxattempts per URI before failing over to the next server.Theconnectionmethod takes two options:bind: bind used to connect. If None, uses the pool default’s.default: Nonepasswd: password used to connect. If None, uses the pool default’s.default: None
Package: ldappr
Ldappr is a wrapper around python-ldap, meant for quick and easy handling of common administrative tasks concerning your LDAP compliant repository. It is particularly useful in small, one-time scripts to get things done, or interactively within an iPython shell.InstallationOf course, python-ldap is supposed to be already installed.pip install ldapprConnectimportldappr# authenticated bindldap=ldappr.connect_to('127.0.0.1','uid=admin,ou=system','secret')Retrieve objectsWhen you have a connection, you can search on it. First, specify the
seach base.ldap.search_base='ou=users,ou=system'Then, get one or more objects to manipulate.# retrieve a single objectuser=ldap.get('cn=jdoe')# retrieve a list of objectsusers=ldap.search('objectClass=inetOrgPerson')Do stuffOnce you got an object, you can easily manipulate it. All changes will immediately reflect in your LDAP repository.# pretty print the retrieved userprint(user)# get an attribute valuesn=user.attrs['sn']# set an attribute value (existing value will be removed)user.set_value('givenName','Jack')# add a value to a multi-valued attributeuser.add_value('mobile','0123456789')user.add_value('mobile','9876543210')# remove a value from a multi-valued attributeuser.remove_value('mobile','9876543210')Other examples# anonymous bindldap=ldappr.connect_to('127.0.0.1')# authenticated bind with more optionsldap=ldappr.connect_to('127.0.0.1','uid=admin,ou=system','secret',protocol='ldaps',port='10636',verify=False,search_base='ou=users,ou=system')# delete all objects with employeeType managerfordninldap.get_dn('employeeType=manager'):ldap.delete(dn)# set an attribute value for a known dnldap.set_value('cn=jdoe,ou=users,ou=system','givenName','Jack')# make an LDIF export for all userswithopen('export.ldif','a')asfile:foruserinldap.search('objectClass=inetOrgPerson'):file.write(user.to_ldif())
Package: ldapsearchad
ldapsearch-ad.pyPython3 script to quickly get various information from a domain controller through its LDAP service.I'm used to launch it as soon as I get valid AD credentials, whileBloodHoundandPingCastleare processing.RequirementsPython version 3.6 or above is required to use f-Strings.ldap3: to connect to the ldap service of target domain controllerpycryptodome: to connect using hash instead of passwordInstallationSimply get the source code and install the requirements:gitclonehttps://github.com/yaap7/ldapsearch-ad.gitcdldapsearch-ad
pipinstall-r./requirements.txtQuick RTFMBasically, if you do not have valid credentials yet, you can only use:ldapsearch-ad.py-l192.168.56.20-tinfoAnd once you get valid credentials, you will want to use-allwith the logging option to get back to results later:ldapsearch-ad.py-l192.168.56.20-devilcorp-ujjohnny-p'P@$$word'-oevilcorp_discover_all.log-tallThanks toLike0xfromP1-Team, it is now possible to use it even with the hash:./ldapsearch-ad.py-l192.168.56.20-devilcorp-ujjohnny-hashes:32ed87bdb5fdc5e9cba88547376818d4-tshow-adminsMore examples can be found inUSAGE.md.TODOswitch from setup.py to pyproject.toml as described here:https://realpython.com/pypi-publish-python-package/update theMakefileaccordinglyupdate theREADME.mdto explain the installation / portable usage.look for new vulnerable configuration to add:https://youtu.be/7_iv_eaAFyQimplement a search for ForeignSecurityPrincipals (When a user/group from anexternaldomain/forest are added to a group in a domain, an object of type foreignSecurityPrincipal is created atCN=<user_SID>,CN=ForeignSecurityPrincipals,DC=domain,DC=com)Done:create a python package to help other projects to import the functions and use the main class.implement ldap3 pagging functionality: available sincev2022.08.18verify all the-toptions are shown inUSAGE.mdand explain most complicated options : kerberoast, search-spn, asreproast, goldenticket, search-delegation, createsid.give usefulsearchexamples (seehttps://phonexicum.github.io/infosec/windows.htmlandhttps://blog.xpnsec.com/kerberos-attacks-part-2/)add a command to get vulnerable users to AS-REP-roasting (thanks@HadrienPerrineau)change the core architecture to create an object and do not open multiple connection for-t allContributionsFeel free to fork, adapt, modify, contribute, and do not hesitate to send a pull request so the tool could be improved for everyone.I would even make you acollaboratorif you want so you could contribute directly on this repo!ContributorsCSbyGBfor typos correctionsLike0xfromP1-Teamfor the connection using NTLM hash instead of password, and thecreatesidfeature.nsilver7for the option to append the output in a file in addition to the standard output.CreditsObviously, all credits goes to people who discover the technics and vulnerabilities.
This tool is only an humble attempt to implement their technics using python3 to understand how things work and because I like to play with the LDAP interface of Active Directory.
Unfortunately, I heard the ldap interface could be removed from domain controllers in the future :(Thanks toBenguifor the username convention.
Package: ldap-tools
LDAP ToolsThis LDAP tools gem is designed as a wrapper aroundldap3to make
interacting with LDAP easier. No knowledge of LDIF required.RequirementsInstallationInstallation from pypiInstallation from sourceConfigurationldap_info.yamlldap.secretCommandsldaptoolsCurrently supported subcommandsRequirementsUsepyenvto install python 3.5.3 (or 3.6.4)The following items are installed automatically as part of the pip install:
- ldap3
- click
- sshpubkeys
- pyyamlInstallationInstallation from pypipip install ldap-toolsInstallation from sourcepip install git+https://github.com/carta/ldap_tools#egg=ldap_toolsConfigurationThere are two files used by this application. The default location is$HOME/.ldap; however, this can be overridden using theLDAP_CONFIG_DIRenvironment variableldap_info.yamlThis config file provides basic information about your LDAP server
setup.---server:# LDAP serveruser_dn:# DN of user to interact with LDAPport:# LDAP portbasedn:#LDAP Base DNmail_domain:# Domain to be used for user email addressesservice_ou:# Organization Unit (OU) for service accountsNote: DN of a user is the unique name used to identify that userldap.secretThis is a base64-encoded file with the LDAP root password.CommandsldaptoolsThis is the base command from which all other commands are launchedUsage: ldaptools [OPTIONS] COMMAND [ARGS]...

Enter the application here.

Options:
  --help  Show this message and exit.

Commands:
  audit    Display LDAP group membership by user, by...
  group    LDAP Group Management Commands.
  key      Manage LDAP user SSH public keys.
  user     LDAP User Management Commands.
  version  LDAP Group Management Commands.Help is available for all subcommands in a similar fashion.Currently supported subcommandsuser createuser deletegroup creategroup deletegroup add_usergroup remove_userkey addkey removekey installaudit by_useraudit by_groupaudit rawChangelog(unreleased)Update changelog. [Ali Tayarani]Bump version: 0.7.11 → 0.7.12. [Ali Tayarani]Update dependencies. [Ali Tayarani]v0.7.11 (2018-05-09)Initial commit. [Ali Tayarani]
Package: ldaptor
Ldaptor is a pure-Python library that implements:LDAP client logicseparately-accessible LDAP and BER protocol message generation/parsingASCII-format LDAP filter generation and parsingLDIF format data generationSamba password changing logicAlso included is a set of LDAP utilities for use from the command line.Verbose documentation can be found onReadTheDocs.Quick Usage Examplefromtwisted.internetimportreactor,deferfromldaptor.protocols.ldapimportldapclient,ldapsyntax,ldapconnector@defer.inlineCallbacksdefexample():# The following arguments may be also specified as unicode strings# but it is recommended to use byte strings for ldaptor objectsserverip=b'192.168.128.21'basedn=b'dc=example,dc=com'binddn=b'bjensen@example.com'bindpw=b'secret'query=b'(cn=Babs*)'c=ldapconnector.LDAPClientCreator(reactor,ldapclient.LDAPClient)overrides={basedn:(serverip,389)}client=yieldc.connect(basedn,overrides=overrides)yieldclient.bind(binddn,bindpw)o=ldapsyntax.LDAPEntry(client,basedn)results=yieldo.search(filterText=query)forentryinresults:print(entry.getLDIF())if__name__=='__main__':df=example()df.addErrback(lambdaerr:err.printTraceback())df.addCallback(lambda_:reactor.stop())reactor.run()InstallationLdaptor can be installed using the standard command line method:python setup.py installor using pip from PyPI:pip install ldaptorLinux distributions may also have ready packaged versions of Ldaptor and Twisted. Debian and Ubuntu have quality Ldaptor packages that can be installed e.g., by:apt-get install python-ldaptorTo run the LDAP server (bind port 38942) from a repo checkout with
the project installed:twistd -n --pidfile=ldapserver.pid --logfile=ldapserver.log \
    -y test-ldapserver.tacDependencies:Twisted[tls]pyparsingpasslibfor Samba passwordssixfor simultaneous Python 2 and 3 compatabilityzope.interfaceto register implementers of Twisted interfaces
Package: ldap-user-transfer
ldap-user-transferScript for transferring LDAP users from Postgresql database. Tested only in OpenLDAP, may work in others.Configurationdb :user_sql: Sql query for fetching users. (Cast id column to varchar)group_sql: Sql query for getting group of user (Cast id column to varchar)user_pk: Id column of user tableuser_password_column: Password column of user in plain text. If this property given, userPassword field on LDAP will filled password with SHA-512 encryption in CRYPT format.group_pk: Id column of group tablecursor_fetch_size: This script use postgresql binary cursors to iterate large amount of user rows. You can set cursor fetch size with this value.ldap:user_base: user base DN without base DNgroup_base:  group base DN without base DNuser_classes: LDAP classes of user object (as list)mappings:user_fields: mapping of user table column names  and LDAP attributes in <String, String> or <String, List> formats.groups: mapping of group names on db and LDAP group names in <String, String> format. Use id column of groups table for mapping.UsageAfter installing package from PyPI, define your config.yml path viaLDAP_USER_TRANSFER_CONFIGenvironment variable then runldap-transfer-usercommand.
Package: ldax
LDax, is the legacy version of DAX.
It is maintained athttps://https://github.com/VUIIS/LDaxDAX, is  a python package developed at Vanderbilt University, Nashville, TN,
USA. It’s available on github at the address:https://github.com/VUIIS/dax.
See the different tutorials bellow to learn more about this package and how
to use it.XNAT gives an incredible flexible imaging informatics software platform to
organise, manage any imaging data. It also provides a Pipeline Engine to run
processings on your data. The pipeline engines has an important learning curve
and doesn’t provide a way to run processes when your XNAT instance isn’t
connected to your cluster.DAX, an open-source initiative under the umbrella of Vanderbilt University
Institute of Imaging Science (VUIIS), is a Python project that provides a
uniform interface to run pipelines on a cluster by grabbing data from a XNAT
database via RESTApi Calls.DAXallows you to:extract information from XNAT via scripts (bin/Xnat_tools/Xnat…)create pipelines (spiders/processors) to run pipelines on your databuild a project on XNAT with pipelines (assessors)launch pipelines on your cluster and upload results back to xnatinteract with XNAT via python using commands in XnatUtils.
Package: ldcoolp-figshare
LD-Cool-P Figshare API ToolCategoriesStatusGeneralCI/CDUnder constructionPyPIDocsOur complete Sphinx documentation is availablehereat ReadTheDocs.io.ldcoolp-figshareis a command-line API used inLD-Cool-Pto interact with theFigshare API. It is used byReDATAdata curators for the curation of
submitted research data products. This codebase is generalized such that
other curators with aFigshare for Institutioninstance can use.Getting StartedRequirementsUse ExamplesGet a list of accountsObtain curation recordsDOI status and reservationRetrieve list of institution groupsRetrieve list of articles for a userContinuous IntegrationVersioningAuthorsLicenseAPI Documentation
Package: ldcpy
Large Data Comparison for Pythonldcpy is a utility for gathering and plotting metrics from NetCDF or Zarr files using the Pangeo stack.
It also contains a number of statistical and visual tools for gathering metrics and comparing Earth System Model data files.AUTHORS:Alex Pinard, Allison Baker, Anderson Banihirwe, Dorit HammerlingCOPYRIGHT:2020 University Corporation for Atmospheric ResearchLICENSE:Apache 2.0Documentation and usage examples are availablehere.Reference to ldcpy paperPinard, D. M. Hammerling, and A. H. Baker. Assessing differences in large spatio­temporal climate datasets with a new Python package. In The 2020 IEEE International Workshop on Big Data Reduction, 2020. doi: 10.1109/BigData50022.2020.9378100.Link to paper:https://doi.org/10.1109/BigData50022.2020.9378100Installation using Conda (recommended)Ensure conda is up to date and create a clean Python (3.6+) environment:condaupdatecondacondacreate--nameldcpypython=3.8condaactivateldcpyNow install ldcpy:condainstall-cconda-forgeldcpyAlternative InstallationEnsure pip is up to date, and your version of python is at least 3.6:pipinstall--upgradepippython--versionInstall cartopy using the instructions provided athttps://scitools.org.uk/cartopy/docs/latest/installing.html.Then install ldcpy:pipinstallldcpyAccessing the tutorialIf you want access to the tutorial notebook, clone the repository (this will create a local repository in the current directory):gitclonehttps://github.com/NCAR/ldcpy.gitStart by enabling Hinterland for code completion and code hinting in Jupyter Notebook and then opening the tutorial notebook:jupyternbextensionenablehinterland/hinterlandjupyternotebookThe tutorial notebook can be found in
docs/source/notebooks/TutorialNotebook.ipynb, feel free to gather your
own metrics or create your own plots in this notebook!Other example notebooks that use the sample data in this repository include
PopData.ipynb and MetricsNotebook.ipynb.The AWSDataNotebook grabs data from AWS, so can be run on a laptop
with the caveat that the files are large.The following notebooks asume that you are using NCAR’s JupyterHub
(https://jupyterhub.hpc.ucar.edu):
LargeDataGladenotebook.ipynb, CAMNotebook,ipynb, and error_bias.ipynbRe-create notebooks with Pangeo BinderTry the notebooks hosted in this repo on Pangeo Binder. Note that the session is ephemeral.
Your home directory will not persist, so remember to download your notebooks if you
make changes that you need to use at a later time!Note: All example notebooks are in docs/source/notebooks (the easiest
ones to use in binder first are TutorialNotebook.ipynb and PopData.ipynb)