python programs to track bitcoins

2020-04-10 Thread dreamyladygirl
Hello
I`m looking if there any programs out there to track bitcoins and those 
programs were made by python
if you know any?
please let me know
it`s kinda urgent
thank you very much
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python programs to track bitcoins

2020-04-10 Thread Souvik Dutta
This should do your job.
https://github.com/rgho/bitcoinTicker.py

On Fri, 10 Apr, 2020, 12:35 pm ,  wrote:

> Hello
> I`m looking if there any programs out there to track bitcoins and those
> programs were made by python
> if you know any?
> please let me know
> it`s kinda urgent
> thank you very much
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is it possible to inheret a metaclass.

2020-04-10 Thread Antoon Pardon




Op 9/04/20 om 18:37 schreef Peter Otten:

Antoon Pardon wrote:


I am experimenting with subclasses that all need the same metaclass as the
base class. Is there a way to make the metaclass be inherited, so that you
don't have to repeat the "metaclass = MetaClass" with every subclass.


?

This is not only possible, this is the default:

  >>> class Pardon(type): pass
...

class A(metaclass=Pardon): pass

...

class B(A): pass

...

type(B)




Can you explain what is wrong with the code below:

This produces only: Calling Pardon with A.


def Pardon(cls, *args):
print("Calling Pardon with", cls)
return type(cls, *args)

class A(metaclass=Pardon): pass

class B(A): pass
--
https://mail.python.org/mailman/listinfo/python-list


PyValentina 0.2.0 library documentation update on PyPI

2020-04-10 Thread Sanjay Gupta
Hi Everyone,
I recently started working on Data Visualization. In one of my assignments, I 
want to use PyValentina 0.2.0 library. When I visited the 
https://pypi.org/project/PyValentina/
page and click on PyValentina Home Page link it give me a 404 error. After 
spending a little more time I come to know that PyValentina has now changed to 
the Petro library but the information and link are not updated everywhere. The 
PyValentina repository is also changed to Petro on GitHub.

New link-
https://fabricesalvaire.github.io/Patro/
https://github.com/FabriceSalvaire/Patro

Old link-
http://fabricesalvaire.github.io/PyValentina

Can I add this issue to Github?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyValentina 0.2.0 library documentation update on PyPI

2020-04-10 Thread Souvik Dutta
Might be your wish!!! If that is not the fault of the devs then I think
issuing in GitHub wont help.

Souvik flutter dev

On Fri, Apr 10, 2020, 5:10 PM Sanjay Gupta  wrote:

> Hi Everyone,
> I recently started working on Data Visualization. In one of my
> assignments, I want to use PyValentina 0.2.0 library. When I visited the
> https://pypi.org/project/PyValentina/
> page and click on PyValentina Home Page link it give me a 404 error. After
> spending a little more time I come to know that PyValentina has now changed
> to the Petro library but the information and link are not updated
> everywhere. The PyValentina repository is also changed to Petro on GitHub.
>
> New link-
> https://fabricesalvaire.github.io/Patro/
> https://github.com/FabriceSalvaire/Patro
>
> Old link-
> http://fabricesalvaire.github.io/PyValentina
>
> Can I add this issue to Github?
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] aioxmpp 0.11.0 released

2020-04-10 Thread Jonas Schäfer
Dear subscribers,

We are pleased to announce the release of aioxmpp 0.11.0. The current release 
can be obtained from GitHub [1] (check out the v0.11.0 tag) or PyPI [2]. The  
HTML documentation can be found at [3]. Examples can be found in the GitHub  
repository, in the examples sub directory.

aioxmpp is a Python library based on asyncio. It implements the client side of  
the XMPP protocol (RFC 6120 and others). For a more detailed description of  
the package, please review the README of the package on GitHub [1] or on PyPI 
[2]. For more information on XMPP, please see [8]. aioxmpp is licensed under  
the terms of the GNU Lesser General Public License Version 3.0 or later.


