All Projects → reinefjord → pass2csv

reinefjord / pass2csv

Licence: MIT license
Export pass(1), "the standard unix password manager", to CSV.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to pass2csv

pass-audit
A pass extension for auditing your password repository.
Stars: ✭ 71 (+1.43%)
Mutual labels:  password-manager, pass
cerebro-pass
Cerebro plugin for pass.
Stars: ✭ 15 (-78.57%)
Mutual labels:  password-manager, pass
PassHUD
A HUD-style interface for pass on macOS
Stars: ✭ 31 (-55.71%)
Mutual labels:  password-manager, pass
gnome-pass-search-provider
Pass password manager search provider for gnome-shell
Stars: ✭ 52 (-25.71%)
Mutual labels:  password-manager, pass
Portphp
Data import/export framework for PHP
Stars: ✭ 225 (+221.43%)
Mutual labels:  export
Rats
Movie Ratings Synchronization with Python
Stars: ✭ 156 (+122.86%)
Mutual labels:  export
Yii2 Export
A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)
Stars: ✭ 153 (+118.57%)
Mutual labels:  export
Dataset Serialize
JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC)
Stars: ✭ 213 (+204.29%)
Mutual labels:  export
Laravel Translatable String Exporter
Translatable String Exporter for Laravel
Stars: ✭ 149 (+112.86%)
Mutual labels:  export
Sketchup Stl
A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
Stars: ✭ 214 (+205.71%)
Mutual labels:  export
Jsonexport
{} → 📄 it's easy to convert JSON to CSV
Stars: ✭ 208 (+197.14%)
Mutual labels:  export
Photostation Upload Lr Plugin
Photo StatLr (aka PhotoStation Upload) is a Lightroom Publish and Export Service Plugin that enables the export /publishing of photos and videos from Lr to a Synology Photo Station. It uploads the photos/videos and all required thumbnails. It can download comments and ratings and do a real two-way synch of various metadata (tags, ratings, labels).
Stars: ✭ 159 (+127.14%)
Mutual labels:  export
jira-project-export
Export issues and metadata for a single JIRA project as JSON.
Stars: ✭ 18 (-74.29%)
Mutual labels:  export
Flares
Flares 🔥 is a CloudFlare DNS backup tool
Stars: ✭ 156 (+122.86%)
Mutual labels:  export
kubectl-passman
kubectl plugin that provides the missing link/glue between common password managers and kubectl
Stars: ✭ 69 (-1.43%)
Mutual labels:  password-manager
Poi Tl
Generate awesome word(docx) with template
Stars: ✭ 2,306 (+3194.29%)
Mutual labels:  export
keevault
Kee Vault is a password manager for your web browser. Password databases (Vaults) are encrypted using the KeePass storage format before being sent to a remote server for synchronisation across any modern device/browser
Stars: ✭ 57 (-18.57%)
Mutual labels:  password-manager
Discordchatexporter
Exports Discord chat logs to a file
Stars: ✭ 3,198 (+4468.57%)
Mutual labels:  export
Bitcoin Etl
ETL scripts for Bitcoin, Litecoin, Dash, Zcash, Doge, Bitcoin Cash. Available in Google BigQuery https://goo.gl/oY5BCQ
Stars: ✭ 174 (+148.57%)
Mutual labels:  export
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (-65.71%)
Mutual labels:  export

pass2csv

pass2csv is a tool that exports a pass(1) password store to a CSV. It can export whole stores, subdirectories of a store, and single password files. It can use regexp patterns to find and group data after the first line of each password into additional CSV columns, as well as exclude data from the export.

Source is available at GitHub, and the package is published to the Python Package Index.

You can install the package with pipx (recommended):

pipx install pass2csv

or with pip:

python3 -m pip install --user pass2csv

Usage

$ pass2csv --help
usage: pass2csv [-h] [-b path] [-g executable] [-a] [--encodings encodings]
                [-e pattern] [-f name pattern] [-l name pattern]
                STOREPATH OUTFILE

positional arguments:
  STOREPATH             path to the password-store to export
  OUTFILE               file to write exported data to, use - for stdout

options:
  -h, --help            show this help message and exit
  -b path, --base path  path to use as base for grouping passwords
  -g executable, --gpg executable
                        path to the gpg binary you wish to use (default 'gpg')
  -a, --use-agent       ask gpg to use its auth agent
  --encodings encodings
                        comma-separated text encodings to try, in order, when
                        decoding gpg output (default 'utf-8')
  -e pattern, --exclude pattern
                        regexp for lines which should not be exported, can be
                        specified multiple times
  -f name pattern, --get-field name pattern
                        a name and a regexp, the part of the line matching the
                        regexp will be removed and the remaining line will be
                        added to a field with the chosen name. only one match
                        per password, matching stops after the first match
  -l name pattern, --get-line name pattern
                        a name and a regexp for which all lines that match are
                        included in a field with the chosen name

Format

The output format is

Group(/),Title,Password,[custom fields...],Notes

You may add custom fields with --get-field or --get-line. You supply a name for the field and a regexp pattern. The field name is used for the header of the output CSV and to group multiple patterns for the same field; you may specify multiple patterns for the same field by specifying --get-field or--get-line multiple times with the same name. Regexp patterns are case-insensitive.

Examples

  • Password entry (~/.password-store/sites/example/login.gpg):
password123
---
username: user_name
email [email protected]
url:example.com
Some note
  • Command
pass2csv ~/.password-store \
  --exclude '^---$' \
  --get-field Username '(username|email):?' \
  --get-field URL 'url:?'
  • Output
Group(/),Title,Password,URL,Username,Notes
sites/example,login,password123,example.com,user_name,"email [email protected]\nSome note"

Grouping

The group is relative to the path, or the --base if given. Given the password ~/.password-store/sites/example/login.gpg:

$ pass2csv ~/.password-store/sites
    # Password will have group "example"

$ pass2csv ~/.password-store/sites --base ~/.password-store
    # Password will have group "sites/example"

gpg-agent password timeout

If your private key is protected by a password, gpg will ask for it with the pinentry program if you haven't set it to something else. If using gpg2 or the -a option with gpg, by default, the password is cached for 10 minutes but the timer is reset when using a key. After 2 hours the cache will be cleared even if it has been accessed recently.

You can set these values in your ~/.gnupg/gpg-agent.conf:

default-cache-ttl 600
max-cache-ttl 7200

Development

Create a virtual environment:

python3 -m venv venv

Activate the environment:

. venv/bin/activate

Now you may either use pip directly to install the dependencies, or you can install pip-tools. The latter is recommended.

pip

pip install -r requirements.txt

pip-tools

pip-tools can keep your virtual environment in sync with the requirements.txt file, as well as compiling a new requirements.txt when adding/removing a dependency in requirements.in.

It is recommended that pip-tools is installed within the virtual environment.

pip install pip-tools
pip-compile  # only necessary when adding/removing a dependency
pip-sync

Packaging

See https://packaging.python.org/tutorials/packaging-projects/ for detailed info.

  1. pip-sync requirements.txt dev-requirements.txt
  2. Increment version in setup.cfg.
  3. python3 -m build
  4. python3 -m twine upload dist/*version*
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].