/usr/lib/python2.7/dist-packages/keyring-10.6.0.egg-info/PKG-INFO is in python-keyring 10.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | Metadata-Version: 1.2
Name: keyring
Version: 10.6.0
Summary: Store and access your passwords safely.
Home-page: https://github.com/jaraco/keyring
Author: Jason R. Coombs
Author-email: jaraco@jaraco.com
License: UNKNOWN
Description-Content-Type: UNKNOWN
Description: .. image:: https://img.shields.io/pypi/v/keyring.svg
:target: https://pypi.org/project/keyring
.. image:: https://img.shields.io/pypi/pyversions/keyring.svg
.. image:: https://img.shields.io/travis/jaraco/keyring/master.svg
:target: http://travis-ci.org/jaraco/keyring
.. image:: https://readthedocs.org/projects/keyring/badge/?version=latest
:target: http://keyring.readthedocs.io/en/latest/?badge=latest
=======================================
Installing and Using Python Keyring Lib
=======================================
.. contents:: **Table of Contents**
---------------------------
What is Python keyring lib?
---------------------------
The Python keyring lib provides an easy way to access the system keyring service
from python. It can be used in any application that needs safe password storage.
The keyring library is licensed under both the `MIT license
<http://opensource.org/licenses/MIT>`_ and the PSF license.
These recommended keyring backends are supported by the Python keyring lib:
* Mac OS X `Keychain
<https://en.wikipedia.org/wiki/Keychain_%28software%29>`_
* Freedesktop `Secret Service
<http://standards.freedesktop.org/secret-service/>`_ (requires
`secretstorage <https://pypi.python.org/pypi/secretstorage>`_)
* `KWallet <https://en.wikipedia.org/wiki/KWallet>`_
(requires `dbus <https://pypi.python.org/pypi/dbus-python>`_)
* `Windows Credential Locker
<https://docs.microsoft.com/en-us/windows/uwp/security/credential-locker>`_
Other keyring implementations are provided in the `keyrings.alt package`_.
-------------------------
Installation Instructions
-------------------------
Install from Index
==================
Install using your favorite installer. For example:
$ pip install keyring
Linux
-----
On Linux, the recommended keyring relies on SecretStorage, which in
turn relies on dbus-python, but dbus-python does not install correctly
when using the Python installers, so dbus-python must be installed
as a system package. See `the SecretStorage GitHub repo
<https://github.com/mitya57/secretstorage>`_ for details.
-------------
Using Keyring
-------------
The basic usage of keyring is pretty simple: just call `keyring.set_password`
and `keyring.get_password`:
>>> import keyring
>>> keyring.set_password("system", "username", "password")
>>> keyring.get_password("system", "username")
'password'
Command-line Utility
====================
Keyring supplies a ``keyring`` command which is installed with the
package. After installing keyring in most environments, the
command should be available for setting, getting, and deleting
passwords. For more information on usage, invoke with no arguments
or with ``--help`` as so::
$ keyring --help
$ keyring set system username
Password for 'username' in 'system':
$ keyring get system username
password
The command-line functionality is also exposed as an executable
package, suitable for invoking from Python like so::
$ python -m keyring --help
$ python -m keyring set system username
Password for 'username' in 'system':
$ python -m keyring get system username
password
--------------------------
Configure your keyring lib
--------------------------
The python keyring lib contains implementations for several backends. The
library will
automatically choose the keyring that is most suitable for your current
environment. You can also specify the keyring you like to be used in the
config file or by calling the ``set_keyring()`` function.
Customize your keyring by config file
=====================================
This section describes how to change your option in the config file.
Config file path
----------------
The configuration of the lib is stored in a file named "keyringrc.cfg". This
file must be found in a platform-specific location. To determine
where the config file is stored, run the following::
python -c "import keyring.util.platform_; print(keyring.util.platform_.config_root())"
Some keyrings also store the keyring data in the file system. To determine
where the data files are stored, run this command::
python -c "import keyring.util.platform_; print(keyring.util.platform_.data_root())"
Config file content
-------------------
To specify a keyring backend, set the **default-keyring** option to the
full path of the class for that backend, such as
``keyring.backends.OS_X.Keyring``.
If **keyring-path** is indicated, keyring will add that path to the Python
module search path before loading the backend.
For example, this config might be used to load the SimpleKeyring from the demo
directory in the project checkout::
[backend]
default-keyring=simplekeyring.SimpleKeyring
keyring-path=/home/kang/pyworkspace/python-keyring-lib/demo/
Third-Party Backends
====================
In addition to the backends provided by the core keyring package for
the most common and secure use cases, there
are additional keyring backend implementations available for other
use-cases. Simply install them to make them available:
- `keyrings.alt <https://pypi.org/project/keyrings.alt>`_ - "alternate",
less common backends, originally part of the core package, but now
available for opt-in.
- `keyring_jeepney <https://pypi.python.org/pypi/keyring_jeepney>`__ - a
pure Python backend using the secret service DBus API for desktop
Linux.
Write your own keyring backend
==============================
The interface for the backend is defined by ``keyring.backend.KeyringBackend``.
Every backend should derive from that base class and define a ``priority``
attribute and three functions: ``get_password()``, ``set_password()``, and
``delete_password()``.
See the ``backend`` module for more detail on the interface of this class.
Keyring employs entry points to allow any third-party package to implement
backends without any modification to the keyring itself. Those interested in
creating new backends are encouraged to create new, third-party packages
in the ``keyrings`` namespace, in a manner modeled by the `keyrings.alt
package <https://github.com/jaraco/keyrings.alt>`_. See the ``setup.py`` file
in that project for a hint on how to create the requisite entry points.
Backends that prove essential may be considered for inclusion in the core
library, although the ease of installing these third-party packages should
mean that extensions may be readily available.
If you've created an extension for Keyring, please submit a pull request to
have your extension mentioned as an available extension.
Set the keyring in runtime
==========================
Keyring additionally allows programmatic configuration of the
backend calling the api ``set_keyring()``. The indicated backend
will subsequently be used to store and retrieve passwords.
Here's an example demonstrating how to invoke ``set_keyring``::
# define a new keyring class which extends the KeyringBackend
import keyring.backend
class TestKeyring(keyring.backend.KeyringBackend):
"""A test keyring which always outputs same password
"""
priority = 1
def set_password(self, servicename, username, password):
pass
def get_password(self, servicename, username):
return "password from TestKeyring"
def delete_password(self, servicename, username, password):
pass
# set the keyring for keyring lib
keyring.set_keyring(TestKeyring())
# invoke the keyring lib
try:
keyring.set_password("demo-service", "tarek", "passexample")
print("password stored successfully")
except keyring.errors.PasswordSetError:
print("failed to store password")
print("password", keyring.get_password("demo-service", "tarek"))
Using Keyring on Ubuntu 16.04
=============================
The following is a complete transcript for installing keyring in a
virtual environment on Ubuntu 16.04. No config file was used.::
$ sudo apt install python3-venv libdbus-glib-1-dev
$ cd /tmp
$ pyvenv py3
$ source py3/bin/activate
$ pip install -U pip
$ pip install secretstorage dbus-python
$ pip install keyring
$ python
>>> import keyring
>>> keyring.get_keyring()
<keyring.backends.SecretService.Keyring object at 0x7f9b9c971ba8>
>>> keyring.set_password("system", "username", "password")
>>> keyring.get_password("system", "username")
'password'
Using Keyring on headless Linux systems
=======================================
It is possible to use the SecretService backend on Linux systems without
X11 server available (only D-Bus is required). To do that, you need the
following:
* Install the `GNOME Keyring`_ daemon.
* Start a D-Bus session, e.g. run ``dbus-run-session -- sh`` and run
the following commands inside that shell.
* Run ``gnome-keyring-daemon`` with ``--unlock`` option. The description of
that option says:
Read a password from stdin, and use it to unlock the login keyring
or create it if the login keyring does not exist.
When that command is started, enter your password into stdin and
press Ctrl+D (end of data). After that the daemon will fork into
background (use ``--foreground`` option to prevent that).
* Now you can use the SecretService backend of Keyring. Remember to
run your application in the same D-Bus session as the daemon.
.. _GNOME Keyring: https://wiki.gnome.org/Projects/GnomeKeyring
-----------------------------------------------
Integrate the keyring lib with your application
-----------------------------------------------
API interface
=============
The keyring lib has a few functions:
* ``get_keyring()``: Return the currently-loaded keyring implementation.
* ``get_password(service, username)``: Returns the password stored in the
active keyring. If the password does not exist, it will return None.
* ``set_password(service, username, password)``: Store the password in the
keyring.
* ``delete_password(service, username)``: Delete the password stored in
keyring. If the password does not exist, it will raise an exception.
In all cases, the parameters (``service``, ``username``, ``password``)
should be Unicode text. On Python 2, these parameters are accepted as
simple ``str`` in the default encoding as they will be implicitly
decoded to text. Some backends may accept ``bytes`` for these parameters,
but such usage is discouraged.
------------
Get involved
------------
Python keyring lib is an open community project and highly welcomes new
contributors.
* Repository: https://github.com/jaraco/keyring/
* Bug Tracker: https://github.com/jaraco/keyring/issues/
* Mailing list: http://groups.google.com/group/python-keyring
Making Releases
===============
This project makes use of automated releases via Travis-CI. The
simple workflow is to tag a commit and push it to Github. If it
passes tests on a late Python version, it will be automatically
deployed to PyPI.
Other things to consider when making a release:
- first ensure that tests pass (preferably on Windows and Linux)
- check that the changelog is current for the intended release
Running Tests
=============
Tests are `continuously run <https://travis-ci.org/#!/jaraco/keyring>`_ using
Travis-CI.
To run the tests yourself, you'll want keyring installed to some environment
in which it can be tested. Recommended technique is described below.
Using tox
---------
Keyring prefers use of `tox <https://pypi.org/project/tox>`_ to run tests.
Simply install and invoke ``tox``.
This technique is the one used by the Travis-CI script.
----------
Background
----------
The project was based on Tarek Ziade's idea in `this post`_. Kang Zhang
initially carried it out as a `Google Summer of Code`_ project, and Tarek
mentored Kang on this project.
.. _this post: http://tarekziade.wordpress.com/2009/03/27/pycon-hallway-session-1-a-keyring-library-for-python/
.. _Google Summer of Code: http://socghop.appspot.com/
.. image:: https://badges.gitter.im/jaraco/keyring.svg
:alt: Join the chat at https://gitter.im/jaraco/keyring
:target: https://gitter.im/jaraco/keyring?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=2.7
|