Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73924

Re: general module auditing

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rmorgan466@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'package,': 0.03; 'that?': 0.05; 'affected': 0.07; 'globally.': 0.07; 'facts': 0.09; 'lawrence': 0.09; 'matplotlib': 0.09; 'meaningful': 0.09; 'statements': 0.09; 'subject:module': 0.09; 'thats': 0.09; 'wrapper': 0.09; 'developer': 0.10; 'cc:addr :python-list': 0.11; 'python': 0.11; 'language.': 0.14; 'question.': 0.14; '&gt;&gt;': 0.16; '12:38,': 0.16; 'called.': 0.16; 'etc...': 0.16; 'group?': 0.16; 'helps.': 0.16; 'imports': 0.16; 'numpy': 0.16; 'pylab': 0.16; 'so)': 0.16; 'username.': 0.16; '\xc2\xa0i': 0.16; 'folder': 0.16; 'language': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'wed,': 0.18; 'module': 0.19; 'campus': 0.19; 'mechanism': 0.19; 'thu,': 0.19; 'written': 0.21; 'machine': 0.22; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; '&gt;&gt;&gt;': 0.24; 'module,': 0.24; '---': 0.24; 'cc:2**0': 0.24; 'developers': 0.25; '&gt;': 0.26; 'first,': 0.26; 'logging': 0.26; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'host': 0.29; 'feature': 0.29; 'on,': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; "skip:' 10": 0.31; 'that.': 0.31; 'file': 0.32; 'figure': 0.32; 'run': 0.32; 'another': 0.32; 'url:python': 0.33; 'everyone': 0.33; 'skip:& 30': 0.33; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'located': 0.36; 'really': 0.36; 'module.': 0.36; 'url:listinfo': 0.36; 'doing': 0.36; 'url:org': 0.36; 'so,': 0.37; 'list': 0.37; 'list.': 0.37; 'fact': 0.38; 'pm,': 0.38; 'does': 0.39; 'called': 0.40; 'url:mail': 0.40; 'how': 0.40; 'even': 0.60; 'remove': 0.60; 'easy': 0.60; 'skip:\xc2 10': 0.60; 'tell': 0.60; 'free': 0.61; 'affect': 0.61; 'viruses': 0.61; 'times': 0.62; "you'll": 0.62; 'protection': 0.63; 'our': 0.64; 'more': 0.64; 'details': 0.65; 'here': 0.66; 'antivirus': 0.68; 'to,': 0.72; 'jul': 0.74; 'rita': 0.84; 'to:addr:yahoo.co.uk': 0.84; 'mean.': 0.91; 'mount': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=A31tiNrT/IVguWqII7aG6OTVXZV5taDBxNL5ys9084Q=; b=TZrQwc7FzMQPKHLIq3py7dM0kQa8CFZxxuxa+z1f2sn+Uc/zN0xJpK2nJjhetV6ohp c+VjSuXf4HCnjJhLGGS+QATWuXsNV6aMRkKlNpEIirWHyEooiA3uvVJEFvgRq8vd5oFK QXDACY9QGzXLRbaL18IdRWGemntZ/+ERpoLSNORQpFYEyI9x4/wIeDPlAZNoact4ABKU 8BpL33ReLevpHw9QrOvU7cwOc8RwDHpZtWUyFJMKjhl1wdW29/gsVLzsqNFrgwrX2E9d w4oeJKzYWzAxvbvCGz2MnCm478SFrD8rg2A9t49wmq7oqJhIkvYEnv3gK0dntcOUUTCy yrvA==
MIME-Version 1.0
X-Received by 10.182.104.66 with SMTP id gc2mr8052805obb.17.1404428955451; Thu, 03 Jul 2014 16:09:15 -0700 (PDT)
In-Reply-To <lp3ip8$h76$1@ger.gmane.org>
References <mailman.11361.1404211117.18130.python-list@python.org> <53b2fae4$0$2878$e4fe514c@news.xs4all.nl> <mailman.11393.1404266687.18130.python-list@python.org> <53b4539b$0$2901$e4fe514c@news.xs4all.nl> <CAOF-KfhjG82iaS-K9tT3RT1wBMJ_MREUte61FsTPcR1jQKcEaA@mail.gmail.com> <lp2unv$mji$1@ger.gmane.org> <CAOF-KfhLG4UwMOUKaK3q-YD+fEV4RtaHTqD=f19NKBq+N5htYw@mail.gmail.com> <lp3ip8$h76$1@ger.gmane.org>
Date Thu, 3 Jul 2014 19:09:15 -0400
Subject Re: general module auditing
From Rita <rmorgan466@gmail.com>
To Mark Lawrence <breamoreboy@yahoo.co.uk>
Content-Type multipart/alternative; boundary=089e0122efac00865704fd52190c
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.11472.1404428964.18130.python-list@python.org> (permalink)
Lines 360
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1404428964 news.xs4all.nl 2939 [2001:888:2000:d::a6]:55993
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:73924

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Jul 3, 2014 at 8:36 AM, Mark Lawrence <breamoreboy@yahoo.co.uk>
wrote:

