Hi Gabe,

I'm also working on improving the python bindings (tho I'm not targeting
python 3 specifically, I'm trying to be future proof there);

https://sourceforge.net/u/hcf64/net-snmp/ci/python_api/tree/python/

My approach was also a little different; I made the new python bindings
(snmp_api.c) as close to a 1:1 map with Net-SNMP API as possible.  My
strategy there is to make the "pythonic" SNMP library on python's side
(either a rewrite of netsnmp.py, or a different module).

In retrospect one thing I think I would do differently would be to use
custom types for the PDU and the two different types of Session objects
(snmp_open() vs snmp_sess_open()), rather than the Capsule.  The
implementation I have requires I transform the PDU structure into a
dictionary to return to the caller.  This creates many python objects and
causes a GC storm later in heavy use.  A custom type wrapping the Net-SNMP
structs would construct objects on demand, so I don't think it would have
that GC penalty, and it would be more reverse compatible (to 2.6 and
earlier).

I also think I should consider a new strategy for freeing and taking the
GIL, to handle threaded python applications.

On Thu, Mar 3, 2016 at 9:48 AM, Wes Hardaker <w...@net-snmp-pro.com> wrote:

> Gabe <r...@un1x.su> writes:
>
> > I've been working on a Python3 C Extension for the net-snmp API. Still
> very much a work in progress, but I feel like
> > it's at a point now that I can share:
> >
> > https://github.com/xstaticxgpx/netsnmp-py3
> >
> > Mostly just wanted to gauge interest on this, however any feedback
> > would be much appreciated.
>
> Glad to hear someone is plugging away at it.  Did you eventually want to
> contribute it back to the Net-SNMP project, or keep it as a separate piece
> of work?
> --
> Wes Hardaker
> Please mail all replies to net-snmp-coders@lists.sourceforge.net
>
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
> _______________________________________________
> Net-snmp-coders mailing list
> Net-snmp-coders@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>



-- 
Network Tools & Automation
Twitter, Inc.
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to