ANN: A new version (0.4.1) of python-gnupg has been released.

2017-07-11 Thread Vinay Sajip via Python-announce-list
A new version of the Python module which wraps GnuPG has been released.

What Changed?
=
This is an enhancement and bug-fix release, and all users are encouraged to 
upgrade.
See the project website [1] for more information.

Brief summary:

* Updated message handling logic to no longer raise exceptions when a message 
isn't
  recognised. Thanks to Daniel Kahn Gillmor for the patch.
* Always use always use --fixed-list-mode, --batch and --with-colons. Thanks to 
Daniel
  Kahn Gillmor for the patch.
* Improved scan_keys() handling on GnuPG >= 2.1. Thanks to Daniel Kahn Gillmor 
for the
  patch.
* Improved test behaviour with GnuPG >= 2.1. Failures when deleting test 
directory trees
  are now ignored. Thanks to Daniel Kahn Gillmor for the patch.
* Added close_file keyword argument to verify_file to allow the file closing to 
be made
  optional. Current behaviour is maintained - close_file=False can be passed to 
skip
  closing the file being verified.
* Added the extra_args keyword parameter to allow custom arguments to be passed 
to the
  gpg executable.
* Instances of the GPG class now have an additional on_data attribute, which 
defaults to
  None. It can be set to a callable which will be called with a single argument 
- a binary
  chunk of data received from the gpg executable. The callable can do whatever 
it likes
  with the chunks passed to it - e.g. write them to a separate stream. The 
callable should
  not raise any exceptions (unless it wants the current operation to fail).

This release [2] has been signed with my code signing key:

Vinay Sajip (CODE SIGNING KEY) 
Fingerprint: CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86

What Does It Do?

The gnupg module allows Python programs to make use of the
functionality provided by the Gnu Privacy Guard (abbreviated GPG or
GnuPG). Using this module, Python programs can encrypt and decrypt
data, digitally sign documents and verify digital signatures, manage
(generate, list and delete) encryption keys, using proven Public Key
Infrastructure (PKI) encryption technology based on OpenPGP.

This module is expected to be used with Python versions >= 2.4, as it
makes use of the subprocess module which appeared in that version of
Python. This module is a newer version derived from earlier work by
Andrew Kuchling, Richard Jones and Steve Traugott.

A test suite using unittest is included with the source distribution.

Simple usage:

>>> import gnupg
>>> gpg = gnupg.GPG(gnupghome='/path/to/keyring/directory')
>>> gpg.list_keys()

[{
...
'fingerprint': 'F819EE7705497D73E3CCEE65197D5DAC68F1AAB2',
'keyid': '197D5DAC68F1AAB2',
'length': '1024',
'type': 'pub',
'uids': ['', 'Gary Gross (A test user) ']},
{
...
'fingerprint': '37F24DD4B918CC264D4F31D60C5FEFA7A921FC4A',
'keyid': '0C5FEFA7A921FC4A',
'length': '1024',
...
'uids': ['', 'Danny Davis (A test user) ']}]
>>> encrypted = gpg.encrypt("Hello, world!", ['0C5FEFA7A921FC4A'])
>>> str(encrypted)

'-BEGIN PGP MESSAGE-\nVersion: GnuPG v1.4.9 (GNU/Linux)\n
\nhQIOA/6NHMDTXUwcEAf
.
-END PGP MESSAGE-\n'
>>> decrypted = gpg.decrypt(str(encrypted), passphrase='secret')
>>> str(decrypted)

'Hello, world!'
>>> signed = gpg.sign("Goodbye, world!", passphrase='secret')
>>> verified = gpg.verify(str(signed))
>>> print "Verified" if verified else "Not verified"

'Verified'

As always, your feedback is most welcome (especially bug reports [3],
patches and suggestions for improvement, or any other points via the
mailing list/discussion group [4]).

Please refer to the documentation [5] for more information.

Enjoy!

Cheers

Vinay Sajip
Red Dove Consultants Ltd.

[1] https://bitbucket.org/vinay.sajip/python-gnupg
[2] https://pypi.python.org/pypi/python-gnupg/0.4.1
[3] https://bitbucket.org/vinay.sajip/python-gnupg/issues
[4] https://groups.google.com/forum/#!forum/python-gnupg
[5] https://gnupg.readthedocs.io/en/latest/ 
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


pytypes 1.0 beta 1 released

2017-07-11 Thread Stefan Richthofer
After many months of work, we proudly announce the first beta release of 
pytypes.
(https://github.com/Stewori/pytypes)

pytypes is a toolbox for PEP-484 style typing, explicitly supporting
Python >= 3.3, Python 2.7, Jython >= 2.7.1, PyPy 3 (others not tested, but 
might work).

Its main features are

- decorators and profiler for runtime typechecking
- decorators for typesafe override checking of methods
- easily pull type information from stubfiles into __annotations__
- get_type_hints: workable backport to Python 2.7 (based on type comments)
- get_type_hints: variant that also takes stubfiles into account
- utility functions is_of_type(obj, tp) and is_subtype(subtype, supertype) for 
use with PEP 484 types
- decorator and profiler for generating stubfiles from type information 
observed and logged at runtime
- all these features work equally well on Python 2.7
- all these features smoothly work with OOP, i.e. methods, static methods, 
class methods, properties

This beta release is intended to allow testing of pytypes' approaches in 
real-world code.
Please check to what extend it suites your needs and help us to improve it.

Github: https://github.com/Stewori/pytypes/releases
PyPI: https://pypi.python.org/pypi/pytypes

License: Apache 2.0

Enjoy!


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

Support the Python Software Foundation:
http://www.python.org/psf/donations/