Skip to content

Commit a0b7d8c

Browse files
github-actions[bot]Synaptics GitLab CI
andauthored
Documentation version 0.5.0 (#6)
Co-authored-by: Synaptics GitLab CI <[email protected]>
1 parent 8e8cf5e commit a0b7d8c

15 files changed

+826
-65
lines changed

docs/library/binascii.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ encodings of it in ASCII form (in both directions).
1616

1717
Functions
1818
---------
19+
.. function:: hexlify(data, [sep])
20+
21+
Convert the bytes in the *data* object to a hexadecimal representation.
22+
Returns a bytes object.
23+
24+
If the additional argument *sep* is supplied it is used as a separator
25+
between hexadecimal values.
26+
27+
.. function:: unhexlify(data)
28+
29+
Convert hexadecimal data to binary representation. Returns bytes string.
30+
(i.e. inverse of hexlify)
1931

2032
.. function:: a2b_base64(data)
2133

docs/library/datetime.date.rst

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.. currentmodule:: datetime
2+
.. _datetime.date:
3+
4+
class date -- Represent a date
5+
===============================
6+
7+
:py:class:`~datetime.date` objects support equality and comparison operators.
8+
9+
.. class:: date(year, month, day)
10+
11+
All arguments are required. Arguments must be integers, in the following ranges:
12+
13+
- :py:class:`~datetime.MINYEAR` <= year <= :py:class:`~datetime.MAXYEAR`
14+
- 1 <= month <= 12
15+
- 1 <= day <= number of days in the given month and year
16+
17+
Other constructors:
18+
19+
.. classmethod:: today()
20+
21+
.. classmethod:: fromtimestamp(timestamp)
22+
23+
.. classmethod:: fromordinal(ordinal)
24+
25+
.. classmethod:: fromisoformate(date_string)
26+
27+
Class attributes:
28+
29+
.. attribute:: min
30+
31+
The earliest representable date, date(:py:attr:`~datetime.MINYEAR`, 1, 1).
32+
33+
.. attribute:: max
34+
35+
The latest representable date, date(:py:attr:`~datetime.MAXYEAR`, 12, 31).
36+
37+
.. attribute:: resolution
38+
39+
The smallest possible difference between non-equal date objects, ``timedelta(days=1)`` .
40+
41+
Instance attributes:
42+
43+
.. attribute:: year
44+
45+
.. attribute:: month
46+
47+
.. attribute:: day
48+
49+
Instance methods
50+
51+
.. method:: replace(year = self.year, month = self.month, day = self.day)
52+
53+
Return a new :py:class:`~datetime.date` object with the same values but the specified parameters updated.
54+
55+
.. method:: tuple()
56+
57+
Return the date as a tuple (year, month, day)
58+
59+
.. method:: timetuple()
60+
61+
Return the date as a 9-tuple
62+
63+
.. method:: toordinal()
64+
65+
Return an integer representing the ordinal of the date, where January 1st of year 1 has ordinal 1.
66+
67+
.. method:: isoformat()
68+
69+
Return a string representing the date in ISO 8601 format, YYYY-MM-DD::
70+
71+
from datetime import date
72+
date(2002, 12, 4).isoformat()
73+
# outputs '2002-12-04'
74+
75+
.. method:: isoweekday()
76+
77+
Return the day of the week as an integer, where Monday is 1 and Sunday is 7.
78+
79+
.. method:: weekday()
80+
81+
Return the day of the week as an integer, where Monday is 0 and Sunday is 6.

docs/library/datetime.datetime.rst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
.. currentmodule:: datetime
2+
.. _datetime.datetime:
3+
4+
class datetime -- Information about a date and time
5+
===================================================
6+
7+
.. class:: datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
8+
9+
A datetime object is a single object containing all the information from a
10+
:py:class:`~datetime.date` object and a :py:class:`~datetime.time` object.
11+
12+
Other constructors:
13+
14+
.. classmethod:: fromisoformat
15+
.. classmethod:: fromordinal
16+
.. classmethod:: fromtimestamp
17+
.. classmethod:: now
18+
19+
NOT IMPLEMENTED
20+
21+
.. classmethod:: combine
22+
23+
.. classmethod:: strptime
24+
25+
*NOT IMPLEMENTED*
26+
27+
Class attributes:
28+
29+
.. attribute:: EPOCH
30+
31+
A :py:class:`~datetime.datetime` object representing the epoch.
32+
33+
Instance attributes:
34+
35+
.. attribute:: year
36+
.. attribute:: month
37+
.. attribute:: day
38+
.. attribute:: hour
39+
.. attribute:: minute
40+
.. attribute:: second
41+
.. attribute:: microsecond
42+
.. attribute:: tzinfo
43+
.. attribute:: fold
44+
45+
Instance methods:
46+
47+
.. method:: replace
48+
.. method:: tuple
49+
.. method:: time
50+
.. method:: astimezone
51+
.. method:: date
52+
.. method:: dst
53+
.. method:: isoformat
54+
55+
.. method:: isoweekday()
56+
57+
Return the day of the week as an integer, where Monday is 1 and Sunday is 7.
58+
59+
.. method:: weekday()
60+
61+
Return the day of the week as an integer, where Monday is 0 and Sunday is 6.
62+
63+
.. method:: timetuple()
64+
.. method:: timetz()
65+
.. method:: toordinal()
66+
.. method:: tzname()
67+
.. method:: utcoffset()

docs/library/datetime.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
:mod:`datetime` -- time manipulation functionality
3+
==================================================
4+
5+
This module is a partial implementation of `datetime
6+
<https://docs.python.org/3/library/datetime.html>`_ from standard CPython
7+
8+
.. module:: datetime
9+
:synopsis: time manipulation functionality
10+
11+
12+
Constants
13+
---------
14+
15+
.. data:: datetime.MAXYEAR
16+
.. data:: datetime.MINYEAR
17+
18+
Classes
19+
-------
20+
.. toctree::
21+
:maxdepth: 1
22+
23+
datetime.date.rst
24+
datetime.datetime.rst
25+
datetime.time.rst
26+
datetime.timedelta.rst
27+
datetime.timezone.rst
28+
datetime.tzinfo.rst

docs/library/datetime.time.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. currentmodule:: datetime
2+
.. _datetime.time:
3+
4+
class time -- Idealised time
5+
============================
6+
7+
An idealized time, independent of any particular day, assuming that every day
8+
has exactly 24*60*60 seconds. (There is no notion of “leap seconds” here).
9+
10+
:py:class:`~datetime.time` objects support equality and comparison operators.
11+
12+
.. class:: time(hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
13+
14+
Create a time object. All paramteters are optional.
15+
16+
- *hour*, *minute*, *second*, *microsecond*, integers.
17+
- *tzinfo* an object of the :py:class`datetime.tzinfo` class. May be `None`.
18+
- *fold* In [0, 1]. Used to disambiguate wall times during a repeated
19+
interval. (A repeated interval occurs when clocks are rolled back at the end
20+
of daylight saving time or when the UTC offset for the current zone is
21+
decreased for political reasons.) The values 0 and 1 represent,
22+
respectively, the earlier and later of the two moments with the same wall
23+
time representation.
24+
25+
Other constructors:
26+
27+
.. classmethod:: fromisoformat(time_string)
28+
29+
Construct a :py:class:`~datetime.time` object from an ISO 8601 string::
30+
31+
from datetime import time
32+
t = time.fromisoformat('04:23:01.000384')
33+
34+
Class attributes
35+
.. attribute:: min
36+
37+
.. attribute:: max
38+
39+
.. attribute:: resolution
40+
41+
Instance attributes:
42+
43+
.. attribute:: hour
44+
.. attribute:: minute
45+
.. attribute:: second
46+
.. attribute:: microsecond
47+
.. attribute:: tzinfo
48+
.. attribute:: fold
49+
50+
Instance methods:
51+
52+
.. method:: replace(hour=self.hour, minute=self.minute, second=self.second, microsecond=self.microsecond, tzinfo=self.tzinfo, *, fold=0)
53+
54+
Return a new :py:class:`~datetime.time` objects with the specified parameters updated.
55+
56+
.. method:: isoformat()
57+
58+
.. method:: strftime()
59+
60+
NOT IMPLEMENTED: use :py:meth:`time.strftime`
61+
62+
.. method:: tuple()
63+
.. method:: dst()
64+
.. method:: tzname()
65+
.. method:: utcoffset()
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.. currentmodule:: datetime
2+
.. _datetime.timedelta:
3+
4+
class timedelta -- Represents a duration
5+
========================================
6+
7+
A timedelta object represents a duration, or the difference between two :py:class:`~datetime.datetime` or :py:class:`~datetime.date` instances.
8+
9+
.. class:: timedelta(...)
10+
11+
.. attribute:: days
12+
13+
.. attribute:: isoformat
14+
15+
.. attribute:: max
16+
17+
.. attribute:: min
18+
19+
.. attribute:: microseconds
20+
21+
.. attribute:: resolution
22+
23+
.. attribute:: seconds
24+
25+
.. attribute:: total_seconds

docs/library/datetime.timezone.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. currentmodule:: timezone
2+
.. _datetime.timezone:
3+
4+
class timezone -- Represents a time zone
5+
========================================
6+
7+
The timezone class is a subclass of :py:class:`~datetime.tzinfo`, each instance
8+
of which represents a time zone defined by a fixed offset from UTC.
9+
10+
.. class:: timezone(offset, name=None)
11+
12+
.. method:: dst
13+
.. method:: fromutc
14+
.. method:: isoformat
15+
.. method:: tzname
16+
.. method:: utc
17+
.. method:: utcoffset

docs/library/datetime.tzinfo.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
.. currentmodule:: datetime
3+
.. _datetime.tzinfo:
4+
5+
class tzinfo -- Timezone information
6+
====================================
7+
8+
An abstract base class for time zone information objects. These are used by the
9+
datetime and time classes to provide a customizable notion of time adjustment
10+
(for example, to account for time zone and/or daylight saving time).
11+
12+
.. class:: tzinfo()
13+
14+
.. method:: dst()
15+
16+
Return the daylight saving time (DST) adjustment, as a `timedelta` object or
17+
None if DST information isn’t known.
18+
19+
.. method:: fromutc()
20+
21+
.. method:: isoformat()
22+
23+
.. method:: tzname()
24+
25+
.. method:: utcoffset()

0 commit comments

Comments
 (0)