Version 0.11.0 is a feature release. It introduces support for XEP-0410 as 
well as several XSO schema for other XEPs. In addition, PubSub support for 
publish-options and node configuration was added. Aside from these highlights, 
there were many minor improvements and bug fixes. As always, there were also a 
few breaking changes, though most should not affect any user code. Finally, 
compatibility with Python 3.8 (requires aioopenssl v0.5.1, also released 
today) was introduced.


Bugs, feature requests, patches and questions can be directed to either the 
aioxmpp mailing list [4], the GitHub issue tracker [5] or the XMPP Multi-User 
chat [6], whatever floats your boat. Please direct security-relevant issue 
reports directly to me ([email protected]), preferably encrypted using my 
GPG public key [7].

kind regards,
Jonas

   [1]: https://github.com/horazont/aioxmpp
   [2]: https://pypi.python.org/pypi/aioxmpp
   [3]: https://docs.zombofant.net/aioxmpp/0.11/
   [4]: https://lists.zombofant.net/mailman/listinfo/aioxmpp-devel
   [5]: https://github.com/horazont/aioxmpp/issues
   [6]: [email protected]
   [7]: https://sotecware.net/pubkey.gpg
AA5A 78FF 508D 8CF4 F355  F682 E5ED E5AC 679E 300F
   [8]: https://xmpp.org/


signature.asc
Description: This is a digitally signed message part.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is it possible to inheret a metaclass.

2020-04-10 Thread Pieter van Oostrum
Antoon Pardon  writes:

> Op 9/04/20 om 18:37 schreef Peter Otten:
>> Antoon Pardon wrote:
>> 
>>> I am experimenting with subclasses that all need the same metaclass as the
>>> base class. Is there a way to make the metaclass be inherited, so that you
>>> don't have to repeat the "metaclass = MetaClass" with every subclass.
>> ?
>> This is not only possible, this is the default:
>>   >>> class Pardon(type): pass
>> ...
> class A(metaclass=Pardon): pass
>> ...
> class B(A): pass
>> ...
> type(B)
>> 
>
> Can you explain what is wrong with the code below:
>
> This produces only: Calling Pardon with A.
>
>
> def Pardon(cls, *args):
> print("Calling Pardon with", cls)
> return type(cls, *args)
>
> class A(metaclass=Pardon): pass
>
> class B(A): pass
>
Your Pardon is not a class, it is a function. Class A is created by type(cls, 
*args), so 'type' is the metaclass of A, and therefore also of B.
Creation of B does not call Pardon.

I find it peculiar that you can give a function as metaclass. But that seems to 
be part of the specification. The function result is what the 'class' becomes. 
You can even have it return something else. Then the 'class' wouldn't really be 
a class.

In [65]: def meta(cls, *args): return 1

In [66]: class A(metaclass=meta): pass

In [67]: A
Out[67]: 1

-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python programs to track bitcoins

2020-04-10 Thread Michael Torrie
On 4/9/20 11:16 PM, [email protected] wrote:
> I`m looking if there any programs out there to track bitcoins and those 
> programs were made by python

You can use Google search as well as any of us, or some other search
engine.  What have you found so far?

> >
> it`s kinda urgent

In the future, please leave this off your messages.  Thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python programs to track bitcoins

2020-04-10 Thread Abdur-Rahmaan Janhangeer
https://github.com/pyhoneybot/honeybot/blob/master/honeybot/plugins/bitcoin.py

The above made use of a nice API.

Kind Regards,


Abdur-Rahmaan Janhangeer

https://www.compileralchemy.com
https://www.github.com/Abdur-RahmaanJ

Mauritius

sent from gmail client on Android, that's why the signature is so ugly.

On Fri, 10 Apr 2020, 11:04 ,  wrote:

> Hello
> I`m looking if there any programs out there to track bitcoins and those
> programs were made by python
> if you know any?
> please let me know
> it`s kinda urgent
> thank you very much
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is it possible to inheret a metaclass.

2020-04-10 Thread Greg Ewing via Python-list

