Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new arguments #79

Merged
merged 2 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 36 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,35 +76,42 @@ To get an overview of all available commands, type:
<br>

```raw
%watermark [-a AUTHOR] [-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME]
[-v] [-p PACKAGES] [-h] [-m] [-g] [-w]
%watermark [-a AUTHOR] [-gu GITHUB_USERNAME] [-e EMAIL] [-ws WEBSITE]
[-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME] [-v]
[-p PACKAGES] [-h] [-m] [-g] [-r] [-b] [-w] [-iv]

IPython magic function to print date/time stamps
and various system information.

optional arguments:
-a AUTHOR, --author AUTHOR
prints author name
-d, --date prints current date as YYYY-mm-dd
-n, --datename prints date with abbrv. day and month names
-t, --time prints current time as HH-MM-SS
-i, --iso8601 prints the combined date and time including the time
zone in the ISO 8601 standard with UTC offset
-z, --timezone appends the local time zone
-u, --updated appends a string "Last updated: "
-c CUSTOM_TIME, --custom_time CUSTOM_TIME
prints a valid strftime() string
-v, --python prints Python and IPython version
-p PACKAGES, --packages PACKAGES
prints versions of specified Python modules and
packages
-h, --hostname prints the host name
-m, --machine prints system and machine info
-g, --githash prints current Git commit hash
-r, --gitrepo prints current Git remote address
-b, --gitbranch prints the current Git branch (new in v1.6)
-iv, --iversion print name and version of all imported packages
-w, --watermark prints the current version of watermark
options:
-a AUTHOR, --author AUTHOR
prints author name
-gu GITHUB_USERNAME, --github_username GITHUB_USERNAME
prints author github username
-e EMAIL, --email EMAIL
prints author email
-ws WEBSITE, --website WEBSITE
prints author or project website
-d, --date prints current date as YYYY-mm-dd
-n, --datename prints date with abbrv. day and month names
-t, --time prints current time as HH-MM-SS
-i, --iso8601 prints the combined date and time including the time
zone in the ISO 8601 standard with UTC offset
-z, --timezone appends the local time zone
-u, --updated appends a string "Last updated: "
-c CUSTOM_TIME, --custom_time CUSTOM_TIME
prints a valid strftime() string
-v, --python prints Python and IPython version
-p PACKAGES, --packages PACKAGES
prints versions of specified Python modules and
packages
-h, --hostname prints the host name
-m, --machine prints system and machine info
-g, --githash prints current Git commit hash
-r, --gitrepo prints current Git remote address
-b, --gitbranch prints current Git branch
-w, --watermark prints the current version of watermark
-iv, --iversions prints the name/version of all imported modules
```

<br>
Expand All @@ -125,6 +132,10 @@ In line with [NEP 29][nep-29], this project supports:

