Skip to main content

Python library + CLI for Fastmail masked email

Project description

fastmask

Python library and command line tool for Fastmail's Masked Email

Install & Setup

pip install fastmask

export FM_ME_TOKEN='YOUR-API-TOKEN-HERE'
export FM_USERNAME='user@domain.com'

Usage

fastmask [OPTIONS] COMMAND [ARGS]...

  Manage Fastmail masked email from the command line

Options:
  --version        Show the version and exit.
  --username TEXT  [default: (FM_USERNAME)]
  --token TEXT     [default: (FM_ME_TOKEN)]
  --help           Show this message and exit.

Commands:
  activate  Set state of masked email to Active
  block     Set state of masked email to Blocked
  delete    Delete masked email
  edit      Edit information associated with a masked email
  list      List masked emails associated with account
  new       Create a new masked email
  search    Search for masked emails

Authentication

You will need to provide an API token for fastmask to authenticate calls to the Fastmail API:

  1. In the Fastmail web client, go to Settings > Account > Password & Security > API Tokens > Manage > New API token
  2. Set name to "fastmask" or whatever you'd like, check only the Masked Email scope and hit Generate API token
  3. Copy the API token. You can authenticate either by providing your credentials as arguments, or by using the FM_ME_TOKEN and FM_USERNAME environment variables / providing these variables via .env file:

You can skip parsing .env with python-dotenv by setting the environment variable SKIP_PYTHONDOTENV=1.

Example:

export FM_ME_TOKEN='YOUR-TOKEN-HERE'
export FM_USERNAME='username@fastmail.com'

fastmask list --limit 5

# alternatively, you can provide your credentials as arguments
fastmask --username username@fastmail.com --token 'YOUR-TOKEN-HERE' \
  list --limit 5

Create a masked email

Use fastmask new to create a new masked email address. Optionally specifiy the description, URL or domain.

Example:

fastmask new twitter --url twitter.com

> Successfully added email fake.email1234@fastmail.com (id: masked-12345678)

List

fastmask list will return a Rich table, json, or csv of masked emails, optionally filtering results by active/blocked state, recent, used/unused status, etc.

Usage:

fastmask list [OPTIONS]

  List masked emails associated with account

Options:
  --limit INTEGER                 Limit number of results
  --active                        Show only active addresses
  --blocked                       Show only blocked addresses
  --unused                        Show only active + unused addresses
  --used                          Show only used addresses
  --deleted                       Show only deleted addresses
  --sort                          Field to sort by
  --desc / --asc                  Sort order
  --recent INTEGER                Only show items from the past X days
  -j, --json                      Print to json instead of table
  -o, --out TEXT                  Output to csv or json file
  --help                          Show this message and exit.

Examples:

fastmask list --unused
fastmask list --blocked --limit 20 --json
fastmask list --sort lastMessageAt --desc --active

Activate / Block / Delete

You can change the state of a masked email with fastmask activate, fastmask block or fastmask delete. Email IDs accepted are:

  • email address
  • description (case-insensitive)
  • the id of the address, with or without the "masked-" prefix

Examples:

fastmask activate new.mail0412@fastmail.com
fastmask block masked-12312345
fastmask delete facebook.com

Edit

fastmask edit can be used to change the description, url or domain associated with masked email address.

Example:

fastmask edit some.user1231@fastmail.com --description x.com --url x.com

Search

fastmask search is a case-insensitive search defaulting to matching email addresses and descriptions. You can set the fields searches using the --field flag.

Examples:

fastmask search reddit
fastmask search --field email fastmail.com
fastmask search --field createdAt 2022-10-31
fastmask search --field createdBy fastmask -o out.csv

See full CLI and library documentation at https://fastmask.readthedocs.io/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastmask-0.1.6.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

fastmask-0.1.6-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file fastmask-0.1.6.tar.gz.

File metadata

  • Download URL: fastmask-0.1.6.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for fastmask-0.1.6.tar.gz
Algorithm Hash digest
SHA256 23d907941dacba6ccdc484b1fda7a87c34c34931c84e5e256cad8c54f0b4faed
MD5 bea220777bfdc1fb8ebacaa040b0440b
BLAKE2b-256 42426b233ee13261c2dad4622a791d7b721e9c4c3e85f9956fe57182940b4335

See more details on using hashes here.

File details

Details for the file fastmask-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: fastmask-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for fastmask-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4203e178f6af2921d5e4b709b2ea7b8f3f86c65cc3843847d0780209c3aad2bd
MD5 d0bdd1c76ae009fab2d6f1161eb9cb04
BLAKE2b-256 446ada3ac3abf9570b6ed4dfbf077f1bdaf86e179ba487d8cad854690e07d828

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page