Skip to main content

Toolkit for various fun and useful tasks

Project description

The fun package contains utilities that are entertaining yet somewhat useful. Maybe.

Installation

To install normally:

$ pip install fun-supergus

To install locally in ‘editable mode’, clone the GitHub repo and run:

$ pip install -e /path/to/package/fun

The package does not have any dependencies and was tested with Python 3.7.

Contact me if you have any questions. This is a project just for fun (obviously!) and I cannot guarantee a response, sorry.

Configuration

The communications module requires an email account to establish an SMTP session. You must configure the credentials listed at the top of fun/communications/communicator.py.

If you installed normally, you must navigate to the site-packages library of your current Python environment and edit the file.

If you installed in editable mode, you may prefer to edit the cloned repo using your favorite IDE.

Package Contents

The fun repository contains three folders:

  • communications: Use E.T’s communicator to send emails and SMS messages with a single command.

  • printing: Print fancy, formatted text to the console and flaunt your style.

  • bin: Executable examples.

After importing fun into your code, the utilities should be called directly using fun.<function>. See examples below.

How to Have Fun with E.T.’s Communicator!

First, import the package:

from fun import et

Try sending some messages. The communicator should work regardless of whether you are inside a company’s managed network or not, assuming you are running from an authenticated session.

# Using arbitrary phone numbers or emails:
et.phone_home('Howdy, this is my message to you.', '734-555-5555', subject='Test message from Chris')

# Using the JSON directory in fun/communications/contact_list.json to target users:
et.phone_home('There can never be too much foo.', 'joe', subject='Foo')

# Using the JSON directory to target groups:
et.phone_home('Fear is the mindkiller.', ['admin', 'physics'], subject='I must not fear')

When using users or groups from the JSON directory, by default E.T. will send messages via email and SMS to each targeted person. You can modify this behavior by toggling the boolean options disable_sms and disable_email.

When providing explicit phone numbers or email addresses, you don’t need to worry about toggling the options - it’s handled automatically. Phone numbers can be any format, including an integer, but they must contain 10 digits after any leading 0s or 1s.

The contact directory is located at fun/communications/contact_list.json and can be edited freely.

Let’s use the directory and select either email or SMS:

# Only send emails to the group 'physics', no SMS:
et.phone_home('Need those reports today.', 'physics', subject='TPS Reports', disable_sms=True)

# Only send SMS messages to the user 'joe', no emails:
et.phone_home('There is no try.', 'joe', subject='Do or do not', disable_email=True)

Finally, you can add attachments to emails:

# Send email with attachment:
target='/documents/tps_report.xlsx'     # A Path-like object
et.phone_home('Check this out!', 'chris@somewhere.com', subject='Report', attachment=target)

How to Have Fun with Fancy Printing!

After importing the package, try printing some formatted text to the stdout console:

from fun import fancy_print

# See the docstring of fancy_print() for description of all options.
fancy_print('I like pretty things', fg='light_pink', bold=True, framed=True)

Run the built-in demo to see everything the Fancy Printer can do:

# Run the built-in demo
fancy_print('Foo Fighters Rule', demo=True)

That’s all for now. Be sure to have some Fun!

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

fun-supergus-0.1.4.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fun_supergus-0.1.4-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file fun-supergus-0.1.4.tar.gz.

File metadata

  • Download URL: fun-supergus-0.1.4.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.4

File hashes

Hashes for fun-supergus-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b93018553af60158660bd6f13eca52c479f09ff7013edfedf18072e857da2b25
MD5 4629a42144d75da1be663886ec02635b
BLAKE2b-256 ca9199070e3fd0c79eb21a0459a20046d52788029cefb78e3c5bdd40c6b0856c

See more details on using hashes here.

File details

Details for the file fun_supergus-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: fun_supergus-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.4

File hashes

Hashes for fun_supergus-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 57fde2cc91544999702432add5b30a4cd348cbc440d3b8923d2ec2684dd3a548
MD5 4832aed0285a4ae01e0d7b2bcd81267c
BLAKE2b-256 c8405379ee5d391b247a67aa20315a7b3ea1bb3abfba374c7e653e2921a2d3bc

See more details on using hashes here.

Supported by

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