> On 03/07/2014 10:27, Rita wrote:
>
>>
>>
>>
>> On Thu, Jul 3, 2014 at 2:54 AM, Mark Lawrence <breamoreboy@yahoo.co.uk
>> <mailto:breamoreboy@yahoo.co.uk>> wrote:
>>
>>     On 03/07/2014 02:17, Rita wrote:
>>
>>
>>         On Wed, Jul 2, 2014 at 2:46 PM, Irmen de Jong
>>         <irmen.NOSPAM@xs4all.nl <mailto:irmen.NOSPAM@xs4all.nl>
>>         <mailto:irmen.NOSPAM@xs4all.nl
>>
>>         <mailto:irmen.NOSPAM@xs4all.nl>__>> wrote:
>>
>>              On 2-7-2014 4:04, Rita wrote:
>>               > yes, this helps. But I want to know who uses the module,
>>         serpent.
>>              So, when
>>               > I upgrade it or remove it they won't be affected
>> adversely.
>>
>>              (Please don't top-post, it makes the discussion harder to
>>         follow.)
>>
>>               > On Tue, Jul 1, 2014 at 2:16 PM, Irmen de Jong
>>              <irmen.NOSPAM@xs4all.nl <mailto:irmen.NOSPAM@xs4all.nl>
>>         <mailto:irmen.NOSPAM@xs4all.nl <mailto:irmen.NOSPAM@xs4all.nl
>> >__>>
>>
>>
>>               > wrote:
>>               >
>>               >> On 1-7-2014 12:38, Rita wrote:
>>               >>> i work in a group of developers (15 or so)  who are
>>         located
>>              globally. I
>>               >>> would like to know what modules everyone is uses if I
>>         ever have to
>>               >> upgrade
>>               >>> my python. Is there mechanism which will let me see who
>> is
>>              using what?
>>               >>>
>>               >>> ie,
>>               >>>
>>               >>> tom,matplotlib
>>               >>> bob, pylab
>>               >>> nancy, numpy
>>               >>> nancy, matplotlib
>>               >>>
>>               >>> etc...
>>               >>>
>>               >>>
>>               >>
>>               >> Well, if your group is all using Pip (and perhaps even
>>              virtualenv), you
>>               >> could use pip
>>               >> list. In my case:
>>               >>
>>               >> $ pip list
>>
>>              [...]
>>
>>
>>              Why would the fact that you upgrade or remove a package,
>> affect
>>              another developer in
>>              your group? Are you all using the same machine to develop
>>         on, with
>>              one Python installation?
>>
>>              I think you'll have to tell us some more details about the
>>         way you
>>              work together before
>>              we can give a meaningful answer to your question.
>>
>>              Irmen
>>
>>              --
>>         https://mail.python.org/__mailman/listinfo/python-list
>>
>>         <https://mail.python.org/mailman/listinfo/python-list>
>>
>>         we have a shared mount point which has our python install. we
>> have 3
>>         servers on one part of the campus  and 2 in another part.
>>
>>         I want to find out what packages our user base is using thats
>>         the final
>>         goal. I can figure out who is using python by writing a wrapper
>>         but not
>>         what module.
>>
>>         --
>>         --- Get your facts first, then you can distort them as you
>> please.--
>>
>>
>>     You can check every users's program for import statements but do you
>>     really need to, why not check what's in the site-packages folder for
>>     your python install?
>>
>>     --
>>     My fellow Pythonistas, ask not what our language can do for you, ask
>>     what you can do for our language.
>>
>>     Mark Lawrence
>>
>> how can i get frequency of the module usage? thats the end goal.
>>
>> --
>> --- Get your facts first, then you can distort them as you please.--
>>
>>
>>
> Count the number of imports or count the times a given program gets run
> for the number of imports depending on what you mean.
>
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask what
> you can do for our language.
>
> Mark Lawrence
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

here is what I am doing now,

egrep 'from|import' *.py | wc -l which is giving me that. But this does not
give me the number of times the particular module gets called. I was
thinking of adding a logging feature to all of my modules so every time
they get called it will be written to a log file with corresponding host
and username. Is there an easy way to do that?



-- 
--- Get your facts first, then you can distort them as you please.--

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

general module auditing Rita <rmorgan466@gmail.com> - 2014-07-01 06:38 -0400
  Re: general module auditing Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2014-07-01 20:16 +0200
    Re: general module auditing Rita <rmorgan466@gmail.com> - 2014-07-01 22:04 -0400
      Re: general module auditing Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2014-07-02 20:46 +0200
        Re: general module auditing Rita <rmorgan466@gmail.com> - 2014-07-02 21:17 -0400
        Re: general module auditing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-03 07:54 +0100
        Re: general module auditing Rita <rmorgan466@gmail.com> - 2014-07-03 05:27 -0400
        Re: general module auditing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-03 13:36 +0100
        Re: general module auditing Rita <rmorgan466@gmail.com> - 2014-07-03 19:09 -0400
          Re: general module auditing Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2014-07-04 19:05 +0200
            Re: general module auditing Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2014-07-04 19:10 +0200
        Re: general module auditing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-04 00:19 +0100

csiph-web