Skip to main content

Around the Globe

A small timezone utility

https://api.travis-ci.org/crodjer/atg.svg https://coveralls.io/repos/crodjer/atg/badge.svg?branch=master
$ atg Mountain View
Their timezone is "America/Los_Angeles"
Their time: Sat Jul  4 07:13:34 2015
People there may be sleeping.
Convenient time slots:
    08:00 to 11:00 here i.e. 19:30 to 22:30 there
    20:30 to 22:30 here i.e. 08:00 to 10:00 there

Features

  • Get the timezone for a random address.

  • Current time anywhere.

  • Guesses about what people may be doing.

  • Helps you schedule meetings by providing you spans of convenient times.

Installation

This is a Python package, which can be simply installed through pip:

# $HOME/.local/bin should be in $PATH for this to work.
$ pip install --user atg

and to install it globally, run:

$ sudo pip install atg

Usage

Get all the information about the time at Mountain View:

$ atg Mountain View
Their timezone is "America/Los_Angeles"
Their time: Sat Jul  4 07:13:34 2015
People there may be sleeping.
Convenient time slots:
    08:00 to 11:00 here i.e. 19:30 to 22:30 there
    20:30 to 22:30 here i.e. 08:00 to 10:00 there

If you want to avoid querying the timezone to Google’s maps api everytime, you can directly use the timezone in further requests:

$ atg America/Los_Angeles

By default, atg calculates time slots based to avoid sleep periods. You can use --dnd to customize this. For example, to avoid disturbing at work/sleep:

$ atg Mountain View --dnd work --dnd sleep

You can also specify who the time slots should be convenient to. By default it will consider both. If you want the convenient timings for the remote location:

$ atg Mountain View -c there

You may also use the flag --convenient-for flag. If you don’t care about the remote location’s convenience:

$ atg Mountain View --convenient-for here

Help

You can always refer to the command usage through atg -h.

usage: atg [-h] [--dnd {work,sleep,available}] [-c {here,there}]
           [-m MY_LOCATION] [-x {timezone,now,default,status,schedule}]
           remote [remote ...]

positional arguments:
  remote                the remote location

optional arguments:
  -h, --help            show this help message and exit
  --dnd {work,sleep,available}
                        the do not disturb activities (default: sleep)
  -c {here,there}, --convenient-for {here,there}
                        which side's convenience should be considered
                        (default: both)
  -m MY_LOCATION, --my-location MY_LOCATION
                        specify your own location (default from system time)
  -x {timezone,now,default,status,schedule}, --command {timezone,now,default,status,schedule}
                        the command for atg to execute

Developing and Testing

atg uses the pytz, tzlocal and enum34 (for backwards compatibility) as dependencies.

To set things up for development, create and activate a virtualenv and run

$ pip install -e .[dev,test]
$ python setup.py develop

Tests

Run tests via:

$ nosetests

Bugs

Probably lots. Please send us reports on the Github issue tracker. Patches are welcome too.

Metadata

Release files for atg 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atg 0.0.6
File Size Uploaded
atg-0.0.6.tar.gz 7.5 kB Details

Release files / atg-0.0.6.tar.gz

Download URL atg-0.0.6.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
28e2fdccad5e4bd780c7696d8f78f2a2654f21f2556129c9a09e90bb8867c791
BLAKE2b-256 checksum
How to use checksums
6fba97cd1df293b6e3375b5d46a3df739f7d347c54002dbaceb8243e7b192e63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.6 This release

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page