Skip to content

Commit 75e641c

Browse files
committed
Add installation instructions and fix century dates
1 parent e664a81 commit 75e641c

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ portions of EDTF (Extended Date Time Format), and parsing and conversion for dat
2525

2626
Read [Contributors](CONTRIBUTORS.md) for detailed contribution information.
2727

28+
## Installation
29+
30+
*Recommended*: use pip to install the latest published version from PyPI:
31+
32+
```console
33+
pip install undate
34+
```
35+
36+
To install a development version or specific tag or branch, you can install from GitHub.
37+
Use the `@name` notation to specify the branch or tag; e.g., to install development version:
38+
39+
```console
40+
pip install git+https://github.com/dh-tech/undate-python@develop#egg=undate
41+
```
42+
2843
## Example Usage
2944

3045
Often humanities and cultural data include imprecise or uncertain temporal information. We want to store that information but also work with it in a structured way, not just treat it as text for display. Different projects may need to work with or convert between different date formats or even different calendars.
@@ -123,12 +138,12 @@ An `UndateInterval` is a date range between two `Undate` objects. Intervals can
123138
>>> from undate.undate import UndateInterval
124139
>>> UndateInterval(Undate(1900), Undate(2000))
125140
<UndateInterval 1900/2000>
126-
>>> UndateInterval(Undate(1900), Undate(2000), label="19th century")
127-
>>> UndateInterval(Undate(1900), Undate(2000), label="19th century").duration().days
128-
36890
129-
<UndateInterval '19th century' (1900/2000)>
130-
>>> UndateInterval(Undate(1900), Undate(2000), label="20th century")
131-
<UndateInterval '20th century' (1900/2000)>
141+
>>> UndateInterval(Undate(1801), Undate(1900), label="19th century")
142+
>>> UndateInterval(Undate(1801), Undate(1900), label="19th century").duration().days
143+
36524
144+
<UndateInterval '19th century' (1801/19000)>
145+
>>> UndateInterval(Undate(1901), Undate(2000), label="20th century")
146+
<UndateInterval '20th century' (1901/2000)>
132147
>>> UndateInterval(latest=Undate(2000)) # before 2000
133148
<UndateInterval ../2000>
134149
>>> UndateInterval(Undate(1900)) # after 1900

0 commit comments

Comments
 (0)