A package for encoding, decoding, and manipulating 20th centure dates with C-level performance.
Project description
DateOnly 20
A Python C extension for encoding, decoding, and manipulating 20th-century dates with high performance. This module provides efficient functions for date encoding into a compact format, decoding back to standard date representations, and performing arithmetic operations like adding years, months, and days.
Features
- Encode Dates: Convert dates into a 16-bit integer representation.
- Decode Dates: Retrieve standard date components from the encoded format.
- Date Arithmetic: Add years, months, and days while handling overflow correctly.
- Date Parsing: Convert dates from the
YYYY-MM-DD
string format into the encoded format. - ISO String Conversion: Easily convert encoded dates back to
YYYY-MM-DD
format.
Installation
To install the module, clone the repository and run the following based on the scenario:
Test and debug
python setup.py build_ext --inplace # Compile C code
python setup.py install # Install the module
Prod usage
pip install setuptools wheel # Install setup tools
pip install dist/*.whl
Usage
Here’s a simple example of how to use the module:
import dateonly_20
# Encode a date
encoded = dateonly_20.encode_date(2023, 11, 3)
# Decode the encoded date
year, month, day = dateonly_20.decode_date(encoded)
# Add 1 year, 2 months, and 15 days to the encoded date
new_date = dateonly_20.add_date(encoded, 1, 2, 15)
# Convert the encoded date to a string in YYYY-MM-DD format
date_str = dateonly_20.date_to_iso_string(encoded)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for dateonly_20-0.1.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99bdc5e12b2956aebcebf7561319a89a199cb69aeb6e61e20966fb0aa4b541e0 |
|
MD5 | 75228aabc4fa372b3041f7067528902e |
|
BLAKE2b-256 | 2edeb8c67887ab8ec91b658bf53134ec613eb780d4137e9a97650319bb8e4b2c |
Close
Hashes for dateonly_20-0.1.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99670b5bfb8ce43a960d2873926b5dadce1c8f4166d58a0eb2e60650e2115690 |
|
MD5 | ac554c677e2cf280a84f76471d6f28e9 |
|
BLAKE2b-256 | 217bf8c7463d1ecbf43f53fdd7a2612c72692688602ea10854c5e1e873a730e1 |
Close
Hashes for dateonly_20-0.1.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d44294b54d6a5a92b69108ea9ceab80ecf01c03defb722ed429e056031112464 |
|
MD5 | d1b45df0cb960b0d78ff80f15c70116e |
|
BLAKE2b-256 | f2a389cad56830c130ab89779e889ba7bbc888950e0574a70a118e720c6835a2 |
Close
Hashes for dateonly_20-0.1.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e7b9eb3c3bf5321d697a70800be00ada2df7f92f22228b1e6f4ea17372e51be |
|
MD5 | c77762a78372d99aaa9ed0d488ad1060 |
|
BLAKE2b-256 | e8279a0b4dc0d41f394de44cf56152fa25eaca0c672ca5082f073a454b946d0f |
Close
Hashes for dateonly_20-0.1.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aa7c37d76ea25b5f62b199dd5b04a3d544a85b3ca0f2c54bce34600e0a4333e |
|
MD5 | 7a95c0944f662b42c27f539550a8f4b2 |
|
BLAKE2b-256 | 45160b64866009515df80cec26ce3995294741a1ccb5c4462ee14cb2a383ec4f |
Close
Hashes for dateonly_20-0.1.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f27831c819efdcb2dd843b7cd9358ef6b774e151191275c37db2b742ff435b2 |
|
MD5 | b0ca9d0570cc305fe61a27638c8f1fac |
|
BLAKE2b-256 | 3a6bec9e90e49160ddb56369ebd089169aef22c44b0cf1c38fa34ef50b440a43 |
Close
Hashes for dateonly_20-0.1.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9beca5625467d5ec75a709ce2c134843afbedd48c7d6fbb2954f253d0e73159c |
|
MD5 | f3a63cc91905306a4739f7ff3ab18533 |
|
BLAKE2b-256 | a485c404f50a97dfbd5b03ac85c4b2929c84467645997625ba5a0b959461abcc |
Close
Hashes for dateonly_20-0.1.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e034eea35d6d1d9ffa34a53808cfd957e73c423e8296ef3613afc928ef7c3ca |
|
MD5 | 95d36127705e38f0ccb2689adfcadcf9 |
|
BLAKE2b-256 | e090e8675e1a693725af2ecb97d564fde8245130d05cf4a911ca2f6cf56cbb74 |
Close
Hashes for dateonly_20-0.1.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 733810269ee79907b7849c6a84336e2ccf34914f38ce688df8ffcb36dade8c9c |
|
MD5 | 9440e454833aff58e9db8327b6f9af58 |
|
BLAKE2b-256 | 3c7b806a5168399c0e395cbe793724ce1c4de17d59b8a1fff3886e8ba910bbd1 |
Close
Hashes for dateonly_20-0.1.1-cp313-cp313-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9c7ec9c422a62549854ccb2066d7e16ddb7db4c6882e62bd90dee9d9e741018 |
|
MD5 | 62fe24c7f827b78152524557a978d954 |
|
BLAKE2b-256 | 6a7012d114ec64f75871c621c8d331466551447f88b4025907b3104f2cf74a3c |
Close
Hashes for dateonly_20-0.1.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84441ccf1a663c55caba2bc9bf481ce8712e31c2a7509ef628974271e3147fa2 |
|
MD5 | 40e0f4d9b9dc40d859c61cd7be718ac8 |
|
BLAKE2b-256 | 2c54cac4cc317d40e9c0824440ebdfe9a62b87abe02448a20337265df84308a8 |
Close
Hashes for dateonly_20-0.1.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1881c39acd42c909f741c3e340a68a67ef608990c00e4686a7b4d5b2c0d24af |
|
MD5 | fc9d1a11cb700ac64585874f02dd518c |
|
BLAKE2b-256 | 9a5309eab3eb38911166cff769a6a9d41e584c8d39ed52e90d5ffe6208f4de70 |
Close
Hashes for dateonly_20-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab654a1376946b2e862ffb579f0a64167c36931f677749d7edfc73f7740370a4 |
|
MD5 | faf1e8c7432089a53625796adfb11d12 |
|
BLAKE2b-256 | 80bd36b49efd19753444d131fb08d70112202341c63081dac42377c79485d8c6 |
Close
Hashes for dateonly_20-0.1.1-cp312-cp312-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e9752a1786c3231591c424b487b485cccab226cb1eafb7f9e60c2193f683e7d |
|
MD5 | 21e642eca36410d2c9f494f63f6d9b47 |
|
BLAKE2b-256 | f61b00c420b4d5022e8f004a76ed6852af7caca6ce01ba258886ff3cc66f7156 |
Close
Hashes for dateonly_20-0.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9949895d45cbdeb4d14467a9d2be0ccfd5b436f6fef1fe4a190cdcaac86dc23 |
|
MD5 | 4c65680b7fc0b5e41561541372aed65c |
|
BLAKE2b-256 | d6eb99c169c546f1bbac2bbd001d86ebe6aa902b6cca6ae0ef317a777269c98e |
Close
Hashes for dateonly_20-0.1.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4b573839c6bde7fad8172e17aecaf0c7f08c31fc649cc2657a5d143e21755b9 |
|
MD5 | 3c8f37fa35569ff9dcfaab4f2d2785c1 |
|
BLAKE2b-256 | ef2dd3929cd3df15a79a6750f56121a4ed044d938d3bccb6cfed871c28483c15 |
Close
Hashes for dateonly_20-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efe854a35fbd9617796f006f07df1e9de8b7d61ca69797cca42ca8652c84e9d7 |
|
MD5 | 44b6078e79959dc3d38803a017df453e |
|
BLAKE2b-256 | a0b54bbed4ffb56e9102be63d3fec9b4de2e23b399cea0ed0c08d7f23682a4a2 |
Close
Hashes for dateonly_20-0.1.1-cp311-cp311-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88422c96f70e0e2582d72996cba73e9199ff9856461b18945c2cb13a696336ee |
|
MD5 | e5df1d70a5d5f8ced3bf96db14ab69aa |
|
BLAKE2b-256 | a989f4ee50197f7465140a8fd5cd95823add3b53c51ca29381805f6e59681319 |
Close
Hashes for dateonly_20-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bea47f6de4b3f0b30e8ec5fe3efd4f1b0ca5f283e17ace692ed2a6cb6008a16e |
|
MD5 | 4b253ef424ea40c7e921d56e02aa759e |
|
BLAKE2b-256 | 1a651f355408253aeac6493bdb22b7978f629b12ffec7f7500d707f6a789a6b4 |
Close
Hashes for dateonly_20-0.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a7e283f160d5a0f06837e5195217a78dcbdda0c20e6012c0358e1c5f5c0ac9b |
|
MD5 | 29ca830d0c05494f799eb0c72ff7c5df |
|
BLAKE2b-256 | 0cc062cf58da8553e5c8f94ec56cf7c17c8a7066ff16b7e17e55b68cff453a6b |
Close
Hashes for dateonly_20-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98ad7e46596a50308ee4ce1d8fa069ce3a6e35922807d0db4be8b76e96df8a36 |
|
MD5 | a953a77b03fee378ee8c01a9ab197dcc |
|
BLAKE2b-256 | 7a33f861d9c627dc44cd8e2a3e77edd3cb1bbbe9c0462b3bd9ca6510abb69ca2 |
Close
Hashes for dateonly_20-0.1.1-cp310-cp310-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14faa18ba5ade849b341628841f7a969bc46c953a9bee5f6299f8f070c29594e |
|
MD5 | ab475183a33830082637a55365d3bb37 |
|
BLAKE2b-256 | c27d7b9dac4343ad3ebb25d9d273b39f4f5f34328ee3281f3176c29c33d74919 |
Close
Hashes for dateonly_20-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7846382b3bdf8904bc78fb69ab71596e9d8e56cf7052140402375093169e592 |
|
MD5 | 0ecdec41aece443392278a3dddfdc67c |
|
BLAKE2b-256 | 8c1964f8a6c1203eb6b95e93e4c78914ca222215b3fe562669d65e1962e7f84c |
Close
Hashes for dateonly_20-0.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45af38cef7c64511295729318f1078871797e6f28c7d2a6b9bd019b4aff72010 |
|
MD5 | b229fade3c6eb9e5c66e72cf0eaeaca5 |
|
BLAKE2b-256 | 972e76d70ce5b1e163433cfb42d98cee3a03b14d500ff0a94aaa20099c2c9ab6 |
Close
Hashes for dateonly_20-0.1.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e9dc45ccc6259f1093ea2d15d070ab7488c1db31f5645de3b55895effd08a1d |
|
MD5 | f6c9572b1bf91216d604b453fccb4813 |
|
BLAKE2b-256 | 174443c50f93b12133e436f92789a670891f06e8aa942e759e7904b0f8716be3 |
Close
Hashes for dateonly_20-0.1.1-cp39-cp39-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f132156c93677f5e46f23dbe208293bc5f22bfa5e39925ef42580725178c5b82 |
|
MD5 | d42182b859c8c9d7a505144112b18cf1 |
|
BLAKE2b-256 | 984e27e55f66b6fb288fd31bf71a7156a6b7494b0fec6f56fe5cab42fd28d20e |
Close
Hashes for dateonly_20-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe104811837d5f75b7ced1629a503c28c45827330d406f270b5f97880c323c9d |
|
MD5 | e7a6315b3e05d2777e2923889ae875ee |
|
BLAKE2b-256 | 8f87314f4fc877e0ac33c315d3b13230f96abef70007ed8d6d82068812b122d2 |
Close
Hashes for dateonly_20-0.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce62886af92b3639bcb5504febba6aa9885496d0c12f6db05d81d13e07066f2f |
|
MD5 | 3db0831011e4bdf58ec7206511209122 |
|
BLAKE2b-256 | 5e33c29b055b8a1ed2fdc90bc3cf34f550047ad4ee5bd15bf253d7058689b7ac |
Close
Hashes for dateonly_20-0.1.1-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c50e3ca465533b424d21ee1bbac82d21e9ee2ffd46f497ef2c07dd3ae208566 |
|
MD5 | 0905302689ee59e6041d77bb8da672d4 |
|
BLAKE2b-256 | 36a68cb7ab3c090a09ac80c4bf63cfe360790d9666ad228a518a69fd696c282d |
Close
Hashes for dateonly_20-0.1.1-cp38-cp38-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b4ad44defba777310e1db606970ec851e54eb119e12e99cb37183ce823307f4 |
|
MD5 | 7ac930dc72e911e71da342527599c751 |
|
BLAKE2b-256 | 54ff4391e0b512f1da0ce9d2b171e2f16c77ba150443d176b416f0dc403aac60 |
Close
Hashes for dateonly_20-0.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d83c4d6d9161aeb3dc67400690b495b997bb7392550f9a134ae6ee5d2a5fa324 |
|
MD5 | 4dc236381d7bbd8729225b49075dbc0a |
|
BLAKE2b-256 | 994fe72e8bab882cb6f0204dcee07e11c1e7ec960157d925b5a3d6e935283309 |
Close
Hashes for dateonly_20-0.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afd177cb79a3aac016f24a1850c86505627de950da73ba626248e31ac5c07776 |
|
MD5 | abe429cdd8555b188cc133ef3ee27553 |
|
BLAKE2b-256 | 32fa916bae808e9f7d5b09265c7fc01064eda124bf0db004d084fb988e4f62ce |
Close
Hashes for dateonly_20-0.1.1-cp37-cp37m-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee3b1492972aac62c8cb481f492e07e364768b0c2e164b7b47c5fac7f31d22f7 |
|
MD5 | c8f402a6779b40ee003114aa50e8d1fe |
|
BLAKE2b-256 | 67dd404b8d853bc7835938a00bcfa7adfce0f1aff35673ee47358f6ed9225459 |
Close
Hashes for dateonly_20-0.1.1-cp37-cp37m-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad231b15193f75d0f017edc1e2d03575d6ac47f945cfbc53263662ba1e32c544 |
|
MD5 | f733cf2eed5dd754945ca2cf1e4814f8 |
|
BLAKE2b-256 | 86d43b06dcc61b25a177ad2e4330c07a5dbaafb49b4d4a26884b38df14df6185 |
Close
Hashes for dateonly_20-0.1.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae82862c19e2df77e09ad7104a6e61638c5f59b52486ad3f2117cb7ee7abbf7b |
|
MD5 | 7097b1c3aeb136072627cc755ae73557 |
|
BLAKE2b-256 | 5d58f2b93898990ef2b31bf78b9ae15f18cee4e4e22b2c7b649aece5bc658c05 |
Close
Hashes for dateonly_20-0.1.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c654bb6d935282019ad5e244c599dbb416c621eda06a19804c9091842f512707 |
|
MD5 | c46db7b9f9bb174b41ad53c8d7ec19f7 |
|
BLAKE2b-256 | 903b1ad67e231895df1cdee7671061d621c1a689ea252f306fc9e97803a5ade7 |
Close
Hashes for dateonly_20-0.1.1-cp36-cp36m-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21925aaa33f132546998d0397bf092ae9f841c05705894d0ce785070856b7d62 |
|
MD5 | 470dd019241d4f9bc0737f9f2798b5ca |
|
BLAKE2b-256 | be3b6361da07188765d87bb893ddadfe2902a06945db22c264779f1c8543cbd3 |
Close
Hashes for dateonly_20-0.1.1-cp36-cp36m-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17c2d24a9a8287c8b4d1a1434b0377668b56f4b2501d79477313579791cb28fa |
|
MD5 | b05931375693b8560d5cc85dd03b424b |
|
BLAKE2b-256 | 2ad9e92ed3f549e5eba214a8ef39b915792e30f4cbdfa8f3c7a5d75868536b0f |
Close
Hashes for dateonly_20-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25cd80e0891678027f269351801f93dabd7685f36e606bcaf28ad8e97d234175 |
|
MD5 | b4657968c0e6bcf93efb2a26a294721a |
|
BLAKE2b-256 | 1549c10630cc18709aad36fa64eea948de7b4f5af528a8b3bb88624fb685aa66 |
Close
Hashes for dateonly_20-0.1.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1dfc82215246834a6005d7fd2f6ddf23806d67068aa83a747d0c73743d11823 |
|
MD5 | 54ca3f1f504af82d5ea022e2e474c885 |
|
BLAKE2b-256 | 44b768d3febbeea21eac241330089c0fbc24860e186ea823779c1fdb32240ca7 |