On 11/04/20 12:19 am, Pieter van Oostrum wrote:


Your Pardon is not a class, it is a function.


To elaborate on that a bit, the way inheritance of metaclasses
works is that when you define a class, if you don't explicity
specify a metaclass, it uses the class of the base class as
the metaclass.

Usually when you specify a metaclass, you use an actual class.
But your "metaclass" is a function that returns an instance
of class "type". So the class of your base class ends up
being "type", which is no different from what it would have
been if you didn't specify a metaclass.


I find it peculiar that you can give a function as metaclass.


Yes, it just calls whatever object you give it, which allows
for various fun things. You'd be risking a lynching if you took
advantage of it for anything important, though.:-)

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Introducing Python for Data Analysis Remote 4-Day Seminar

2020-04-10 Thread Ashley Fontillas
Hello,

We will be hosting a 4-day remote seminar on Python for Data Analysis

taught by Jason Anastasopoulos from May 26-28.

Designed as both an introductory and intermediate course on Python,
participants will join via Zoom to participate in lecture sessions,
complete hands-on exercises, and interact with the instructor. You'll be
able to join live or to view the recorded sessions asynchronously for up to
3 weeks after the course concludes. Topics include: Python basics, data
analysis and statistical inference, data visualization, semi-structured
data, database creation and extraction, and unstructured data and natural
language processing.

Registration is now open here
.
Space is limited.

Please feel free to forward this email to any colleagues or graduate
students that may be interested. Email [email protected] with
any questions.

Thanks,
Ashley
-- 
https://mail.python.org/mailman/listinfo/python-list


RFC: For Loop Invariants

2020-04-10 Thread Elliott Dehnbostel
Hello Everyone,

I've also posted this to the python-ideas mailing list, but I thought to
post here as well for a more general audience.

If I've done this incorrectly, please let me know so that I can
improve/revise. I'm new to the Python community and quite enjoy the more
functional features of Python 3, but have I have a peeve about it. I'd like
to propose and discuss the following enhancement to Python 3:

*Consider the following trivial for-loop:*

chars = "abcaaabkjzhbjacvb"
seek = {'a','b','c'}
count = 0for a in chars:
 if a in seek:
  count += 1

Gross. Twice nested for a simple count.

*We could refactor the block like so:*

chars = "abcaaabkjzhbjacvb"
seek = {'a','b','c'}
count = 0for a in filter(lambda c: c in seek, chars): count += 1

Which is all well and good, but doesn't quite read like English. It's
verbose, too.

It also uses advanced concepts new programmers may not understand.

*We could do this:*

chars = "abcaaabkjzhbjacvb"
seek = {'a','b','c'}
count = sum([1 for a in chars if a in seek])

However, this changes important semantics by creating an entire new
list before summing.

Also, adding just one more expression to the most nested block thwarts
that refactor.

I propose the following enhancement:

chars = "abcaaabkjzhbjacvb"
seek = {'a','b','c'}
count = 0for a in chars if a in seek: count += 1

*What happened there?*

I've allowed a condition to follow the "for" construct without a colon
or newline between.

*To be clear, this remains incorrect:*

chars = "abcaaabkjzhbjacvb"
seek = {'a','b','c'}
count = 0for a in chars # No colon prior to the newline
 if a in seek:
  count += 1

*In summary:*

for a in iterable if cond:
 # code block

*Becomes syntactic sugar for:*

for a in iterable:
 if cond:
  # code block

*Value proposal:*

I assert that the inlined 'if' condition pattern is superior to the
alternative refactors.

Right now, the way to acquire an invariant without nesting the block would be:

for a in iterable:
 if not cond:
  continue

But this is messy and not particularly Pythonic.

The filter approach uses concepts that should not be necessary for this task.

The comprehension approach has different, undesirable semantics.

*Conclusion:*

I wanted to submit my thoughts here before getting too deep into this.
Any input would be appreciated!

Thanks everyone.
-- 
https://mail.python.org/mailman/listinfo/python-list


Secure Coding in Python

