Bases: datetime.tzinfo
Fixed offset in minutes east from UTC.
Bases: datetime.tzinfo
A ‘local’ time zone implementation
Convenience method for formatting the date part of a datetime object. See format_datetime for more details.
Format the datetime object t into an unicode string
If t is None, the current time will be used.
The formatting will be done using the given format, which consist of conventional strftime keys. In addition the format can be ‘iso8601’ to specify the international date format.
tzinfo will default to the local timezone if left to None.
Convenience method for formatting the time part of a datetime object. See format_datetime for more details.
Present the default format used by format_date in a human readable form. This is a format that will be recognized by parse_date when reading a date.
Present the default format used by format_datetime in a human readable form. This is a format that will be recognized by parse_date when reading a date.
Calculate time delta between two datetime objects. (the result is somewhat imprecise, only use for prettyprinting).
If either time1 or time2 is None, the current time will be used instead.
Convert t into a datetime object, using the following rules:
- If t is already a datetime object, it is simply returned.
- If t is None, the current time will be used.
- If t is a number, it is interpreted as a timestamp.
If no tzinfo is given, the local timezone will be used.
Any other input will trigger a TypeError.
PyNarcissus
A lexical scanner and parser. JS implemented in JS, ported to Python.
Parse some Javascript
source: the Javascript source, as a string filename: the filename to include in messages starting_line_number: the line number of the first line of the
passed in source, for output messages
Maps all attributes in the source object to attributes in destination object.
if attributes in the destination object do not exit they will be created.
This comes in handy in mapping comming in ‘commands’ to data model objects.
>>> class A():
... def __init__(self):
... self.a = "this is cool"
...
>>> class B():
... pass
...
>>> a = A()
>>> object_mapper(a, B()).a
'this is cool'