Skip to main content

A plugin for flake8 to ban the usage of unsafe naive datetime class.

Project description

# flake8-datetimez

A plugin for flake8 to ban the usage of unsafe naive datetime class.

## List of warnings

  • DTZ001 : The use of datetime.datetime() without tzinfo argument is not allowed.

  • DTZ002 : The use of datetime.datetime.today() is not allowed. Use datetime.datetime.now(tz=) instead.

  • DTZ003 : The use of datetime.datetime.utcnow() is not allowed. Use datetime.datetime.now(tz=) instead.

  • DTZ004 : The use of datetime.datetime.utcfromtimestamp() is not allowed. Use datetime.datetime.fromtimestamp(, tz=) instead.

  • DTZ005 : The use of datetime.datetime.now() without tz argument is not allowed.

  • DTZ006 : The use of datetime.datetime.fromtimestamp() without tz argument is not allowed.

  • DTZ007 : The use of datetime.datetime.strptime() without %z must be followed by .replace(tzinfo=) or .astimezone().

  • DTZ011 : The use of datetime.date.today() is not allowed. Use datetime.datetime.now(tz=).date() instead.

  • DTZ012 : The use of datetime.date.fromtimestamp() is not allowed. Use datetime.datetime.fromtimestamp(, tz=).date() instead.

## Install

Install with pip

` $ pip install flake8-datetimez `

## Requirements - Python 3.6 or above - flake8 3.0.0 or above

## License

MIT

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

flake8-datetimez-20.10.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

flake8_datetimez-20.10.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file flake8-datetimez-20.10.0.tar.gz.

File metadata

  • Download URL: flake8-datetimez-20.10.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for flake8-datetimez-20.10.0.tar.gz
Algorithm Hash digest
SHA256 78939f3bcbe2b7fe48235998545c869c27cdfac3f45685099a3f7366c1ffebc6
MD5 41853057152240d5c9f15fd0ba5c9e89
BLAKE2b-256 049472744acab2d9460c092ad8252a13da8fc64685cfb84f3422c21c378da928

See more details on using hashes here.

File details

Details for the file flake8_datetimez-20.10.0-py3-none-any.whl.

File metadata

  • Download URL: flake8_datetimez-20.10.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for flake8_datetimez-20.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57aa2f55eb88797e2d8c06bd536ff8049b9f1ba877d81dc06ff8d9bdc195c1fc
MD5 2e2628093f587ecab785ed9f972d2efe
BLAKE2b-256 0f94c1e0448d04e84b6a3d49675c2cc301d91549f540dc5b27739e1d1c0ed171

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