2020-04-10 Thread Kor son of Rynar
Dear list,

As many of you know, SEI/CERT maintains a set of secure coding standards
for many languages like C/C++, Java and Perl:

  SEI CERT Coding Standards

https://wiki.sei.cmu.edu/confluence/display/seccode/SEI+CERT+Coding+Standards

I'm looking for something similar, but with specific advice applicable to
Python.  Books and online references are welcome.

On the same topic: coming from Perl, I'm used to "Taint mode":
--
https://perldoc.perl.org/perlsec.html

While in this mode, Perl takes special precautions called taint checks to
prevent both obvious and subtle traps. Some of these checks are reasonably
simple, such as verifying that path directories aren't writable by others;
careful programmers have always used checks like these. Other checks,
however, are best supported by the language itself, and it is these checks
especially that contribute to making a set-id Perl program more secure than
the corresponding C program.

You may not use data derived from outside your program to affect something
else outside your program--at least, not by accident. All command line
arguments, environment variables, locale information (see perllocale),
results of certain system calls (readdir(), readlink(), the variable of
shmread(), the messages returned by msgrcv(), the password, gcos and shell
fields returned by the getpwxxx() calls), and all file input are marked as
"tainted". Tainted data may not be used directly or indirectly in any
command that invokes a sub-shell, nor in any command that modifies files,
directories, or processes, ...
--

Is there anything like this in Python?  What would be your
recommendations?  Thanks!

Regards,
-- 
Kor.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: RFC: For Loop Invariants

2020-04-10 Thread DL Neil via Python-list

On 11/04/20 8:44 AM, Elliott Dehnbostel wrote:

If I've done this incorrectly, please let me know so that I can
improve/revise. I'm new to the Python community and quite enjoy the more
functional features of Python 3, but have I have a peeve about it. I'd like
to propose and discuss the following enhancement to Python 3:

*Consider the following trivial for-loop:*

chars = "abcaaabkjzhbjacvb"
seek = {'a','b','c'}
count = 0for a in chars:
  if a in seek:
   count += 1

Gross. Twice nested for a simple count.


Agreed!