[[top](#sections)]

#### v. 2.3.0 (February 17, 2021)

- Added the following arguments: `--github_username` - for prints author github username, `--email` - for prints author email, `--website` - for prints author or project website.

#### v. 2.2.0 (February 17, 2021)

- Refactoring such that a `watermark()` function now also works outside IPython and Jupyter. Now, the magic `%watermark` calls `watermark()`. Calling `%watermark` via IPython and Juypter still works as usual. However, in addition the `watermark()` function can be used within regular Python for unit testing purposes etc. ([#46](https://github.com/rasbt/watermark/pull/46), via contribution by [Tymoteusz Wołodźko](https://github.com/twolodzko))
Expand Down
161 changes: 67 additions & 94 deletions docs/watermark.ipynb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Watermark: 2.2.0\n",
"Watermark: 2.3.0\n",
"\n"
]
}
Expand All @@ -102,51 +102,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mDocstring:\u001b[0m\n",
"::\n",
"\n",
" %watermark [-a AUTHOR] [-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME]\n",
" [-v] [-p PACKAGES] [-h] [-m] [-g] [-r] [-b] [-w] [-iv]\n",
"\n",
"IPython magic function to print date/time stamps\n",
"and various system information.\n",
"\n",
"optional arguments:\n",
" -a AUTHOR, --author AUTHOR\n",
" prints author name\n",
" -d, --date prints current date as YYYY-mm-dd\n",
" -n, --datename prints date with abbrv. day and month names\n",
" -t, --time prints current time as HH-MM-SS\n",
" -i, --iso8601 prints the combined date and time including the time\n",
" zone in the ISO 8601 standard with UTC offset\n",
" -z, --timezone appends the local time zone\n",
" -u, --updated appends a string \"Last updated: \"\n",
" -c CUSTOM_TIME, --custom_time CUSTOM_TIME\n",
" prints a valid strftime() string\n",
" -v, --python prints Python and IPython version\n",
" -p PACKAGES, --packages PACKAGES\n",
" prints versions of specified Python modules and\n",
" packages\n",
" -h, --hostname prints the host name\n",
" -m, --machine prints system and machine info\n",
" -g, --githash prints current Git commit hash\n",
" -r, --gitrepo prints current Git remote address\n",
" -b, --gitbranch prints current Git branch\n",
" -w, --watermark prints the current version of watermark\n",
" -iv, --iversions prints the name/version of all imported modules\n",
"\u001b[0;31mFile:\u001b[0m ~/Desktop/watermark/watermark/magic.py\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"%watermark?"
]
Expand All @@ -156,20 +114,27 @@
"metadata": {},
"source": [
"<pre>\n",
"%watermark [-a AUTHOR] [-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME]\n",
" [-v] [-p PACKAGES] [-h] [-m] [-g] [-w]\n",
"%watermark [-a AUTHOR] [-gu GITHUB_USERNAME] [-e EMAIL] [-ws WEBSITE]\n",
" [-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME] [-v]\n",
" [-p PACKAGES] [-h] [-m] [-g] [-r] [-b] [-w] [-iv]\n",
"\n",
"IPython magic function to print date/time stamps\n",
"and various system information.\n",
"\n",
"optional arguments:\n",
"options:\n",
" -a AUTHOR, --author AUTHOR\n",
" prints author name\n",
" -gu GITHUB_USERNAME, --github_username GITHUB_USERNAME\n",
" prints author github username\n",
" -e EMAIL, --email EMAIL\n",
" prints author email\n",
" -ws WEBSITE, --website WEBSITE\n",
" prints author or project website\n",
" -d, --date prints current date as YYYY-mm-dd\n",
" -n, --datename prints date with abbrv. day and month names\n",
" -t, --time prints current time as HH-MM-SS\n",
" -i, --iso8601 prints the combined date and time including the time\n",
" zone the ISO 8601 standard with UTC offset\n",
" zone in the ISO 8601 standard with UTC offset\n",
" -z, --timezone appends the local time zone\n",
" -u, --updated appends a string \"Last updated: \"\n",
" -c CUSTOM_TIME, --custom_time CUSTOM_TIME\n",
Expand All @@ -181,7 +146,10 @@
" -h, --hostname prints the host name\n",
" -m, --machine prints system and machine info\n",
" -g, --githash prints current Git commit hash\n",
" -r, --gitrepo prints current Git remote address\n",
" -b, --gitbranch prints current Git branch\n",
" -w, --watermark prints the current version of watermark\n",
" -iv, --iversions prints the name/version of all imported modules\n",
"</pre>"
]
},
Expand All @@ -208,18 +176,18 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2021-02-18T10:29:04.648127-06:00\n",
"Last updated: 2021-12-04T00:47:46.257735+03:00\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.8.2\n",
"IPython version : 7.18.1\n",
"Python version : 3.10.0\n",
"IPython version : 7.30.0\n",
"\n",
"Compiler : Clang 4.0.1 (tags/RELEASE_401/final)\n",
"OS : Darwin\n",
"Release : 20.3.0\n",
"Compiler : GCC 11.2.1 20210728 (Red Hat 11.2.1-1)\n",
"OS : Linux\n",
"Release : 5.15.6-200.fc35.x86_64\n",
"Machine : x86_64\n",
"Processor : i386\n",
"CPU cores : 12\n",
"Processor : x86_64\n",
"CPU cores : 4\n",
"Architecture: 64bit\n",
"\n"
]
Expand All @@ -245,7 +213,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2021-02-18 10:29:04\n",
"Last updated: 2021-12-04 00:47:46\n",
"\n"
]
}
Expand All @@ -263,7 +231,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2021-02-18T10:29:04.668981-06:00\n",
"Last updated: 2021-12-04T00:47:46.329412+03:00\n",
"\n"
]
}
Expand All @@ -281,7 +249,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: Thu Feb 18 2021 10:29:04CST\n",
"Last updated: Sat Dec 04 2021 00:47:46MSK\n",
"\n"
]
}
Expand All @@ -307,8 +275,8 @@
"output_type": "stream",
"text": [
"Python implementation: CPython\n",
"Python version : 3.8.2\n",
"IPython version : 7.18.1\n",
"Python version : 3.10.0\n",
"IPython version : 7.30.0\n",
"\n"
]
}
Expand All @@ -333,12 +301,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Compiler : Clang 4.0.1 (tags/RELEASE_401/final)\n",
"OS : Darwin\n",
"Release : 20.3.0\n",
"Compiler : GCC 11.2.1 20210728 (Red Hat 11.2.1-1)\n",
"OS : Linux\n",
"Release : 5.15.6-200.fc35.x86_64\n",
"Machine : x86_64\n",
"Processor : i386\n",
"CPU cores : 12\n",
"Processor : x86_64\n",
"CPU cores : 4\n",
"Architecture: 64bit\n",
"\n"
]
Expand All @@ -365,28 +333,26 @@
"output_type": "stream",
"text": [
"Python implementation: CPython\n",
"Python version : 3.8.2\n",
"IPython version : 7.18.1\n",
"Python version : 3.10.0\n",
"IPython version : 7.30.0\n",
"\n",
"numpy : 1.18.5\n",
"scipy : 1.5.0\n",
"sklearn: 0.24.1\n",
"numpy : 1.21.4\n",
"scipy : 1.7.3\n",
"sklearn: 1.0.1\n",
"\n",
"Compiler : Clang 4.0.1 (tags/RELEASE_401/final)\n",
"OS : Darwin\n",
"Release : 20.3.0\n",
"Compiler : GCC 11.2.1 20210728 (Red Hat 11.2.1-1)\n",
"OS : Linux\n",
"Release : 5.15.6-200.fc35.x86_64\n",
"Machine : x86_64\n",
"Processor : i386\n",
"CPU cores : 12\n",
"Processor : x86_64\n",
"CPU cores : 4\n",
"Architecture: 64bit\n",
"\n",
"Git hash: e0893cd2ead20c40402f32cb51876f8a87fb1eff\n",
"\n"
]
}
],
"source": [
"%watermark -v -m -p numpy,scipy,sklearn -g"
"%watermark -v -m -p numpy,scipy,sklearn "
]
},
{
Expand All @@ -407,18 +373,18 @@
"text": [
"Author: John Doe\n",
"\n",
"Last updated: 2021-02-18\n",
"Last updated: 2021-12-04\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.8.2\n",
"IPython version : 7.18.1\n",
"Python version : 3.10.0\n",
"IPython version : 7.30.0\n",
"\n",
"Compiler : Clang 4.0.1 (tags/RELEASE_401/final)\n",
"OS : Darwin\n",
"Release : 20.3.0\n",
"Compiler : GCC 11.2.1 20210728 (Red Hat 11.2.1-1)\n",
"OS : Linux\n",
"Release : 5.15.6-200.fc35.x86_64\n",
"Machine : x86_64\n",
"Processor : i386\n",
"CPU cores : 12\n",
"Processor : x86_64\n",
"CPU cores : 4\n",
"Architecture: 64bit\n",
"\n"
]
Expand Down Expand Up @@ -455,21 +421,28 @@
"name": "stdout",
"output_type": "stream",
"text": [
"numpy : 1.18.5\n",
"sklearn: 0.24.1\n",
"scipy : 1.5.0\n",
"numpy : 1.21.4\n",
"scipy : 1.7.3\n",
"sklearn: 1.0.1\n",
"\n"
]
}
],
"source": [
"%watermark --iversions"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -483,7 +456,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.10.0"
},
"toc": {
"base_numbering": 1,
Expand All @@ -501,4 +474,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
version = 2.2.0
version = 2.3.0
license_file = LICENSE
classifiers =
Development Status :: 5 - Production/Stable
Expand All @@ -11,6 +11,7 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10

[options]
python_requires = >=3.7
Loading