RSC On This Day in Chemistry¶
Displays Royal Society of Chemistry “On This Day” facts.
Installation¶
python3 -m pip install rsc_on_this_day --user
python3 -m pip install git+https://github.com/domdfcoding/rsc-on-this-day@master --user
Once installed, rsc_on_this_day
can be run by typing:
rsc_on_this_day
If rsc_on_this_day
is not installed in a directory in $PATH
, you may need to add ~/.local/bin/
to your $PATH
.
Contents¶
Usage¶
rsc-on-this-day¶
Display the Royal Society of Chemistry “On This Day In Chemistry” fact for the given day.
If no date is given the current date is used.
rsc-on-this-day [OPTIONS] [MONTH] [DAY]
Options
-
--version
¶
Show the version and exit.
-
--clear-cache
¶
Clear any cached data and exit.
-
-w
,
--width
<width>
¶ The number of characters per line of the output. Set to -1 to disable wrapping.
- Default
80
Arguments
-
MONTH
¶
Optional argument. Default
None
-
DAY
¶
Optional argument. Default
None
Examples¶
rsc_on_this_day
Display the “On This Day In Chemistry” fact for today.
rsc_on_this_day Apr 1
Display the “On This Day In Chemistry” fact for April 1st.
rsc_on_this_day 12 25
Display the “On This Day In Chemistry” fact for 25 December.
rsc_on_this_day --clear-cache
Clear any cached data.
rsc_on_this_day October 13 --width 80
Display the “On This Day In Chemistry” fact for October 13th, with at most 80 characters per line.
Adding to ~/.bashrc
¶
rsc-on-this-day
can be run every time you open a terminal by adding rsc-on-this-day
to your ~/.bashrc
file.
For example:
echo "rsc-on-this-day" >> ~/.bashrc
API Reference¶
Displays Royal Society of Chemistry “On This Day In Chemistry” facts in your terminal.
Functions:
Clear any cached responses. |
|
|
Returns the fact for the given date. |
Contributing¶
rsc_on_this_day
uses tox to automate testing and packaging,
and pre-commit to maintain code quality.
Install pre-commit
with pip
and install the git hook:
python -m pip install pre-commit
pre-commit install
Coding style¶
formate is used for code formatting.
It can be run manually via pre-commit
:
pre-commit run formate -a
Or, to run the complete autoformatting suite:
pre-commit run -a
Automated tests¶
Tests are run with tox
and pytest
.
To run tests for a specific Python version, such as Python 3.6:
tox -e py36
To run tests for all Python versions, simply run:
tox
Build documentation locally¶
The documentation is powered by Sphinx. A local copy of the documentation can be built with tox
:
tox -e docs
Downloading source code¶
The rsc_on_this_day
source code is available on GitHub,
and can be accessed from the following URL: https://github.com/domdfcoding/rsc-on-this-day
If you have git
installed, you can clone the repository with the following command:
git clone https://github.com/domdfcoding/rsc-on-this-day
Cloning into 'rsc-on-this-day'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 173 (delta 16), reused 17 (delta 6), pack-reused 126
Receiving objects: 100% (173/173), 126.56 KiB | 678.00 KiB/s, done.
Resolving deltas: 100% (66/66), done.

Downloading a ‘zip’ file of the source code¶
Building from source¶
The recommended way to build rsc_on_this_day
is to use tox:
tox -e build
The source and wheel distributions will be in the directory dist
.
If you wish, you may also use pep517.build or another PEP 517-compatible build tool.
View the Function Index or browse the Source Code.