Interestingly, similar gross-ness appeared recently in a conversation 
about input() within while True: (can't recall if 'here' or on Python-Tutor)



However, starting with the (overly) simple case:

>>> chars = "abcaaabkjzhbjacvb"
>>> seek = {'a','b','c'}
>>> len( [ char for char in chars if char in seek ] )
11

NB I don't like this solution and feel that it would need an explanatory 
comment, which (also) somewhat proves your 'readability' point...




...
*In summary:*

for a in iterable if cond:
  # code block

*Becomes syntactic sugar for:*

for a in iterable:
  if cond:
   # code block

*Value proposal:*

I assert that the inlined 'if' condition pattern is superior to the
alternative refactors.

Right now, the way to acquire an invariant without nesting the block would be:

for a in iterable:
  if not cond:
   continue

But this is messy and not particularly Pythonic.

The filter approach uses concepts that should not be necessary for this task.

The comprehension approach has different, undesirable semantics.


Putting aside the trivial-case, above - let's say our string (chars) is 
another more complex iterable, eg something sub-classing UserList. 
Wouldn't the selection/filter be coded in a method? That way there is 
'separation of concerns' between the filter and the iterator.


class MyList( UserList ):
def only_the_good_stuff( self ):
yield #according to filter
...

my_list = MyList( etc )
...
for a in my_list.only_the_good_stuff():
# calmly carry-on

--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: RFC: For Loop Invariants

2020-04-10 Thread Juergen Brendel


Hello!

On Fri, 2020-04-10 at 15:44 -0500, Elliott Dehnbostel wrote:
> chars = "abcaaabkjzhbjacvb"
> seek = {'a','b','c'}
> count = 0
>
> for a in chars if a in seek: count += 1

Interesting proposal. However, I'm not sure how much benefit it really
will give us in practice. Reason being: Conditions are often not
trivial, descriptive variable names are often not super short. Before
you know it, the expressions for the iterable and for the condition are
long enough to go past your project's max line-width. And then suddenly
you are left with something worse than two indents: A line break and
continuation of a for-loop/if-condition (those are the worst).

for my_well_names_variable in some_complex_iterable \
if a_complex_condition_that_needs_to_be_evaluated:
count += 1

Or maybe:

for (my_well_names_variable in some_complex_iterable
 if
a_complex_condition_that_needs_to_be_evaluated):
count += 1

Or maybe:

for my_well_names_variable in some_complex_iterable \
if a_complex_condition_that_needs_to_be_evaluated:
count += 1

None of those are nice. That's a general issue with line-breaks in for-
loops or if-condition and has nothing to do with your proposal
specifically.


I think this here is more readable and less prone to errors:

for my_well_names_variable in some_complex_iterable:
if a_complex_condition_that_needs_to_be_evaluated:
count += 1

All in all, I like the proposal, but I'm not sure it would buy us that
much. Specifically, I'm not sure that it would help a lot with
readability and may end up making it worse, since you'll have a higher
chance of having those line-breaks.

Juergen



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: RFC: For Loop Invariants

2020-04-10 Thread Chris Angelico
On Sat, Apr 11, 2020 at 10:32 AM Juergen Brendel  wrote:
>
>
> Hello!
>
> On Fri, 2020-04-10 at 15:44 -0500, Elliott Dehnbostel wrote:
> > chars = "abcaaabkjzhbjacvb"
> > seek = {'a','b','c'}
> > count = 0
> >
> > for a in chars if a in seek: count += 1
>
> Interesting proposal. However, I'm not sure how much benefit it really
> will give us in practice. Reason being: Conditions are often not
> trivial, descriptive variable names are often not super short. Before
> you know it, the expressions for the iterable and for the condition are
> long enough to go past your project's max line-width.

Corollary: Conditions ARE often quite simple, and descriptive variable
names used in short-scope situations (such as loops) ARE often fairly
short.

for var in dir(config):
if var.startswith("__"): continue # Ignore dunders

for part in tweet:
if not part: continue

for id, timer in database.list_timers(channelid):
if id in timer_sockets:
for ws in timer_sockets[id]:
ws.send(json.dumps({"type": "adjust", "delta": delta}))

for setup in data["setups"]:
if setup == "": continue # The shim at the end

These were all taken from one project of mine - this is production
code. The conditions are simple enough and the loops have descriptive
but not overly-long names. In the case of the timers example, I could
word it with timer_sockets.get(id, ()), but the others all would
benefit from this proposal.

It's easy to show loops that come close to 80 characters and
conditions that add as much again, but real code isn't always that
messy.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Secure Coding in Python

2020-04-10 Thread Souvik Dutta
Is this what you are looking for?
https://medium.com/@felsen88/python-secure-coding-guidelines-73c7ce1db86c

On Sat, 11 Apr, 2020, 3:54 am Kor son of Rynar, 
wrote:

> Dear list,
>
> As many of you know, SEI/CERT maintains a set of secure coding standards
> for many languages like C/C++, Java and Perl:
>
>   SEI CERT Coding Standards
>
>
> https://wiki.sei.cmu.edu/confluence/display/seccode/SEI+CERT+Coding+Standards
>
> I'm looking for something similar, but with specific advice applicable to
> Python.  Books and online references are welcome.
>
> On the same topic: coming from Perl, I'm used to "Taint mode":
> --
> https://perldoc.perl.org/perlsec.html
>
> While in this mode, Perl takes special precautions called taint checks to
> prevent both obvious and subtle traps. Some of these checks are reasonably
> simple, such as verifying that path directories aren't writable by others;
> careful programmers have always used checks like these. Other checks,
> however, are best supported by the language itself, and it is these checks
> especially that contribute to making a set-id Perl program more secure than
> the corresponding C program.
>
> You may not use data derived from outside your program to affect something
> else outside your program--at least, not by accident. All command line
> arguments, environment variables, locale information (see perllocale),
> results of certain system calls (readdir(), readlink(), the variable of
> shmread(), the messages returned by msgrcv(), the password, gcos and shell
> fields returned by the getpwxxx() calls), and all file input are marked as
> "tainted". Tainted data may not be used directly or indirectly in any
> command that invokes a sub-shell, nor in any command that modifies files,
> directories, or processes, ...
> --
>
> Is there anything like this in Python?  What would be your
> recommendations?  Thanks!
>
> Regards,
> --
> Kor.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: RFC: For Loop Invariants

2020-04-10 Thread Souvik Dutta
How about completely removing the need for an if statement by allowing for
multiple conditions to be inserted in the for loop?? That would make
reading and writing a lot easier. Like the count problem could be rewritten
as
for (a in chars and  ):
count+=1

On Sat, 11 Apr, 2020, 6:21 am Chris Angelico,  wrote:

> On Sat, Apr 11, 2020 at 10:32 AM Juergen Brendel 
> wrote:
> >
> >
> > Hello!
> >
> > On Fri, 2020-04-10 at 15:44 -0500, Elliott Dehnbostel wrote:
> > > chars = "abcaaabkjzhbjacvb"
> > > seek = {'a','b','c'}
> > > count = 0
> > >
> > > for a in chars if a in seek: count += 1
> >
> > Interesting proposal. However, I'm not sure how much benefit it really
> > will give us in practice. Reason being: Conditions are often not
> > trivial, descriptive variable names are often not super short. Before
> > you know it, the expressions for the iterable and for the condition are
> > long enough to go past your project's max line-width.
>
> Corollary: Conditions ARE often quite simple, and descriptive variable
> names used in short-scope situations (such as loops) ARE often fairly
> short.
>
> for var in dir(config):
> if var.startswith("__"): continue # Ignore dunders
>
> for part in tweet:
> if not part: continue
>
> for id, timer in database.list_timers(channelid):
> if id in timer_sockets:
> for ws in timer_sockets[id]:
> ws.send(json.dumps({"type": "adjust", "delta": delta}))
>
> for setup in data["setups"]:
> if setup == "": continue # The shim at the end
>
> These were all taken from one project of mine - this is production
> code. The conditions are simple enough and the loops have descriptive
> but not overly-long names. In the case of the timers example, I could
> word it with timer_sockets.get(id, ()), but the others all would
> benefit from this proposal.
>
> It's easy to show loops that come close to 80 characters and
> conditions that add as much again, but real code isn't always that
> messy.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: RFC: For Loop Invariants

2020-04-10 Thread Chris Angelico
On Sat, Apr 11, 2020 at 11:04 AM Souvik Dutta  wrote:
>
> How about completely removing the need for an if statement by allowing for 
> multiple conditions to be inserted in the for loop?? That would make reading 
> and writing a lot easier. Like the count problem could be rewritten as
> for (a in chars and  ):
> count+=1
>

A loop fundamentally has to have an iterable and an assignment target
(usually a variable). That's not a condition, it's a loop. The only
reason it looks like multiple conditions is that the "in" keyword is
doing two slightly different things here :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: RFC: For Loop Invariants

2020-04-10 Thread Souvik Dutta
Ah yes it's an iterable not a condition. Sorry about that. 😛😛

Souvik flutter dev

On Sat, Apr 11, 2020, 6:38 AM Chris Angelico  wrote:

> On Sat, Apr 11, 2020 at 11:04 AM Souvik Dutta 
> wrote:
> >
> > How about completely removing the need for an if statement by allowing
> for multiple conditions to be inserted in the for loop?? That would make
> reading and writing a lot easier. Like the count problem could be rewritten
> as
> > for (a in chars and  ):
> > count+=1
> >
>
> A loop fundamentally has to have an iterable and an assignment target
> (usually a variable). That's not a condition, it's a loop. The only
> reason it looks like multiple conditions is that the "in" keyword is
> doing two slightly different things here :)
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list