Time-handling functionality from netcdf4-python
Project description
cftime
Time-handling functionality from netcdf4-python
News
For details on the latest updates, see the Changelog.
2/1/2021: Version 1.4.0 released. License changed to MIT (GPL'ed code replaced). Roundtrip accuracy improved for units other than microseconds. Added cftime.datetime.toordinal method, returns integer julian day number.
1/17/2021: Version 1.3.1 released.
11/16/2020: Version 1.3.0 released. API change: The cftime.datetime
constructor now creates
'calendar-aware' instances (default is 'standard'
calendar, if calendar=''
or None
the instance
is not calendar aware and some methods, like dayofwk
, dayofyr
, __add__
and __sub__
, will not work)
See discussion for issue #198.
The calendar specific sub-classes are now deprecated, but remain for now
as stubs that just instantiate the base class and override __repr__
.
The default calendar in cftime.date2num
has been changed from 'standard'
to None
(the calendar associated with first input datetime object is used to define the calendar).
07/20/2020: Version 1.2.1 released. Fixes a couple of regressions introduced in 1.2.0. See Changelog for details.
7/06/2020: version 1.2.0 released. New microsecond accurate algorithm for date2num/num2date contributed by spencerkclark. Bugs fixed in masked array handling.
5/12/2020: version 1.1.3 released. Add isoformat method for compatibility with python datetime (issue #152). Make 'standard' default calendar for cftime.datetime so that dayofwk,dayofyr methods don't fail (issue #169).
4/20/2020: version 1.1.2 released. Code optimization, fix logic so only_use_cftime_datetimes=False
works as
expected (issues #158 and #165).
3/16/2020: version 1.1.1 released. Fix bug in microsecond formatting, ensure identical num2date results if input is an array of times, or a single scalar (issue #143).
2/12/2020: version 1.1.0 released. cftime.datetime
instances are returned by default from num2date
(instead of returning python datetime instances where possible (issue #136)). num2pydate
convenience function added (always returns python datetime instances, issue #134). Fix for
fraction seconds in reference date string (issue #140). Added daysinmonth
attribute
(issue #137).
10/25/2019: version 1.0.4.2 released (fix for issue #126).
10/21/2019: version 1.0.4 released.
12/05/2018: version 1.0.3.4 released (just to fix a problem with the source tarball on pypi).
12/05/2018: version 1.0.3.1 released. Bugfix release (fixed issue with installation when cython not installed, regression on 32-bit platforms, workaround for pandas compatibility).
12/01/2018: version 1.0.3 released. Test coverage with coveralls.io, improved round-tripping accuracy for non-real world calendars (like 360_day
).
10/27/2018: version 1.0.2 released. Improved accuracy (from approximately 1000 microseconds to 10 microseconds on x86
platforms). Refactored calendar calculations now allow for negative reference years. num2date function now more than an
order of magnitude faster. months since
units now allowed, but only for 360_day
calendar.
08/15/2018: version 1.0.1 released.
11/8/2016: cftime
was split out of the netcdf4-python package.
Quick Start
-
Clone GitHub repository (
git clone https://github.com/Unidata/cftime.git
), or get source tarball from PyPI. Links to Windows and OS X precompiled binary packages are also available on PyPI. -
Make sure numpy and Cython are installed and you have Python 2.7 or newer.
-
Run
python setup.py build
, thenpython setup.py install
(withsudo
if necessary). -
To run all the tests, execute
py.test
.
Documentation
See the online docs for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for cftime-1.4.0-pp37-pypy37_pp73-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 176c554c66800316e168e0c202d3355db54d435a6e3b4f43fa1793dc9c15d8d8 |
|
MD5 | 68b98f60ea59649b5ceeebd6ecf6a75a |
|
BLAKE2b-256 | 436e134827bd987422d39e3269690a9bc3b5573a81900c931eb47b85bfc116ce |
Hashes for cftime-1.4.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b1c8bb2162ddb0170f58428254c205cf7c5ffbbe37dcbc63a3be9b47cdf1740 |
|
MD5 | adb9d7cf27b0f19fca3b8320acb7e9ac |
|
BLAKE2b-256 | 18b0b1a35bf68db03bd3301e3170ded8b7216bea4b961e18a916c3c2ff592441 |
Hashes for cftime-1.4.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2cc0a60e5b0824ba924459424c145e3d7acde086ab1719002d59a93d731a466 |
|
MD5 | 9bcf4ee599b973ab2b434dd29c34c033 |
|
BLAKE2b-256 | 8d6dbda854a6420ebf4cdc6d7f838466e92f7248d3baffd9e25e61c6f23f81f0 |
Hashes for cftime-1.4.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d49912ac582dfda0528bbd2a12cd7f4d2b2ba440ee1c689b7123220058ef18a |
|
MD5 | 7ed129c050f17605cd25a6bf58af1d41 |
|
BLAKE2b-256 | ca9953efcdb2ba8c1d942713b0d2ad06a2e96bcbd644a79922f716cf336195ea |
Hashes for cftime-1.4.0-cp39-cp39-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f596df90e7ad2c98e896ec8277f421185b6cc1be6874fa2c0464933cda7feeb |
|
MD5 | b73456cf2f6627e039fd7781969447b9 |
|
BLAKE2b-256 | 2917ce2eaa5c4b85e248ca6db81bfb989f698a4685b6f80a828a65035703870e |
Hashes for cftime-1.4.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17a582a4770064b235f8f096d9e531ffc9ce8b1aaeffb27d6b9e833dfe244add |
|
MD5 | b6ce14abbb4f9362ae9f5f0fcb7e853f |
|
BLAKE2b-256 | 05b3527f7b2be8199449027cfae83cc638cd6356293957df2497606e142769a0 |
Hashes for cftime-1.4.0-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3c82190a975f03f4e32e7f9954729f60cebd81f25f429683ae002350c59ce6c |
|
MD5 | 5e13615e33fc5ed996e77465cf4d4d9a |
|
BLAKE2b-256 | 17c0903ed75cd85da7c4c4782802f5006ecf28d9065ce02051955022e17ef1ea |
Hashes for cftime-1.4.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df63e199b6508715a1a5231e343a3d38ce4a4a4fc8985025c6f7ee42ee6cec67 |
|
MD5 | 7fabd20a7585dd35b85ba5a45a96fa26 |
|
BLAKE2b-256 | faae060eb3b55d46eb8ab43d07e6b47247e25bf9cc0fb3a3957be43949d60a3c |
Hashes for cftime-1.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0813353ebdc4447408ad34dc35f6f9d95d950a972a8ccfc89fe2693ada6578c7 |
|
MD5 | 0bef05d8b4f9c12fbebf3cb54a53d297 |
|
BLAKE2b-256 | 7b31b862b9e8b53efa626f0d01666d24dd29c2147c53097a9d61b9666703c73d |
Hashes for cftime-1.4.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da88681749325a7edcbfa290c65aad4fd20345d9bfb061db09df8c5190f3f4a5 |
|
MD5 | 18651f0880c8e93326fa7facb6c0a24a |
|
BLAKE2b-256 | 68b3d3210dfc625cf76792c51cbf7f84ec2767cb646451aad0782dce03544c77 |
Hashes for cftime-1.4.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2af9e6f70043d8fbbf83ca22dd70e573429a9680347cbd63930d724e3e137f8 |
|
MD5 | 8358e5f7c58bf6fa5fa4d474b8e9a752 |
|
BLAKE2b-256 | 479b449f8cd87e43ba60c9e0f6e75fe11805b3b3ff688abeb94d86a785dfa20a |
Hashes for cftime-1.4.0-cp38-cp38-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 293269698ffaead9ed7fa225f50477fc4da2b2271c45ae3da46544be6b53f632 |
|
MD5 | 08d416fea4db4ace471c04ce8dbc8fe3 |
|
BLAKE2b-256 | dbc8d32e716afbb0e5f3ec71f1c5b75097f9607386f4f82066557919bbf5bfdc |
Hashes for cftime-1.4.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e95caed0b57123554491ed44ac7ea77798121455139123cc345307c37a604d |
|
MD5 | 72f8e49c218af94154164023f98faa84 |
|
BLAKE2b-256 | 249fd9bd4e6c41ddb41fce4eb15705456a76dc27817ac34c1a56133995b4fa12 |
Hashes for cftime-1.4.0-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 369a1bd15f198b456ca526afcb108f865feeb6320dcba0cb85d65c974f1dbcc5 |
|
MD5 | a963eaae18e674dc8e1bb003bdf9af4c |
|
BLAKE2b-256 | adf97b27def04b7b060f99fa0f61b6e8e24fb5683acf433dcaa1850ef2b23bab |
Hashes for cftime-1.4.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49e82c192d7728de02c48591d19e18a4335eb54ddbf7135be5333e47bb9249c2 |
|
MD5 | 294ba62500469e3068a8725cfc6ced76 |
|
BLAKE2b-256 | 6a021946cb935aa73bf7e16a204df3aa06b8af693bf3bf9712c5f8bcda0a389f |
Hashes for cftime-1.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeb399305afc5d952335c70d038556297392b45260464dd587634a57ca4f6167 |
|
MD5 | a56bd778dd1c0a97bc128f447a3c9f9a |
|
BLAKE2b-256 | 8519c576065c3092dc4187d07b21aecb39d3ac68e7b64dc3130f0b01017fedff |
Hashes for cftime-1.4.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31248d5770205b174b6847d3ccd28c6d1c2dd2c3e721df2edae009cbcfcb5544 |
|
MD5 | 9c845287c5089c8eaacce6b312887d09 |
|
BLAKE2b-256 | ad69f3cd8ae3d097edf6081f406797683731e9f483393a0591adb61862b7ca0c |
Hashes for cftime-1.4.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 892ac0325788352c1e71a10276929e9ae2ca478fa6cba528d63d61f837edaa5a |
|
MD5 | 683a3a7bf00128574f5f40673c03c1a6 |
|
BLAKE2b-256 | 924de77cd1ad1adc1d620d9be55c229abbdb1621442b29c8f86fbb3675fca028 |
Hashes for cftime-1.4.0-cp37-cp37m-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 037a3d4db1eb329ba23bed9265eed9ab8200d2451c4ef53932c775598d1508fd |
|
MD5 | 9eab40dd808c6385c2cb17113b29c1b8 |
|
BLAKE2b-256 | 57a8aa74bd10a3667b3f7cfa49fcc283cde8a273770f2ac148f7c1e9bb4816f4 |
Hashes for cftime-1.4.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e462fd897ed50f7f49cb3e8373f70cfe90c52d07ffea0099dd07c27f68302d2 |
|
MD5 | d7ef4743bed4cca4a9f06accb4903a02 |
|
BLAKE2b-256 | 12a9620ba950be832cf608e7f3d19534952cde5ed44db1f3a8cc5df7cad48aef |
Hashes for cftime-1.4.0-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba24ff5de612fd5d8dbab1fe9072895aa75ef8b8b3b1684252a93be514291e52 |
|
MD5 | cfb3e7a69b8aefb1c6fae4f330bb7f05 |
|
BLAKE2b-256 | 8da9337b9bb0c18336369d5abf0410fd623dccaf39f0a67d799913a310818c49 |
Hashes for cftime-1.4.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc4e8a7b844d0e21c47e16fb4aa2be241037b9bb87dfe42c25f4e6f4492578a |
|
MD5 | a81fe48c8d47906f8f004a22b7ab0ec3 |
|
BLAKE2b-256 | 3452e114aab98d85334d401707c638860b513f93490e31e52344fcb874752048 |
Hashes for cftime-1.4.0-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 934d78f7d656162cfc4a4ccc61d114d26d2e3f7cb8c5ae120915e639b3b929cb |
|
MD5 | 3d7663aa7d6951c59394ca5e337bcfb2 |
|
BLAKE2b-256 | 40562ca334912a5c734d8dbffec7c5e5d2144722c4e7229eaa170927f7c33ecb |
Hashes for cftime-1.4.0-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f64e68940770e7dd9c4f77658a134dc2af5fd21e3fac16dfa94a16d69e1e8bb |
|
MD5 | 9321bf47fb08716dd4039b34f7c055fc |
|
BLAKE2b-256 | 8d479f5e586e9736f8ac52602c9eac5c8674f37c797ca24aca74c0e5ccb9125e |
Hashes for cftime-1.4.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87a6cdee279a210543f684032b95c5e5c1b8aefc706bfa3f6e8c89711260c905 |
|
MD5 | 49721bdf10ae8d4646102b48104f76b9 |
|
BLAKE2b-256 | 63282f6fa65e29c8cc8766e77f2749a16d83a708a05449284d6bdfa984ac0dd6 |
Hashes for cftime-1.4.0-cp36-cp36m-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f560c7f4076a674e983775a3a2a64cd17118fb22de3079cbd744bb2cbab596eb |
|
MD5 | 5d35d3aa55478f2110cbd400ccf62e39 |
|
BLAKE2b-256 | 7e73b5c1774eb0872f0857f2e371bc0312485e880aa10be18f426b11bc928ba8 |
Hashes for cftime-1.4.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27c864d0cd1d58369d94ff85de9d3ce37563e991f094bced50ea3fe909c19721 |
|
MD5 | 136ce52528045f074765250b4137b75a |
|
BLAKE2b-256 | 94ad54b0e3cccc9f248c1bb96ed4bab6d85f3ce6c45b0ec60a6d61a151fb289b |
Hashes for cftime-1.4.0-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dae1e14f8553d58be28c42c0736b3213db3eeea2015f55162cc145d42fc19bad |
|
MD5 | e946b46a35c44e95ba9ad4582ffc0868 |
|
BLAKE2b-256 | 434f12db7a149532099ba4200f223875467d39ba21fb521b4810b394147a6e24 |
Hashes for cftime-1.4.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c085602607df808a3fa360827bf1e85b435ef70b09655970425fd73fd806e883 |
|
MD5 | 5fe92abc87e08a14f5fbcdb306364ab0 |
|
BLAKE2b-256 | 27d257ae5f9f5bdc2496a9ea3ea6586300c021ebc9eccd1fb4a0455348327366 |