MOTD
Retrieve famous 'Mathematicians Of The Day' from http://mathshistory.st-andrews.ac.uk/Day_files/Year.html
Disclaimer: This package is not supported by the University of St-Andrews. This is not an official package!
Output's format is JSON.
0.2
Modify to English words command and method names
Usage as a library
Minimal example
>>> import motd
>>> motd.motd()
<motd.motd.motd object at 0x7fd2675eb550>
>>> motd.motd().out()
'{"30/12": [{"year": 1869, "fname": "Emilie", "name": "MARTIN", "event": "birth"}, {"year": 1897, "fname": "Stanis\\u0142aw", "name": "SAKS", "event": "birth"}, {"year": 1691, "fname": "Robert", "name": "BOYLE", "event": "death"}, {"year": 1932, "fname": "Eliakim", "name": "MOORE", "event": "death"}, {"year": 1947, "fname": "Alfred North", "name": "WHITEHEAD", "event": "death"}, {"year": 1956, "fname": "Heinrich", "name": "SCHOLZ", "event": "death"}, {"year": 1978, "fname": "Mark Aronovich", "name": "NAIMARK", "event": "death"}, {"year": 1982, "fname": "Philip", "name": "HALL", "event": "death"}]}'
>>>
Options
The constructor admits two optional arguments:
dayspecifying date using a string formated asDD/MM(default is the current system day)deltaspecifying the number of days before (negative integer) or after (positivie integer)dayvalue. (default is 0)
>>> import motd
>>> motd.motd('01/01').out()
'{"01/01": [{"year": 1803, "fname": "Guglielmo", "name": "LIBRI", "event": "birth"}, ...
>>> import motd
>>> motd.motd(delta=1).out()
'{"31/12": [{"year": 1856, "fname": "William", "name": "THOMSON", "event": "birth"}, ...
>>> import motd
>>> motd.motd('01/01', delta=-2).out()
'{"30/12": [{"year": 1869, "fname": "Emilie", "name": "MARTIN", "event": "birth"}, ...
>>> import motd
>>> motd.motd(day='01/01', delta=-2).out()
'{"30/12": [{"year": 1869, "fname": "Emilie", "name": "MARTIN", "event": "birth"}, ...
Usage in standalone app (code below)
How-to use it
-
Copy next code content in a
motdfile. -
Change eventually the shebang line and make the file executable
chmod 755 motd -
Move it in a path known by your shell. For example:
~/.local/bin -
Session example
$ motd
1869 birth Emilie MARTIN
1897 birth Stanisław SAKS
1691 death Robert BOYLE
1932 death Eliakim MOORE
1947 death Alfred North WHITEHEAD
1956 death Heinrich SCHOLZ
1978 death Mark Aronovich NAIMARK
1982 death Philip HALL
$ motd -d 01/01
1803 birth Guglielmo LIBRI
1878 birth Agner ERLANG
1886 birth Alexander Barrie GRIEVE
1894 birth Satyendranath BOSE
1905 birth Stanisław MAZUR
1912 birth Boris Vladimirovich GNEDENKO
1923 birth Daniel GORENSTEIN
1924 birth Jacques DIXMIER
1931 birth Sergei Ivanovich ADIAN
1748 death Johann BERNOULLI
1787 death Anastácio da CUNHA
...
$ motd -d 01/01 -1
1856 birth William THOMSON
1872 birth Volodymyr LEVYTSKY
1896 birth Carl SIEGEL
1916 birth Douglas NORTHCOTT
1937 birth Vladimir MAZ'YA
1945 birth Leonard ADLEMAN
1952 birth Vaughan JONES
1610 death Ludolph Van CEULEN
1659 death János APÁCZAI
1679 death Giovanni Alfonso BORELLI
1719 death John FLAMSTEED
1894 death Thomas STIELTJES
1912 death Robert FERGUSON
1944 death Nikolai Evgrafovich KOCHIN
1956 death Edwin P ADAMS
1962 death Charles Galton DARWIN
1982 death Kurt FRIEDRICHS
Further you can pipe with sort command.
You can also change source code of the app to output different lines.
Standalone app code
#!/usr/bin/python3
__author__ = "David COBAC"
__date__ = 20191230
import motd
import json
import argparse
parseur_args = argparse.ArgumentParser(
description="""Mathematicians Of The Day from website
http://mathshistory.st-andrews.ac.uk/Day_files/Year.html
not an official package""")
parseur_args.add_argument('-d', '--day', help='DD/MM')
parseur_args.add_argument('delta',
nargs='?',
default='+0')
args = parseur_args.parse_args()
m = motd.motd(args.day, args.delta)
dico = json.loads(m.sortie())
for k in dico:
# print(k)
for entree in dico[k]:
s = str(entree['year'])
s += " "
s += entree['event']
s += " "
s += entree['fname']
s += " "
s += entree['name']
#
print(s)
about
motd is rather an attempt to publish on the PyPi packages
index than a fully completed python project, I do not recommend
to use it for professionnal purpose. You have to consider this
package as an experiment.
Metadata
Release files for motd 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| motd-0.3.0.tar.gz | 84.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| motd-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 89.3 kB
Release files / motd-0.3.0.tar.gz
| Download URL | motd-0.3.0.tar.gz |
|---|---|
| Size | 84.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ec56bd4b50317bae25d66c83da65365e279ee6f55322ac2e5d8b337f734fefc
|
|
BLAKE2b-256 checksum How to use checksums |
b535e9b21cf550a84f69f9c30a40af1be5d93589722315d9ba89dbee73d613ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / motd-0.3.0-py3-none-any.whl
| Download URL | motd-0.3.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
478f15087fba6df3949a34fffe0570059a16cdadb446ce11d2253a7df96cc4f8
|
|
BLAKE2b-256 checksum How to use checksums |
963c815eb47d9b49bf73eabdde9dc945a1da3136fc6666a36e0ba0b7cfeaa3b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for motd 0.3.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.