Skip to main content

gaerpytz is like gaepytz (a version of pytz that works well on Google App Engine) but automated so zoneinfo is up-to-date.

Project description

gaerpytz is like gaepytz (a version of pytz that works well on Google App Engine) but automated so zoneinfo is up-to-date.

The problem

pytz has more than 500 zoneinfo files. This many files is a problem when using pytz on Google App Engine because “an application is limited to 10,000 uploaded files per version” according to the documentation.

The workaround is to package all zoneinfo files in a zip archive. gae-pytz is the most well-known example of this approach but it has not been updated in a long time.

The solution

gaerpytz uses the same idea and makes 2 changes to pytz:

  • Package all zoneinfo files in zoneinfo.zip

  • Modify __init__.py to read from zoneinfo.zip

Just download the modified code and put it in your pytz directory. You don’t need to change the code that uses pytz. (The package name gaerpytz is superficial and the package structure has not been changed.)

  • Import the package with import pytz

  • Use it like you would pytz

In practice, gaerpytz runs slightly slower due to the zip file.

So what? You can do this yourself, right?

Time zones are magic (change frequently based on local laws), so pytz is updated often. Applying these modifications to every new pytz release is tedious. This is why you see many out-of-date or abandoned packages that patch pytz on PyPI.

gaerpytz takes people out of the process. gaerpytz watches pytz. When a new version of pytz is released, gaerpytz automatically fetches a copy and builds itself. This is what makes gaerpytz Google App Engine -r than the pytz patches that came before.

You can view the code directly at https://gaerpytz.appspot.com/.

Even if you don’t use the code, please help me by contributing location data to the time zone database. Thank you!

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

gaerpytz-2020.5.zip (261.9 kB view details)

Uploaded Source

File details

Details for the file gaerpytz-2020.5.zip.

File metadata

  • Download URL: gaerpytz-2020.5.zip
  • Upload date:
  • Size: 261.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/2.7.17

File hashes

Hashes for gaerpytz-2020.5.zip
Algorithm Hash digest
SHA256 4ec62f499c596f886b42e00134ec4a32a74b9915592415b987ce434039e35d68
MD5 c78d95465e7bfc2c9ca5fc378c38da57
BLAKE2b-256 78c11adff0c992fad9c355cec8eeaa8544832ba084365b487d39065809361fbf

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