Skip to main content

Django Human DateTime Parsing

Authors:

Justin Quick <justquick@gmail.com>

Version:

0.1

This tool uses the parsedatetime package to turn human readable form input (like ‘tomorrow 7PM’) into datetime objects (like datetime.datetime(2010, 4, 9, 19, …)). This app requires parsedatetime and pytz. The app comes with a set of fields to replace Django’s own DateTimeField, DateField, and TimeField. Get them by using:

from humandt.fields import HumanDateTimeField, HumanTimeField, HumanDateField

Then use them however you like as form fields in your own Django Forms:

from django.forms import Form

class ExampleForm(Form):
    datetime = HumanDateTimeField(required=False)
    time = HumanTimeField(required=False)
    date = HumanDateField(required=False)

Example Project

Download the most recent sourcecode and start up the development server. Make sure you have the most recent version of django:

git clone git://github.com/justquick/django-human-datetime.git
cd django-human-datetime
pip install parsedatetime pytz django
python setup.py install
cd example_project
python manage.py runserver

If all goes well it will be available at http://127.0.0.1:8000/. There is an example form up there that just spits out the parsed date/time input. Look at the example_project.views for useage example. To test the humandt app, stop the server and run this:

python manage.py test humandt

Metadata

Release files for django-human-datetime 0.1

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

Source distribution (sdist)

Source distribution for django-human-datetime 0.1
File Size Uploaded Provenance
django-human-datetime-0.1.tar.gz 3.2 kB Without provenance Details

Release files / django-human-datetime-0.1.tar.gz

Download URL django-human-datetime-0.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
31f4c68ff40f46585c8ae510867f2561f691dd279fc77b2076974ddf6b94b628
BLAKE2b-256 checksum
How to use checksums
27667d28dce5f117e9e4c553b9b925775cbf359354472f2887d9e32b08f8ff63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-human-datetime 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

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