Compare commits
77 Commits
Author | SHA1 | Date | |
---|---|---|---|
c1b28d7f43 | |||
512d27739c | |||
ad3a3b38e6 | |||
1d9eeae447 | |||
c0345cb5d9 | |||
632b13121d | |||
e9ab3581aa | |||
8b0ab3bd76 | |||
7a6d95d436 | |||
fd26197e70 | |||
99b6b3f887 | |||
c2f0b9de48 | |||
95c7f84451 | |||
d1558ad6db | |||
76d3c7249a | |||
450ba61d22 | |||
3d3239a2e3 | |||
830c76c07a | |||
6125862010 | |||
b88da2af7d | |||
b55e75a74d | |||
3bc9d82ee4 | |||
980f869999 | |||
108a90abce | |||
|
5dc349128a | ||
|
d2e7ba7208 | ||
|
2dd14d3fd8 | ||
|
e644272268 | ||
|
2aab71918a | ||
|
3f2f9d748e | ||
|
54c3312012 | ||
|
dd576f44c6 | ||
|
b2363ac606 | ||
|
519a95b477 | ||
|
ac8e6017f5 | ||
|
ba3aa17f4e | ||
|
9630bc0a2b | ||
|
78ac94ef4f | ||
|
a3e45eb050 | ||
|
7d29cf150e | ||
|
cefd952b71 | ||
|
77ba5f6a96 | ||
|
c34fb893a6 | ||
|
1fc26a4121 | ||
|
82c9408d6d | ||
|
9bee9ba11b | ||
|
b42a071671 | ||
|
e8541dbe4e | ||
|
da0f4f1847 | ||
|
d26ed33e7a | ||
|
a50019231d | ||
|
080a8c9b63 | ||
|
fbc9196645 | ||
|
59f35b046b | ||
|
60fa45f3f0 | ||
|
60fe3b9f48 | ||
|
29dba6dd79 | ||
|
ac0bb21462 | ||
|
413150be53 | ||
|
b2db3c3280 | ||
|
6e66f34e5a | ||
|
de673c4749 | ||
|
ce472c9c93 | ||
|
8514942821 | ||
|
d2c91885c3 | ||
|
bd7707fc5a | ||
|
72af24c8af | ||
|
8ffb95d479 | ||
|
a80f7247c2 | ||
|
f106d3b9cc | ||
|
c2075190e1 | ||
|
44f2fac0d4 | ||
|
3f32dda864 | ||
|
8ba2186686 | ||
|
6a37da6353 | ||
|
6c57b99980 | ||
|
4451606530 |
28
.env.template
Executable file
28
.env.template
Executable file
@ -0,0 +1,28 @@
|
||||
# Do NOT edit this file, make
|
||||
# a copy and rename as `.env`
|
||||
|
||||
INPUT_GH_TOKEN=
|
||||
INPUT_WAKATIME_API_KEY=
|
||||
# meta
|
||||
INPUT_API_BASE_URL=
|
||||
INPUT_REPOSITORY=
|
||||
# content
|
||||
INPUT_SHOW_TITLE=
|
||||
INPUT_SECTION_NAME=
|
||||
INPUT_BLOCKS=
|
||||
INPUT_CODE_LANG=
|
||||
INPUT_TIME_RANGE=
|
||||
INPUT_LANG_COUNT=
|
||||
INPUT_SHOW_TIME=
|
||||
INPUT_SHOW_TOTAL=
|
||||
INPUT_SHOW_MASKED_TIME=
|
||||
INPUT_STOP_AT_OTHER=
|
||||
INPUT_IGNORED_LANGUAGES=
|
||||
# commit
|
||||
INPUT_COMMIT_MESSAGE=
|
||||
INPUT_TARGET_BRANCH=
|
||||
INPUT_TARGET_PATH=
|
||||
INPUT_COMMITTER_NAME=
|
||||
INPUT_COMMITTER_EMAIL=
|
||||
INPUT_AUTHOR_NAME=
|
||||
INPUT_AUTHOR_EMAIL=
|
28
.github/testing.yml
vendored
28
.github/testing.yml
vendored
@ -1,28 +0,0 @@
|
||||
name: WakaReadme
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - --version 1.1.13
|
||||
echo "##vso[task.setvariable variable=PATH]${PATH}:$HOME/.poetry/bin"
|
||||
source $HOME/.poetry/env
|
||||
poetry install
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
poetry run python -m unittest discover
|
24
.github/workflows/testing.yml
vendored
Normal file
24
.github/workflows/testing.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: WakaReadme CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
UnitTests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build docker image
|
||||
run: |
|
||||
# Clear existing cache
|
||||
docker builder prune --force
|
||||
|
||||
# Build and run container (executes unit tests)
|
||||
docker compose -p waka-readme -f ./compose.yml up --no-color --pull always --build --force-recreate
|
||||
|
||||
# Cleanup
|
||||
docker compose -p waka-readme -f ./compose.yml down --rmi all
|
24
.gitignore
vendored
24
.gitignore
vendored
@ -85,21 +85,29 @@ ipython_config.py
|
||||
# pyenv
|
||||
# For a library or package, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# .python-version
|
||||
.python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
Pipfile.lock
|
||||
|
||||
# poetry
|
||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||
#poetry.lock
|
||||
poetry.lock
|
||||
|
||||
# pdm
|
||||
# Similar to poetry.lock, it is generally recommended to include pdm.lock in version control.
|
||||
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
||||
# However, this project does not rely on pdm for production.
|
||||
pdm.lock
|
||||
.pdm-python
|
||||
.pdm-build
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||
__pypackages__/
|
||||
@ -112,7 +120,8 @@ celerybeat.pid
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
*.env
|
||||
env.sh
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
@ -153,3 +162,10 @@ cython_debug/
|
||||
|
||||
# VSCode
|
||||
.vscode/
|
||||
|
||||
# asdf/rtx
|
||||
.tool-versions
|
||||
.rtx.toml
|
||||
|
||||
# ruff
|
||||
.ruff_cache
|
||||
|
@ -1,19 +1,66 @@
|
||||
# Contributing
|
||||
|
||||

|
||||

|
||||
|
||||
First off, thank you! Please follow along.
|
||||
> First off, thank you! Please follow along.
|
||||
|
||||
1. Fork this repository and clone your fork into a local machine.
|
||||
2. Install poetry with: `curl -sSL https://install.python-poetry.org | python -`
|
||||
3. Open a terminal in the cloned folder and create a virtual environment using: `poetry shell` and install dependencies with `poetry install`
|
||||
4. Put environment variables in a local `.env` file
|
||||
5. Test the program `python -m unittest discover`.
|
||||
6. Read [main.py:L389](main.py#L389) before step 7.
|
||||
7. Finally run it in development mode with `python -m main --dev`.
|
||||
**You need to _`fork`_ this repository & _`clone`_ it onto your system.** Inside the cloned folder, create a `.env` file with the following contents (without `# comments`):
|
||||
|
||||
## Resources
|
||||
```ini
|
||||
INPUT_GH_TOKEN=EXAMPLE_GITHUB_PAT # required (for development)
|
||||
INPUT_WAKATIME_API_KEY=EXAMPLE-WAKATIME-API-KEY # required
|
||||
INPUT_API_BASE_URL=https://wakatime.com/api # required
|
||||
INPUT_REPOSITORY=GITHUB_USERNAME/REPOSITORY_NAME # required
|
||||
INPUT_COMMIT_MESSAGE=Updated WakaReadme graph with new metrics
|
||||
INPUT_SHOW_TITLE=true
|
||||
INPUT_SECTION_NAME=waka
|
||||
INPUT_BLOCKS=->
|
||||
INPUT_SHOW_TIME=true
|
||||
INPUT_SHOW_TOTAL=true
|
||||
INPUT_TIME_RANGE=last_7_days
|
||||
INPUT_SHOW_MASKED_TIME=false
|
||||
INPUT_LANG_COUNT=0
|
||||
INPUT_STOP_AT_OTHER=true
|
||||
INPUT_IGNORED_LANGUAGES=
|
||||
```
|
||||
|
||||
- [All about git](https://stackoverflow.com/q/315911)
|
||||
- [Poetry](https://python-poetry.org/)
|
||||
- [Unit testing](https://docs.python.org/3/library/unittest.html)
|
||||
**NEVER commit this `.env` file!**
|
||||
|
||||
## Using containers (recommended)
|
||||
|
||||
> Assumes that you already have latest version of either [`podman`](https://podman.io/) or [`docker`](https://www.docker.com/) (with [`compose`](https://docs.docker.com/compose/)) installed & configured.
|
||||
>
|
||||
> Replace `podman` with `docker` everywhere, if you're using the latter.
|
||||
|
||||
```sh
|
||||
# Build and watch logs
|
||||
$ podman-compose -p waka-readme -f ./docker-compose.yml up
|
||||
# Cleanup
|
||||
$ podman-compose -p waka-readme -f ./docker-compose.yml down
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Using virtual environments
|
||||
|
||||
> Assumes you've already installed & configured latest version of [python](https://www.python.org/).
|
||||
|
||||
1. Inside the cloned folder run the following commands to install dependencies
|
||||
|
||||
```sh
|
||||
$ python -m venv .venv
|
||||
$ . ./.venv/bin/activate
|
||||
$ python -m pip install .
|
||||
# ... install decencies ...
|
||||
```
|
||||
|
||||
to activate virtual environment & install dependencies.
|
||||
|
||||
2. To test or execute the program in development, run:
|
||||
|
||||
```sh
|
||||
(.venv)$ python -m unittest discover # run tests
|
||||
(.venv)$ python -m main --dev # execute program in dev mode
|
||||
```
|
||||
|
||||
> You can use any other virtual environment & dependency manager as well.
|
||||
|
29
Dockerfile
29
Dockerfile
@ -1,29 +0,0 @@
|
||||
FROM python:3.10.2-slim-bullseye
|
||||
|
||||
ENV PYTHONFAULTHANDLER=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONHASHSEED=random \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
# pip:
|
||||
PIP_NO_CACHE_DIR=off \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=on \
|
||||
PIP_DEFAULT_TIMEOUT=100 \
|
||||
# poetry:
|
||||
POETRY_VERSION=1.1.14 \
|
||||
POETRY_NO_INTERACTION=1 \
|
||||
POETRY_CACHE_DIR='/var/cache/pypoetry' \
|
||||
PATH="$PATH:/root/.local/bin"
|
||||
|
||||
# install poetry
|
||||
# RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
|
||||
RUN pip install pipx
|
||||
RUN pipx install "poetry==$POETRY_VERSION"
|
||||
RUN pipx ensurepath
|
||||
|
||||
# install dependencies
|
||||
COPY pyproject.toml poetry.lock /
|
||||
RUN poetry install --no-dev --no-root --no-interaction --no-ansi
|
||||
|
||||
# copy and run program
|
||||
ADD main.py /main.py
|
||||
CMD [ "poetry", "run", "python", "/main.py" ]
|
25
LICENSE
25
LICENSE
@ -1,20 +1,21 @@
|
||||
# The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 ATHUL CYRIAC AJAY
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
201
README.md
201
README.md
@ -1,22 +1,16 @@
|
||||
<center>
|
||||
# Dev Metrics in Readme
|
||||
|
||||

|
||||
fork from [waka-readme](https://github/athul/waka-readme)
|
||||
edit for Gitea use.
|
||||
|
||||
</center>
|
||||
|
||||
# Dev Metrics in Readme [](https://travis-ci.com/athul/waka-readme)
|
||||
|
||||
[WakaTime](https://wakatime.com) weekly metrics on your profile readme.
|
||||
|
||||

|
||||
|
||||
:speech_balloon: **Forum** | [GitHub discussions][gh_discuss]
|
||||
[WakaTime](https://wakatime.com) coding metrics on your profile readme.
|
||||
|
||||
## New to WakaTime?
|
||||
|
||||
> Nope? Skip to [prep work](#prep-work).
|
||||
> Nope? Skip to [#Prep work](#prep-work).
|
||||
|
||||
WakaTime gives you an idea of the time you spent on coding. This helps you boost your productivity and competitive edge.
|
||||
WakaTime gives you an idea of the time you spent on coding.
|
||||
This helps you boost your productivity and competitive edge (aka _flex_ :muscle:).
|
||||
|
||||
1. Head over to <https://wakatime.com/> and create an account.
|
||||
2. After logging in get your WakaTime API Key from <https://wakatime.com/api-key/>.
|
||||
@ -24,69 +18,91 @@ WakaTime gives you an idea of the time you spent on coding. This helps you boost
|
||||
4. Paste in your API key to start telemetry.
|
||||
|
||||
:information_source: **Info** | You can read [WakaTime help][waka_help] to know more about configurations.
|
||||
Alternatively, you can also fetch data from WakaTime compatible services like [Wakapi][wakapi] or [Hakatime][hakatime].
|
||||
Alternatively, you can fetch data from WakaTime compatible services such as [Wakapi][wakapi] or [Hakatime][hakatime].
|
||||
|
||||
## Prep Work
|
||||
|
||||
A GitHub repository and a README file is required. We'll be making use of readme in the [profile repository][profile_readme]\*.
|
||||
A Gitea repository and a `README.md` file is required. We'll be making use of readme in the [profile repository][profile_readme].
|
||||
|
||||
- Save the README file after copy-pasting the following special comments. Your dev-metics will show up in between.
|
||||
- Save the `README.md` file after copy-pasting the following special comments. Your dev-metics will show up in between.
|
||||
|
||||
```md
|
||||
```md
|
||||
<!--START_SECTION:waka-->
|
||||
<!--END_SECTION:waka-->
|
||||
```
|
||||
|
||||
<!--START_SECTION:waka-->
|
||||
<!--END_SECTION:waka-->
|
||||
`<!--START_SECTION: -->` and `<!--END_SECTION: -->` are placeholders and must be retained as is. Whereas "`waka`" can be replaced by any alphanumeric string. See [#Tweaks](#tweaks) section for more.
|
||||
|
||||
```
|
||||
- Navigate to your repo's `Settings`:
|
||||
- Go to `Secrets` (at `https://your_gitea_url/username/.profile/settings/actions/secrets` by replacing the `USERNAME` with your own username) and add a new secret "_Named_" `WAKATIME_API_KEY` with your API key as it's "_Secret_".
|
||||
|
||||
- Navigate to your repo's `Settings > Secrets` and add a new secret *named* `WAKATIME_API_KEY` with your API key as it's *value*.
|
||||
> Or use the url <https://github.com/USERNAME/USERNAME/settings/secrets/actions/new> by replacing the `USERNAME` with your own username.
|
||||
> ![new_secrets_actions][new_secrets_actions]
|
||||
- Create a new workflow file named `waka-readme.yml` inside `.gitea/workflows/` folder of your profile repository.
|
||||
- Clear all existing contents, add following lines and save the file.
|
||||
|
||||
- If you're not using [profile repository][profile_readme], add another secret *named* `GH_TOKEN` and insert your [GitHub token][gh_access_token]\* in place of *value*.
|
||||
```yml
|
||||
name: Waka Readme
|
||||
|
||||
- Create a new workflow file (`waka-readme.yml`) inside `.github/workflows/` folder of your repository. You can create it from a template using the *actions tab* of your repository too.
|
||||
- Clear any existing contents, add the following lines and save the file.
|
||||
on:
|
||||
# for manual workflow trigger
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# runs at 12 AM UTC (5:30 AM IST)
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
```yml
|
||||
name: Waka Readme
|
||||
jobs:
|
||||
update-readme:
|
||||
name: WakaReadme DevMetrics
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://git.mamahaha.work/sangge/waka-readme@master # this action name
|
||||
with:
|
||||
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
|
||||
```
|
||||
|
||||
on:
|
||||
workflow_dispatch: # for manual workflow trigger
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # runs at every 12AM UTC
|
||||
|
||||
jobs:
|
||||
update-readme:
|
||||
name: WakaReadme DevMetrics
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: athul/waka-readme@master
|
||||
with:
|
||||
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
|
||||
# following flags are required, only if this is not on
|
||||
# profile readme, remove the leading `#` to use them
|
||||
#GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
#REPOSITORY: <gh_username/gh_username>
|
||||
```
|
||||
Refer [#Example](#example) section for a full blown workflow file.
|
||||
|
||||
## Tweaks
|
||||
|
||||
There are many flags that you can tweak to suit your taste!
|
||||
There are many flags that you can modify as you see fit.
|
||||
|
||||
| Flag | Default | Options | Meaning |
|
||||
| ------------------ | -------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `API_BASE_URL` | `https://wakapi.dev/api` | `https://wakapi.dev/api`, `https://hakatime.mtx-dev.xyz/api` | Integration with WakaTime compatible services like [Wakapi][wakapi] & [Hakatime][hakatime] are possible |
|
||||
| `REPOSITORY` | `<gh_username>/<gh_username>` | `<gh_username>/<repo_name>` | Waka-readme stats will appear on the provided repository |
|
||||
| `COMMIT_MESSAGE` | `Updated waka-readme graph with new metrics` | anything else! | Messaged used when committing updated stats |
|
||||
| `SHOW_TITLE` | `false` | `false`, `true` | Add title to waka-readme stats blob |
|
||||
| `BLOCKS` | `░▒▓█` | `░▒▓█`, `⣀⣄⣤⣦⣶⣷⣿`, `-#`, you can be creative! | Ascii art used to build stats graph |
|
||||
| `TIME_RANGE` | `last_7_days` | `last_7_days`, `last_30_days`, `last_6_months`, `last_year`, `all_time` | String representing a dispensation from which stats are aggregated |
|
||||
| `SHOW_TIME` | `true` | `false`, `true` | Displays the amount of time spent for each language |
|
||||
| `SHOW_TOTAL` | `false` | `false`, `true` | Show total coding time |
|
||||
| `SHOW_MASKED_TIME` | `false` | `false`, `true` | Adds total coding time including unclassified languages (overrides: `SHOW_TOTAL`) |
|
||||
### Meta Tweaks
|
||||
|
||||
# Example
|
||||
| Environment flag | Options (`Default`, `Other`, ...) | Description |
|
||||
| ---------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
||||
| `API_BASE_URL` | `https://wakatime.com/api`, `https://wakapi.dev/api`, `https://hakatime.mtx-dev.xyz/api` | Use WakaTime compatible services like [Wakapi][wakapi] & [Hakatime][hakatime] |
|
||||
| `REPOSITORY` | `<gh_username>/<gh_username>`, `<gh_username>/<repo_name>` | Waka-readme stats will appear on the provided repository |
|
||||
|
||||
### Content Tweaks
|
||||
|
||||
| Environment flag | Options (`Default`, `Other`, ...) | Description |
|
||||
| ------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
||||
| `SHOW_TITLE` | `false`, `true` | Add title to waka-readme stats blob |
|
||||
| `SECTION_NAME` | `waka`, any alphanumeric string | The generator will look for section name to fill up the readme. |
|
||||
| `BLOCKS` | `░▒▓█`, `⣀⣄⣤⣦⣶⣷⣿`, `-#`, `=>`, you can be creative | Ascii art used to build stats graph |
|
||||
| `CODE_LANG` | `txt`, `python` `ruby` `json` , you can use other languages also | Language syntax based highlighted text |
|
||||
| `TIME_RANGE` | `last_7_days`, `last_30_days`, `last_6_months`, `last_year`, `all_time` | String representing a dispensation from which stats are aggregated |
|
||||
| `LANG_COUNT` | `5`, any plausible number | Number of languages to be displayed |
|
||||
| `SHOW_TIME` | `true`, `false` | Displays the amount of time spent for each language |
|
||||
| `SHOW_TOTAL` | `false`, `true` | Show total coding time |
|
||||
| `SHOW_MASKED_TIME` | `false`, `true` | Adds total coding time including unclassified languages (overrides: `SHOW_TOTAL`) |
|
||||
| `STOP_AT_OTHER` | `false`, `true` | Stop when language marked as `Other` is retrieved (overrides: `LANG_COUNT`) |
|
||||
| `IGNORED_LANGUAGES` | <code> </code>, `Binary YAML JSON TOML` | Hide languages from your stats |
|
||||
|
||||
### Commit Tweaks
|
||||
|
||||
| Environment flag | Options (`Default`, `Other`, ...) |
|
||||
| ----------------- | -------------------------------------------------------------------- |
|
||||
| `COMMIT_MESSAGE` | `Updated waka-readme graph with new metrics`, any reasonable message |
|
||||
| `TARGET_BRANCH` | `NOT_SET`, target branch name |
|
||||
| `TARGET_PATH` | `NOT_SET`, `/path/to/target/file` |
|
||||
| `COMMITTER_NAME` | `NOT_SET`, committer name |
|
||||
| `COMMITTER_EMAIL` | `NOT_SET`, committer email |
|
||||
| `AUTHOR_NAME` | `NOT_SET`, author name |
|
||||
| `AUTHOR_EMAIL` | `NOT_SET`, author email |
|
||||
|
||||
The first option is the _default_ value of the _flag_, subsequent options are valid values available for the _flag_.
|
||||
|
||||
## Example
|
||||
|
||||
**`waka-readme.yml`**
|
||||
|
||||
@ -94,29 +110,53 @@ There are many flags that you can tweak to suit your taste!
|
||||
name: Waka Readme
|
||||
|
||||
on:
|
||||
# for manual workflow trigger
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Runs at 12am UTC
|
||||
- cron: '0 0 * * *'
|
||||
# runs at 12 AM UTC (5:30 AM IST)
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
update-readme:
|
||||
name: WakaReadme DevMetrics
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: athul/waka-readme@master
|
||||
# this action name
|
||||
- uses: https://git.mamahaha.work/sangge/waka-readme@master # do NOT replace with anything else
|
||||
with:
|
||||
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
|
||||
SHOW_TITLE: true
|
||||
BLOCKS: ->
|
||||
TIME_RANGE: all_time
|
||||
SHOW_TIME: true
|
||||
SHOW_MASKED_TIME: true
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }} # optional if on profile readme
|
||||
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} # required
|
||||
### meta
|
||||
API_BASE_URL: https://wakatime.com/api # optional
|
||||
REPOSITORY: YOUR_GITEA_USERNAME/YOUR_REPOSITORY_NAME # optional
|
||||
### content
|
||||
SHOW_TITLE: true # optional
|
||||
SECTION_NAME: waka # optional
|
||||
BLOCKS: -> # optional
|
||||
CODE_LANG: rust # optional
|
||||
TIME_RANGE: all_time # optional
|
||||
LANG_COUNT: 10 # optional
|
||||
SHOW_TIME: true # optional
|
||||
SHOW_TOTAL: true # optional
|
||||
SHOW_MASKED_TIME: false # optional
|
||||
STOP_AT_OTHER: true # optional
|
||||
IGNORED_LANGUAGES: YAML JSON TOML # optional
|
||||
### commit
|
||||
COMMIT_MESSAGE: Updated waka-readme graph with new metrics # optional
|
||||
TARGET_BRANCH: master # optional
|
||||
TARGET_PATH: README.md # optional
|
||||
COMMITTER_NAME: GitHubActionBot # optional
|
||||
COMMITTER_EMAIL: action-bot@github.com # optional
|
||||
AUTHOR_NAME: YOUR_NAME # optional
|
||||
AUTHOR_EMAIL: YOUR@EMAIL.com # optional
|
||||
# you can populate email-id with secretes instead
|
||||
```
|
||||
|
||||
**`README.md`**
|
||||
_Rendered `markdown`:_
|
||||
|
||||
```md
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
```rust
|
||||
From: 10 July 2020 - To: 06 August 2022
|
||||
|
||||
Total Time: 1,464 hrs 54 mins
|
||||
@ -129,22 +169,23 @@ Nim 64 hrs 31 mins >------------------------ 04.11 %
|
||||
Other 47 hrs 58 mins >------------------------ 03.05 %
|
||||
```
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Notes
|
||||
|
||||
- Flags `REPOSITORY` and `GH_TOKEN` are required ONLY if, you are NOT using [profile readme][profile_readme].
|
||||
- If you are using `GH_TOKEN`, make sure set the [fine grained token](https://github.com/settings/tokens?type=beta) scope to repository contents with `read-and-write` access. See [#141 (comment)](https://github.com/athul/waka-readme/issues/141#issuecomment-1679831949).
|
||||
- `WAKATIME_API_KEY` is a **required** secret. All other environment variables are optional.
|
||||
- The above example does NOT show proper default values, refer [#Tweaks](#tweaks) for the same.
|
||||
- `IGNORED_LANGUAGES` is suggested for [.NET](https://dotnet.microsoft.com) users, as WakaTime assumes you're working with `Binary`, while debugging.
|
||||
|
||||
## Why only the language stats (and not other data) from the API?
|
||||
|
||||
I am a fan of minimal designs and the profile readme is a great way to show off your skills and interests. The WakaTime API, gets us a **lot of data** about a person's **coding activity including the editors and Operating Systems you used and the projects you worked on**. Some of these projects maybe secretive and should not be shown out to the public. Using up more data via the Wakatime API will clutter the profile readme and hinder your chances on displaying what you provide **value to the community** like the pinned Repositories. I believe that **Coding Stats is nerdiest of all** since you can tell the community that you are ***exercising these languages or learning a new language***, this will also show that you spend some amount of time to learn and exercise your development skills. That's what matters in the end :heart:
|
||||
|
||||
---
|
||||
|
||||
<sup>*</sup>`REPOSITORY` flag and `GH_TOKEN` secret are required you're not using profile readme.
|
||||
I am a fan of minimal designs and the profile readme is a great way to show off your skills and interests. The WakaTime API, gets us a **lot of data** about a person's **coding activity including the editors and Operating Systems you used and the projects you worked on**. Some of these projects maybe secretive and should not be shown out to the public. Using up more data via the Wakatime API will clutter the profile readme and hinder your chances on displaying what you provide **value to the community** like the pinned Repositories. I believe that **Coding Stats is nerdiest of all** since you can tell the community that you are **_exercising these languages or learning a new language_**, this will also show that you spend some amount of time to learn and exercise your development skills. That's what matters in the end :heart:
|
||||
|
||||
[//]: #(Links)
|
||||
|
||||
[wakapi]: https://wakapi.dev
|
||||
[hakatime]: https://github.com/mujx/hakatime
|
||||
[workflow_dispatch]: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
|
||||
[waka_plugins]: https://wakatime.com/plugins
|
||||
[waka_help]: https://wakatime.com/help/editors
|
||||
[profile_readme]: https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme
|
||||
[new_secrets_actions]: https://user-images.githubusercontent.com/52720626/151221742-bc37d139-2bb3-4554-b27c-46b107d1f408.png
|
||||
[gh_access_token]: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
|
||||
[gh_discuss]: https://github.com/athul/waka-readme/discussions
|
||||
|
72
action.yml
72
action.yml
@ -1,67 +1,105 @@
|
||||
name: "Waka - Readme"
|
||||
author: Athul Cyriac Ajay
|
||||
description: "Add a Wakatime Coding Activity graph in your Readme"
|
||||
author: "Athul Cyriac Ajay"
|
||||
description: "WakaTime coding activity graph in your profile readme"
|
||||
|
||||
inputs:
|
||||
GH_TOKEN:
|
||||
GITEA_TOKEN:
|
||||
description: "GitHub access token with Repo scope"
|
||||
default: ${{ github.token }}
|
||||
required: true
|
||||
|
||||
WAKATIME_API_KEY:
|
||||
description: "Your Wakatime/Wakapi/Hakatime API Key"
|
||||
required: true
|
||||
|
||||
# meta tweaks
|
||||
API_BASE_URL:
|
||||
description: "Alternative API base URL when using a third-party WakaTime-ish backend"
|
||||
default: "https://wakatime.com/api"
|
||||
required: false
|
||||
|
||||
REPOSITORY:
|
||||
description: "Your GitHub repository"
|
||||
default: ${{ github.repository }}
|
||||
required: false
|
||||
|
||||
COMMIT_MESSAGE:
|
||||
description: "Add a commit message of your choice"
|
||||
default: "Updated waka-readme graph with new metrics"
|
||||
required: false
|
||||
|
||||
# content tweaks
|
||||
|
||||
SHOW_TITLE:
|
||||
description: "Displays the week number and days in Readme as title"
|
||||
default: "false"
|
||||
required: false
|
||||
|
||||
SECTION_NAME:
|
||||
description: "Section name for data to appear in readme"
|
||||
required: false
|
||||
default: "waka"
|
||||
BLOCKS:
|
||||
description: "Add the progress blocks of your choice"
|
||||
default: "░▒▓█"
|
||||
required: false
|
||||
|
||||
CODE_LANG:
|
||||
description: "Add syntax formatter for generated code"
|
||||
default: "txt"
|
||||
required: false
|
||||
TIME_RANGE:
|
||||
description: "Time range of the queried statistics"
|
||||
default: "last_7_days"
|
||||
required: false
|
||||
|
||||
LANG_COUNT:
|
||||
description: "Maximum number of languages to be shown"
|
||||
default: "5"
|
||||
required: false
|
||||
SHOW_TIME:
|
||||
description: "Displays the amount of time spent for each language"
|
||||
default: "true"
|
||||
required: false
|
||||
|
||||
SHOW_TOTAL:
|
||||
description: "Displays total coding time"
|
||||
default: "false"
|
||||
required: false
|
||||
|
||||
SHOW_MASKED_TIME:
|
||||
description: "Displays total coding time including unclassified languages"
|
||||
default: "false"
|
||||
required: false
|
||||
STOP_AT_OTHER:
|
||||
description: "Stop data retrieval when language marked 'Other' is reached"
|
||||
default: "false"
|
||||
required: false
|
||||
IGNORED_LANGUAGES:
|
||||
description: "Ignore space separated, listed languages"
|
||||
default: ""
|
||||
required: false
|
||||
|
||||
# commit tweaks
|
||||
COMMIT_MESSAGE:
|
||||
description: "Add a commit message of your choice"
|
||||
default: "Updated waka-readme graph with new metrics"
|
||||
required: false
|
||||
TARGET_BRANCH:
|
||||
description: "Target branch"
|
||||
default: "NOT_SET"
|
||||
required: false
|
||||
TARGET_PATH:
|
||||
description: "Target file path"
|
||||
default: "NOT_SET"
|
||||
required: false
|
||||
COMMITTER_NAME:
|
||||
description: "Committer name"
|
||||
default: "NOT_SET"
|
||||
required: false
|
||||
COMMITTER_EMAIL:
|
||||
description: "Committer email"
|
||||
default: "NOT_SET"
|
||||
required: false
|
||||
AUTHOR_NAME:
|
||||
description: "Author name"
|
||||
default: "NOT_SET"
|
||||
required: false
|
||||
AUTHOR_EMAIL:
|
||||
description: "Author email"
|
||||
default: "NOT_SET"
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "docker"
|
||||
image: "Dockerfile"
|
||||
image: "dockerfile"
|
||||
|
||||
branding:
|
||||
icon: "info"
|
||||
|
10
compose.yml
Normal file
10
compose.yml
Normal file
@ -0,0 +1,10 @@
|
||||
# for CI testing
|
||||
services:
|
||||
waka-readme:
|
||||
env_file:
|
||||
- .env.template
|
||||
build:
|
||||
context: .
|
||||
dockerfile: containerfile
|
||||
image: waka-readme:testing
|
||||
container_name: WakaReadmeTesting
|
51
containerfile
Normal file
51
containerfile
Normal file
@ -0,0 +1,51 @@
|
||||
FROM docker.io/python:3-slim
|
||||
|
||||
ENV INPUT_GITEA_TOKEN \
|
||||
INPUT_WAKATIME_API_KEY \
|
||||
# meta
|
||||
INPUT_API_BASE_URL \
|
||||
INPUT_REPOSITORY \
|
||||
# content
|
||||
INPUT_SHOW_TITLE \
|
||||
INPUT_SECTION_NAME \
|
||||
INPUT_BLOCKS \
|
||||
INPUT_CODE_LANG \
|
||||
INPUT_TIME_RANGE \
|
||||
INPUT_LANG_COUNT \
|
||||
INPUT_SHOW_TIME \
|
||||
INPUT_SHOW_TOTAL \
|
||||
INPUT_SHOW_MASKED_TIME \
|
||||
INPUT_STOP_AT_OTHER \
|
||||
INPUT_IGNORED_LANGUAGES \
|
||||
# commit
|
||||
INPUT_COMMIT_MESSAGE \
|
||||
INPUT_TARGET_BRANCH \
|
||||
INPUT_TARGET_PATH \
|
||||
INPUT_COMMITTER_NAME \
|
||||
INPUT_COMMITTER_EMAIL \
|
||||
INPUT_AUTHOR_NAME \
|
||||
INPUT_AUTHOR_EMAIL
|
||||
|
||||
|
||||
ENV PATH="${PATH}:/root/.local/bin" \
|
||||
# python
|
||||
PYTHONFAULTHANDLER=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONHASHSEED=random \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
# pip
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_DEFAULT_TIMEOUT=100
|
||||
|
||||
# copy project files
|
||||
COPY --chown=root:root pyproject.toml main.py /app/
|
||||
|
||||
# install dependencies
|
||||
RUN python -m pip install /app/ -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
# copy tests
|
||||
COPY --chown=root:root tests /app/tests/
|
||||
|
||||
# run tests
|
||||
CMD python -m unittest discover /app/
|
9
docker-compose.yml
Normal file
9
docker-compose.yml
Normal file
@ -0,0 +1,9 @@
|
||||
services:
|
||||
waka-readme:
|
||||
env_file:
|
||||
- .env
|
||||
build:
|
||||
context: .
|
||||
dockerfile: dockerfile
|
||||
image: waka-readme:dev
|
||||
container_name: WakaReadmeDev
|
48
dockerfile
Normal file
48
dockerfile
Normal file
@ -0,0 +1,48 @@
|
||||
FROM docker.io/python:3-slim
|
||||
|
||||
ENV INPUT_GH_TOKEN \
|
||||
INPUT_WAKATIME_API_KEY \
|
||||
# meta
|
||||
INPUT_API_BASE_URL \
|
||||
INPUT_REPOSITORY \
|
||||
# content
|
||||
INPUT_SHOW_TITLE \
|
||||
INPUT_SECTION_NAME \
|
||||
INPUT_BLOCKS \
|
||||
INPUT_CODE_LANG \
|
||||
INPUT_TIME_RANGE \
|
||||
INPUT_LANG_COUNT \
|
||||
INPUT_SHOW_TIME \
|
||||
INPUT_SHOW_TOTAL \
|
||||
INPUT_SHOW_MASKED_TIME \
|
||||
INPUT_STOP_AT_OTHER \
|
||||
INPUT_IGNORED_LANGUAGES \
|
||||
# commit
|
||||
INPUT_COMMIT_MESSAGE \
|
||||
INPUT_TARGET_BRANCH \
|
||||
INPUT_TARGET_PATH \
|
||||
INPUT_COMMITTER_NAME \
|
||||
INPUT_COMMITTER_EMAIL \
|
||||
INPUT_AUTHOR_NAME \
|
||||
INPUT_AUTHOR_EMAIL
|
||||
|
||||
|
||||
ENV PATH="${PATH}:/root/.local/bin" \
|
||||
# python
|
||||
PYTHONFAULTHANDLER=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONHASHSEED=random \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
# pip
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_DEFAULT_TIMEOUT=100
|
||||
|
||||
# copy project files
|
||||
COPY --chown=root:root pyproject.toml main.py /app/
|
||||
|
||||
# install dependencies
|
||||
RUN python -m pip install /app/ -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
# execute program
|
||||
CMD python /app/main.py
|
858
main.py
858
main.py
@ -1,25 +1,20 @@
|
||||
"""
|
||||
WakaReadme : WakaTime progress visualizer
|
||||
=========================================
|
||||
"""WakaReadme : WakaTime progress visualizer.
|
||||
|
||||
Wakatime Metrics on your Profile Readme.
|
||||
|
||||
Title:
|
||||
------
|
||||
|
||||
```txt
|
||||
From: 15 February, 2022 - To: 22 February, 2022
|
||||
````
|
||||
|
||||
Byline:
|
||||
-------
|
||||
|
||||
```txt
|
||||
Total: 34 hrs 43 mins
|
||||
```
|
||||
|
||||
Body:
|
||||
-----
|
||||
|
||||
```txt
|
||||
Python 27 hrs 29 mins ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⣀⣀⣀⣀ 77.83 %
|
||||
@ -29,390 +24,535 @@ TOML 1 hr 48 mins ⣿⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀
|
||||
Other 35 mins ⣦⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀ 01.68 %
|
||||
```
|
||||
|
||||
#### Contents = Title + Byline + Body
|
||||
Contents := Title + Byline + Body
|
||||
"""
|
||||
|
||||
# standard
|
||||
from base64 import b64encode, b64decode
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from base64 import b64encode
|
||||
from functools import partial
|
||||
import logging as logger
|
||||
import os
|
||||
from random import SystemRandom
|
||||
import re
|
||||
import sys
|
||||
from time import sleep
|
||||
from typing import Any
|
||||
import sys
|
||||
import re
|
||||
import os
|
||||
|
||||
# external
|
||||
# # github
|
||||
from github import GithubException, Github
|
||||
# # requests
|
||||
from faker import Faker
|
||||
|
||||
# from github import ContentFile, Github, GithubException, InputGitAuthor, Repository
|
||||
import gitea
|
||||
from requests import get as rq_get
|
||||
from requests.exceptions import RequestException
|
||||
from requests.adapters import HTTPAdapter, Retry
|
||||
from requests.sessions import Session
|
||||
|
||||
################### setup ###################
|
||||
|
||||
# pylint: disable=logging-fstring-interpolation
|
||||
|
||||
################### data ###################
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class WakaConstants:
|
||||
"""
|
||||
WakaConstants
|
||||
-------------
|
||||
"""
|
||||
prefix_length: int = 16
|
||||
graph_length: int = 25
|
||||
start_comment: str = '<!--START_SECTION:waka-->'
|
||||
end_comment: str = '<!--END_SECTION:waka-->'
|
||||
waka_block_pattern: str = f'{start_comment}[\\s\\S]+{end_comment}'
|
||||
|
||||
|
||||
class WakaInput:
|
||||
"""
|
||||
WakaInput Env Vars
|
||||
------------------
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""
|
||||
WakaInput Initialize
|
||||
--------------------
|
||||
"""
|
||||
# mapped environment variables
|
||||
# # required
|
||||
self.gh_token: str = os.getenv('INPUT_GH_TOKEN')
|
||||
self.waka_key: str = os.getenv('INPUT_WAKATIME_API_KEY')
|
||||
self.api_base_url: str = os.getenv(
|
||||
'INPUT_API_BASE_URL', 'https://wakatime.com/api'
|
||||
)
|
||||
self.repository: str = os.getenv('INPUT_REPOSITORY')
|
||||
# # depends
|
||||
self.commit_message: str = os.getenv(
|
||||
'INPUT_COMMIT_MESSAGE', 'Updated WakaReadme graph with new metrics'
|
||||
)
|
||||
# # optional
|
||||
self.show_title: str | bool = os.getenv('INPUT_SHOW_TITLE', 'False')
|
||||
self.block_style: str = os.getenv('INPUT_BLOCKS', '░▒▓█')
|
||||
self.time_range: str = os.getenv('INPUT_TIME_RANGE', 'last_7_days')
|
||||
self.show_time: str | bool = os.getenv('INPUT_SHOW_TIME', 'False')
|
||||
self.show_total_time: str | bool = os.getenv(
|
||||
'INPUT_SHOW_TOTAL', 'False'
|
||||
)
|
||||
self.show_masked_time: str | bool = os.getenv(
|
||||
'INPUT_SHOW_MASKED_TIME', 'False'
|
||||
)
|
||||
|
||||
def validate_input(self) -> bool:
|
||||
"""
|
||||
WakaInput Validate
|
||||
------------------
|
||||
"""
|
||||
|
||||
if not (self.gh_token or self.waka_key or self.api_base_url or self.repository):
|
||||
logger.error('Invalid required input(s)')
|
||||
return False
|
||||
|
||||
if len(self.commit_message) < 1:
|
||||
logger.error(
|
||||
'Commit message length must be greater than 1 character long'
|
||||
)
|
||||
return False
|
||||
|
||||
try:
|
||||
self.show_title: bool = strtobool(self.show_title)
|
||||
self.show_time: bool = strtobool(self.show_time)
|
||||
self.show_total_time: bool = strtobool(self.show_total_time)
|
||||
self.show_masked_time: bool = strtobool(self.show_masked_time)
|
||||
except (ValueError, AttributeError) as err:
|
||||
logger.error(err)
|
||||
return False
|
||||
|
||||
if len(self.block_style) < 2:
|
||||
logger.warning(
|
||||
'Block length should be greater than 2 characters long'
|
||||
)
|
||||
logger.debug('Using default blocks: ░▒▓█')
|
||||
|
||||
# 'all_time' is un-documented, should it be used?
|
||||
if self.time_range not in {
|
||||
'last_7_days', 'last_30_days', 'last_6_months', 'last_year', 'all_time'
|
||||
}:
|
||||
logger.warning('Invalid time range')
|
||||
logger.debug('Using default time range: last_7_days')
|
||||
self.time_range: str = 'last_7_days'
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def strtobool(val: str) -> bool:
|
||||
"""
|
||||
strtobool
|
||||
---------
|
||||
|
||||
PEP 632 https://www.python.org/dev/peps/pep-0632/ is depreciating distutils
|
||||
|
||||
Following code is somewhat shamelessly copied from the original source.
|
||||
|
||||
Convert a string representation of truth to True or False.
|
||||
|
||||
- True values are `'y', 'yes', 't', 'true', 'on', and '1'`
|
||||
- False values are `'n', 'no', 'f', 'false', 'off', and '0'`
|
||||
- Raises `ValueError` if `val` is anything else.
|
||||
"""
|
||||
val = val.lower()
|
||||
|
||||
if val in {'y', 'yes', 't', 'true', 'on', '1'}:
|
||||
return True
|
||||
|
||||
if val in {'n', 'no', 'f', 'false', 'off', '0'}:
|
||||
return False
|
||||
|
||||
raise ValueError(f'invalid truth value for {val}')
|
||||
|
||||
|
||||
################### logic ###################
|
||||
|
||||
def make_title(dawn: str, dusk: str, /) -> str:
|
||||
"""
|
||||
WakaReadme Title
|
||||
----------------
|
||||
|
||||
Makes title for WakaReadme.
|
||||
"""
|
||||
logger.debug('Making title')
|
||||
if not (dawn or dusk):
|
||||
logger.error('Cannot find start/end date')
|
||||
sys.exit(1)
|
||||
api_dfm, msg_dfm = '%Y-%m-%dT%H:%M:%SZ', '%d %B %Y'
|
||||
try:
|
||||
start_date = datetime.strptime(dawn, api_dfm).strftime(msg_dfm)
|
||||
end_date = datetime.strptime(dusk, api_dfm).strftime(msg_dfm)
|
||||
except ValueError as err:
|
||||
logger.error(err)
|
||||
sys.exit(1)
|
||||
logger.debug('Title was made\n')
|
||||
return f'From: {start_date} - To: {end_date}'
|
||||
|
||||
|
||||
def make_graph(
|
||||
block_style: str, percent: float, gr_len: str, /,
|
||||
*, lg_nm: str = ''
|
||||
) -> str:
|
||||
"""
|
||||
WakaReadme Graph
|
||||
----------------
|
||||
|
||||
Makes time graph from the API's data.
|
||||
"""
|
||||
logger.debug(f'Generating graph for "{lg_nm or "..."}"')
|
||||
markers: int = len(block_style) - 1
|
||||
proportion: float = percent / 100 * gr_len
|
||||
graph_bar: str = block_style[-1] * int(proportion + 0.5 / markers)
|
||||
remainder_block: int = int(
|
||||
(proportion - len(graph_bar)) * markers + 0.5
|
||||
)
|
||||
graph_bar += block_style[remainder_block] if remainder_block > 0 else ''
|
||||
graph_bar += block_style[0] * (gr_len - len(graph_bar))
|
||||
logger.debug(f'{lg_nm or "..."} graph generated')
|
||||
return graph_bar
|
||||
|
||||
|
||||
def prep_content(stats: dict | None, /) -> str:
|
||||
"""
|
||||
WakaReadme Prepare Markdown
|
||||
---------------------------
|
||||
|
||||
Prepared markdown content from the fetched statistics
|
||||
```
|
||||
"""
|
||||
contents: str = ''
|
||||
|
||||
# Check if any data exists
|
||||
if not (lang_info := stats.get('languages')):
|
||||
logger.debug('The data seems to be empty, please wait for a day')
|
||||
contents += 'No activity tracked'
|
||||
return contents
|
||||
|
||||
# make title
|
||||
if wk_i.show_title:
|
||||
contents += make_title(stats.get('start'), stats.get('end')) + '\n\n'
|
||||
|
||||
# make byline
|
||||
if wk_i.show_masked_time and (
|
||||
total_time := stats.get('human_readable_total_including_other_language')
|
||||
):
|
||||
# overrides 'human_readable_total'
|
||||
contents += f'Total Time: {total_time}\n\n'
|
||||
elif wk_i.show_total_time and (
|
||||
total_time := stats.get('human_readable_total')
|
||||
):
|
||||
contents += f'Total Time: {total_time}\n\n'
|
||||
|
||||
# make content
|
||||
logger.debug('Making contents')
|
||||
pad_len = len(
|
||||
# comment if it feels way computationally expensive
|
||||
max((str(l.get('name')) for l in lang_info), key=len)
|
||||
# and then don't for get to set pad_len to say 13 :)
|
||||
)
|
||||
for idx, lang in enumerate(lang_info):
|
||||
lang_name: str = lang.get('name')
|
||||
# >>> add languages to filter here <<<
|
||||
# if lang_name in {...}: continue
|
||||
lang_time: str = lang.get('text') if wk_i.show_time else ''
|
||||
lang_ratio: float = lang.get('percent')
|
||||
lang_bar: str = make_graph(
|
||||
wk_i.block_style, lang_ratio, wk_c.graph_length,
|
||||
lg_nm=lang_name
|
||||
)
|
||||
contents += (
|
||||
f'{lang_name.ljust(pad_len)} ' +
|
||||
f'{lang_time: <16}{lang_bar} ' +
|
||||
f'{lang_ratio:.2f}'.zfill(5) + ' %\n'
|
||||
)
|
||||
if idx >= 5 or lang_name == 'Other':
|
||||
break
|
||||
|
||||
logger.debug('Contents were made\n')
|
||||
return contents.rstrip('\n')
|
||||
|
||||
|
||||
def fetch_stats() -> Any:
|
||||
"""
|
||||
WakaReadme Fetch Stats
|
||||
----------------------
|
||||
|
||||
Returns statistics as JSON string
|
||||
"""
|
||||
attempts, statistic, retries = 2, {}, Retry( # for auto retry
|
||||
total=5,
|
||||
backoff_factor=0.5,
|
||||
status_forcelist=[500, 502, 503, 504],
|
||||
)
|
||||
encoded_key: str = str(b64encode(bytes(wk_i.waka_key, 'utf-8')), 'utf-8')
|
||||
|
||||
# making a request
|
||||
with Session() as rqs:
|
||||
rqs.mount('http://', HTTPAdapter(max_retries=retries))
|
||||
rqs.mount('https://', HTTPAdapter(max_retries=retries))
|
||||
|
||||
while attempts > 0:
|
||||
logger.debug('Fetching WakaTime statistics')
|
||||
resp = rqs.get(
|
||||
url=f'{wk_i.api_base_url.rstrip("/")}/v1/users/current/stats/{wk_i.time_range}',
|
||||
headers={'Authorization': f'Basic {encoded_key}'},
|
||||
)
|
||||
logger.debug(
|
||||
f'API response @ trial #{3 - attempts}: {resp.status_code} • {resp.reason}'
|
||||
)
|
||||
if resp.status_code == 200 and (statistic := resp.json()):
|
||||
logger.debug('Fetched WakaTime statistics')
|
||||
break
|
||||
logger.debug('Retrying in 3s ...')
|
||||
sleep(3)
|
||||
attempts -= 1
|
||||
|
||||
if err := (statistic.get('error') or statistic.get('errors')):
|
||||
logger.error(err)
|
||||
sys.exit(1)
|
||||
|
||||
print()
|
||||
return statistic.get('data')
|
||||
|
||||
|
||||
def churn(old_readme: str, /) -> str | None:
|
||||
"""
|
||||
WakaReadme Churn
|
||||
----------------
|
||||
|
||||
Composes WakaTime stats within markdown code snippet
|
||||
"""
|
||||
# getting content
|
||||
try:
|
||||
if not (waka_stats := fetch_stats()):
|
||||
logger.error('Unable to fetch data, please rerun workflow')
|
||||
sys.exit(1)
|
||||
except RequestException as rq_exp:
|
||||
logger.critical(rq_exp)
|
||||
sys.exit(1)
|
||||
|
||||
# processing content
|
||||
generated_content = prep_content(waka_stats)
|
||||
print(generated_content, '\n', sep='')
|
||||
new_readme = re.sub(
|
||||
pattern=wk_c.waka_block_pattern,
|
||||
repl=f'{wk_c.start_comment}\n\n```text\n{generated_content}\n```\n\n{wk_c.end_comment}',
|
||||
string=old_readme
|
||||
)
|
||||
if len(sys.argv) == 2 and sys.argv[1] == '--dev':
|
||||
logger.debug('Detected run in `dev` mode.')
|
||||
# to avoid accidentally writing back to Github
|
||||
# when developing and testing WakaReadme
|
||||
return None
|
||||
return None if new_readme == old_readme else new_readme
|
||||
|
||||
|
||||
def genesis() -> None:
|
||||
"""Run Program"""
|
||||
logger.debug('Conneting to GitHub')
|
||||
gh_connect = Github(wk_i.gh_token)
|
||||
gh_repo = gh_connect.get_repo(wk_i.repository)
|
||||
readme_file = gh_repo.get_readme()
|
||||
logger.debug('Decoding readme contents\n')
|
||||
readme_contents = str(readme_file.decoded_content, encoding='utf-8')
|
||||
if new_content := churn(readme_contents):
|
||||
logger.debug('WakaReadme stats has changed')
|
||||
gh_repo.update_file(
|
||||
path=readme_file.path,
|
||||
message=wk_i.commit_message,
|
||||
content=new_content,
|
||||
sha=readme_file.sha
|
||||
)
|
||||
logger.info('Stats updated successfully')
|
||||
return
|
||||
logger.info('WakaReadme was not updated')
|
||||
|
||||
|
||||
################### driver ###################
|
||||
print()
|
||||
# hush existing loggers
|
||||
for lgr_name in logger.root.manager.loggerDict:
|
||||
# to disable log propagation completely set '.propagate = False'
|
||||
logger.getLogger(lgr_name).setLevel(logger.WARNING)
|
||||
# somehow github.Requester gets missed out from loggerDict
|
||||
logger.getLogger("github.Requester").setLevel(logger.WARNING)
|
||||
# configure logger
|
||||
logger.getLogger('urllib3').setLevel(logger.WARNING)
|
||||
logger.getLogger('github.Requester').setLevel(logger.WARNING)
|
||||
logger.basicConfig(
|
||||
datefmt='%Y-%m-%d %H:%M:%S',
|
||||
format='[%(asctime)s] ln. %(lineno)-3d %(levelname)-8s %(message)s',
|
||||
level=logger.DEBUG
|
||||
datefmt="%Y-%m-%d %H:%M:%S",
|
||||
format="[%(asctime)s] ln. %(lineno)-3d %(levelname)-8s %(message)s",
|
||||
level=logger.DEBUG,
|
||||
)
|
||||
try:
|
||||
if len(sys.argv) == 2 and sys.argv[1] == '--dev':
|
||||
if len(sys.argv) == 2 and sys.argv[1] == "--dev":
|
||||
# get env-vars from .env file for development
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# comment this out to disable colored logging
|
||||
from loguru import logger
|
||||
|
||||
logger.debug("loguru loaded")
|
||||
|
||||
# load from .env before class def gets parsed
|
||||
load_dotenv()
|
||||
logger.debug("dotenv loaded")
|
||||
waka_key: str | None = os.getenv("INPUT_WAKATIME_API_KEY")
|
||||
except ImportError as im_err:
|
||||
logger.warning(im_err)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# initial setup
|
||||
wk_c = WakaConstants()
|
||||
wk_i = WakaInput()
|
||||
logger.debug('Initialize WakaReadme')
|
||||
if not wk_i.validate_input():
|
||||
logger.error('Environment variables are misconfigured')
|
||||
################### lib-func ###################
|
||||
|
||||
|
||||
def strtobool(val: str | bool):
|
||||
"""Strtobool.
|
||||
|
||||
PEP 632 https://www.python.org/dev/peps/pep-0632/ is depreciating distutils.
|
||||
This is from the official source code with slight modifications.
|
||||
|
||||
Converts a string representation of truth to `True` or `False`.
|
||||
|
||||
Args:
|
||||
val:
|
||||
Value to be converted to bool.
|
||||
|
||||
Returns:
|
||||
(Literal[True]):
|
||||
If `val` is any of 'y', 'yes', 't', 'true', 'on', or '1'.
|
||||
(Literal[False]):
|
||||
If `val` is any of 'n', 'no', 'f', 'false', 'off', and '0'.
|
||||
|
||||
Raises:
|
||||
ValueError: If `val` is anything else.
|
||||
"""
|
||||
if isinstance(val, bool):
|
||||
return val
|
||||
|
||||
val = val.lower()
|
||||
|
||||
if val in {"y", "yes", "t", "true", "on", "1"}:
|
||||
return True
|
||||
|
||||
if val in {"n", "no", "f", "false", "off", "0"}:
|
||||
return False
|
||||
|
||||
raise ValueError(f"invalid truth value for {val}")
|
||||
|
||||
|
||||
################### data ###################
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class WakaInput:
|
||||
"""WakaReadme Input Env Variables."""
|
||||
|
||||
# constants
|
||||
prefix_length: int = 16
|
||||
graph_length: int = 25
|
||||
|
||||
# mapped environment variables
|
||||
# # required
|
||||
gitea_token: str | None = os.getenv("INPUT_GITEA_TOKEN")
|
||||
gitea_url: str | None = os.getenv("GITHUB_SERVER_URL", "https://gitea.com")
|
||||
waka_key: str | None = os.getenv("INPUT_WAKATIME_API_KEY")
|
||||
api_base_url: str | None = os.getenv("INPUT_API_BASE_URL", "https://wakatime.com/api")
|
||||
repository: str | None = os.getenv("INPUT_REPOSITORY", ".profile")
|
||||
# # depends
|
||||
commit_message: str = os.getenv(
|
||||
"INPUT_COMMIT_MESSAGE", "Updated WakaReadme graph with new metrics"
|
||||
)
|
||||
code_lang: str = os.getenv("INPUT_CODE_LANG", "txt")
|
||||
_section_name: str = os.getenv("INPUT_SECTION_NAME", "waka")
|
||||
start_comment: str = f"<!--START_SECTION:{_section_name}-->"
|
||||
end_comment: str = f"<!--END_SECTION:{_section_name}-->"
|
||||
waka_block_pattern: str = f"{start_comment}[\\s\\S]+{end_comment}"
|
||||
# # optional
|
||||
show_title: str | bool = os.getenv("INPUT_SHOW_TITLE") or False
|
||||
block_style: str = os.getenv("INPUT_BLOCKS", "░▒▓█")
|
||||
time_range: str = os.getenv("INPUT_TIME_RANGE", "last_7_days")
|
||||
show_time: str | bool = os.getenv("INPUT_SHOW_TIME") or False
|
||||
show_total_time: str | bool = os.getenv("INPUT_SHOW_TOTAL") or False
|
||||
show_masked_time: str | bool = os.getenv("INPUT_SHOW_MASKED_TIME") or False
|
||||
language_count: str | int = os.getenv("INPUT_LANG_COUNT") or 5
|
||||
stop_at_other: str | bool = os.getenv("INPUT_STOP_AT_OTHER") or False
|
||||
ignored_languages: str = os.getenv("INPUT_IGNORED_LANGUAGES", "")
|
||||
# # optional meta
|
||||
target_branch: str = os.getenv("INPUT_TARGET_BRANCH", "NOT_SET")
|
||||
target_path: str = os.getenv("INPUT_TARGET_PATH", "NOT_SET")
|
||||
committer_name: str = os.getenv("INPUT_COMMITTER_NAME", "NOT_SET")
|
||||
committer_email: str = os.getenv("INPUT_COMMITTER_EMAIL", "NOT_SET")
|
||||
author_name: str = os.getenv("INPUT_AUTHOR_NAME", "NOT_SET")
|
||||
author_email: str = os.getenv("INPUT_AUTHOR_EMAIL", "NOT_SET")
|
||||
|
||||
def validate_input(self):
|
||||
"""Validate Input Env Variables."""
|
||||
logger.debug("Validating input variables")
|
||||
if (
|
||||
not self.gitea_token
|
||||
or not self.waka_key
|
||||
or not self.api_base_url
|
||||
or not self.repository
|
||||
):
|
||||
logger.error("Invalid inputs")
|
||||
logger.info("Refer https://github.com/athul/waka-readme")
|
||||
return False
|
||||
|
||||
if len(self.commit_message) < 1:
|
||||
logger.error("Commit message length must be greater than 1 character long")
|
||||
return False
|
||||
|
||||
try:
|
||||
self.show_title = strtobool(self.show_title)
|
||||
self.show_time = strtobool(self.show_time)
|
||||
self.show_total_time = strtobool(self.show_total_time)
|
||||
self.show_masked_time = strtobool(self.show_masked_time)
|
||||
self.stop_at_other = strtobool(self.stop_at_other)
|
||||
except (ValueError, AttributeError) as err:
|
||||
logger.error(err)
|
||||
return False
|
||||
|
||||
if not self._section_name.isalnum():
|
||||
logger.warning("Section name must be in any of [[a-z][A-Z][0-9]]")
|
||||
logger.debug("Using default section name: waka")
|
||||
self._section_name = "waka"
|
||||
self.start_comment = f"<!--START_SECTION:{self._section_name}-->"
|
||||
self.end_comment = f"<!--END_SECTION:{self._section_name}-->"
|
||||
self.waka_block_pattern = f"{self.start_comment}[\\s\\S]+{self.end_comment}"
|
||||
|
||||
if len(self.block_style) < 2:
|
||||
logger.warning("Graph block must be longer than 2 characters")
|
||||
logger.debug("Using default blocks: ░▒▓█")
|
||||
self.block_style = "░▒▓█"
|
||||
|
||||
if self.time_range not in {
|
||||
"last_7_days",
|
||||
"last_30_days",
|
||||
"last_6_months",
|
||||
"last_year",
|
||||
"all_time",
|
||||
}: # "all_time" is un-documented, should it be used?
|
||||
logger.warning("Invalid time range")
|
||||
logger.debug("Using default time range: last_7_days")
|
||||
self.time_range = "last_7_days"
|
||||
|
||||
try:
|
||||
self.language_count = int(self.language_count)
|
||||
if self.language_count < -1:
|
||||
raise ValueError
|
||||
except ValueError:
|
||||
logger.warning("Invalid language count")
|
||||
logger.debug("Using default language count: 5")
|
||||
self.language_count = 5
|
||||
|
||||
for option in (
|
||||
"target_branch",
|
||||
"target_path",
|
||||
"committer_name",
|
||||
"committer_email",
|
||||
"author_name",
|
||||
"author_email",
|
||||
):
|
||||
if not getattr(self, option):
|
||||
logger.warning(f"Improper '{option}' configuration")
|
||||
logger.debug(f"Using default '{option}'")
|
||||
setattr(self, option, "NOT_SET")
|
||||
|
||||
logger.debug("Input validation complete\n")
|
||||
return True
|
||||
|
||||
|
||||
################### logic ###################
|
||||
|
||||
|
||||
def make_title(dawn: str | None, dusk: str | None, /):
|
||||
"""WakaReadme Title.
|
||||
|
||||
Makes title for WakaReadme.
|
||||
"""
|
||||
logger.debug("Making title")
|
||||
if not dawn or not dusk:
|
||||
logger.error("Cannot find start/end date\n")
|
||||
sys.exit(1)
|
||||
logger.debug('Input validation complete')
|
||||
api_dfm, msg_dfm = "%Y-%m-%dT%H:%M:%SZ", "%d %B %Y"
|
||||
try:
|
||||
start_date = datetime.strptime(dawn, api_dfm).strftime(msg_dfm)
|
||||
end_date = datetime.strptime(dusk, api_dfm).strftime(msg_dfm)
|
||||
except ValueError as err:
|
||||
logger.error(f"{err}\n")
|
||||
sys.exit(1)
|
||||
|
||||
logger.debug("Title was made\n")
|
||||
return f"From: {start_date} - To: {end_date}"
|
||||
|
||||
|
||||
def make_graph(block_style: str, percent: float, gr_len: int, lg_nm: str = "", /):
|
||||
"""WakaReadme Graph.
|
||||
|
||||
Makes time graph from the API's data.
|
||||
"""
|
||||
logger.debug(f"Generating graph for '{lg_nm or '...'}'")
|
||||
markers = len(block_style) - 1
|
||||
proportion = percent / 100 * gr_len
|
||||
graph_bar = block_style[-1] * int(proportion + 0.5 / markers)
|
||||
remainder_block = int((proportion - len(graph_bar)) * markers + 0.5)
|
||||
graph_bar += block_style[remainder_block] if remainder_block > 0 else ""
|
||||
graph_bar += block_style[0] * (gr_len - len(graph_bar))
|
||||
|
||||
logger.debug(f"'{lg_nm or '...'}' graph generated")
|
||||
return graph_bar
|
||||
|
||||
|
||||
def prep_content(stats: dict[str, Any], /):
|
||||
"""WakaReadme Prepare Markdown.
|
||||
|
||||
Prepared markdown content from the fetched statistics.
|
||||
```
|
||||
"""
|
||||
logger.debug("Making contents")
|
||||
contents = ""
|
||||
|
||||
# make title
|
||||
if wk_i.show_title:
|
||||
contents += make_title(stats.get("start"), stats.get("end")) + "\n\n"
|
||||
|
||||
# make byline
|
||||
if wk_i.show_masked_time and (
|
||||
total_time := stats.get("human_readable_total_including_other_language")
|
||||
):
|
||||
# overrides "human_readable_total"
|
||||
contents += f"Total Time: {total_time}\n\n"
|
||||
elif wk_i.show_total_time and (total_time := stats.get("human_readable_total")):
|
||||
contents += f"Total Time: {total_time}\n\n"
|
||||
|
||||
lang_info: list[dict[str, int | float | str]] | None = []
|
||||
|
||||
# Check if any language data exists
|
||||
if not (lang_info := stats.get("languages")):
|
||||
logger.debug("The API data seems to be empty, please wait for a day")
|
||||
contents += "No activity tracked"
|
||||
return contents.rstrip("\n")
|
||||
|
||||
# make lang content
|
||||
pad_len = len(
|
||||
# comment if it feels way computationally expensive
|
||||
max((str(lng["name"]) for lng in lang_info), key=len)
|
||||
# and then do not for get to set `pad_len` to say 13 :)
|
||||
)
|
||||
language_count, stop_at_other = int(wk_i.language_count), bool(wk_i.stop_at_other)
|
||||
if language_count == 0 and not wk_i.stop_at_other:
|
||||
logger.debug(
|
||||
"Set INPUT_LANG_COUNT to -1 to retrieve all language"
|
||||
+ " or specify a positive number (ie. above 0)"
|
||||
)
|
||||
return contents.rstrip("\n")
|
||||
|
||||
ignored_languages = set[str](igl.lower() for igl in wk_i.ignored_languages.strip().split())
|
||||
for idx, lang in enumerate(lang_info):
|
||||
lang_name = str(lang["name"])
|
||||
if ignored_languages and lang_name.lower() in ignored_languages:
|
||||
continue
|
||||
lang_time = str(lang["text"]) if wk_i.show_time else ""
|
||||
lang_ratio = float(lang["percent"])
|
||||
lang_bar = make_graph(wk_i.block_style, lang_ratio, wk_i.graph_length, lang_name)
|
||||
contents += (
|
||||
f"{lang_name.ljust(pad_len)} "
|
||||
+ f"{lang_time: <16}{lang_bar} "
|
||||
+ f"{lang_ratio:.2f}".zfill(5)
|
||||
+ " %\n"
|
||||
)
|
||||
if language_count == -1:
|
||||
continue
|
||||
if stop_at_other and (lang_name == "Other"):
|
||||
break
|
||||
if idx + 1 >= language_count > 0: # idx starts at 0
|
||||
break
|
||||
|
||||
logger.debug("Contents were made\n")
|
||||
return contents.rstrip("\n")
|
||||
|
||||
|
||||
def fetch_stats():
|
||||
"""WakaReadme Fetch Stats.
|
||||
|
||||
Returns statistics as JSON string.
|
||||
"""
|
||||
attempts = 4
|
||||
statistic: dict[str, dict[str, Any]] = {}
|
||||
encoded_key = str(b64encode(bytes(str(wk_i.waka_key), "utf-8")), "utf-8")
|
||||
logger.debug(f"Pulling WakaTime stats from {' '.join(wk_i.time_range.split('_'))}")
|
||||
while attempts > 0:
|
||||
resp_message, fake_ua = "", cryptogenic.choice([str(fake.user_agent()) for _ in range(5)])
|
||||
# making a request
|
||||
if (
|
||||
resp := rq_get(
|
||||
url=f"{str(wk_i.api_base_url).rstrip('/')}/v1/users/current/stats/{wk_i.time_range}",
|
||||
headers={
|
||||
"Authorization": f"Basic {encoded_key}",
|
||||
"User-Agent": fake_ua,
|
||||
},
|
||||
timeout=(30.0 * (5 - attempts)),
|
||||
)
|
||||
).status_code != 200:
|
||||
resp_message += f" • {conn_info}" if (conn_info := resp.json().get("message")) else ""
|
||||
logger.debug(
|
||||
f"API response #{5 - attempts}: {resp.status_code} •" + f" {resp.reason}{resp_message}"
|
||||
)
|
||||
if resp.status_code == 200 and (statistic := resp.json()):
|
||||
logger.debug("Fetched WakaTime statistics")
|
||||
break
|
||||
logger.debug(f"Retrying in {30 * (5 - attempts )}s ...")
|
||||
sleep(30 * (5 - attempts))
|
||||
attempts -= 1
|
||||
|
||||
if err := (statistic.get("error") or statistic.get("errors")):
|
||||
logger.error(f"{err}\n")
|
||||
sys.exit(1)
|
||||
|
||||
print()
|
||||
return statistic.get("data")
|
||||
|
||||
|
||||
def churn(old_readme: str, /):
|
||||
"""WakaReadme Churn.
|
||||
|
||||
Composes WakaTime stats within markdown code snippet.
|
||||
"""
|
||||
# check if placeholder pattern exists in readme
|
||||
if not re.findall(wk_i.waka_block_pattern, old_readme):
|
||||
logger.warning(f"Cannot find `{wk_i.waka_block_pattern}` pattern in readme")
|
||||
return None
|
||||
# getting contents
|
||||
if not (waka_stats := fetch_stats()):
|
||||
logger.error("Unable to fetch data, please rerun workflow\n")
|
||||
sys.exit(1)
|
||||
# preparing contents
|
||||
try:
|
||||
generated_content = prep_content(waka_stats)
|
||||
except (AttributeError, KeyError, ValueError) as err:
|
||||
logger.error(f"Unable to read API data | {err}\n")
|
||||
sys.exit(1)
|
||||
print(generated_content, "\n", sep="")
|
||||
# substituting old contents
|
||||
new_readme = re.sub(
|
||||
pattern=wk_i.waka_block_pattern,
|
||||
repl=f"{wk_i.start_comment}\n\n```{wk_i.code_lang}\n{generated_content}\n```\n\n{wk_i.end_comment}",
|
||||
string=old_readme,
|
||||
)
|
||||
logger.debug(new_readme)
|
||||
if len(sys.argv) == 2 and sys.argv[1] == "--dev":
|
||||
logger.debug("Detected run in `dev` mode.")
|
||||
# to avoid accidentally writing back to Github
|
||||
# when developing or testing waka-readme
|
||||
return None
|
||||
return None if new_readme == old_readme else new_readme
|
||||
|
||||
|
||||
# def qualify_target(gitea_repo: Repository.Repository):
|
||||
def qualify_target(gitea_repo: gitea.Repository, gitea_connect: gitea.Gitea):
|
||||
"""Qualify target repository defaults."""
|
||||
|
||||
@dataclass
|
||||
class TargetRepository:
|
||||
# this: ContentFile.ContentFile
|
||||
this: gitea.Content
|
||||
path: str
|
||||
commit_message: str
|
||||
sha: str
|
||||
branch: str
|
||||
# committer: InputGitAuthor | None
|
||||
# author: InputGitAuthor | None
|
||||
committer: None
|
||||
author: None
|
||||
|
||||
gitea_branch = gitea_repo.get_branches()[0].name
|
||||
# if wk_i.target_branch != "NOT_SET":
|
||||
# gitea_branch = gitea_repo.get_branch(wk_i.target_branch)
|
||||
|
||||
readme_content = gitea.Content(gitea_connect)
|
||||
readme_content.path = "README.md"
|
||||
readme_content.type = gitea.Content.FILE
|
||||
target = gitea_repo.get_file_content(readme_content) # base64 encoded
|
||||
# target = gitea_repo.get_readme()
|
||||
|
||||
# if wk_i.target_path != "NOT_SET":
|
||||
# target = gitea_repo.get_contents(
|
||||
# path=wk_i.target_path,
|
||||
# ref=gitea_branch if isinstance(gitea_branch, str) else gitea_branch.commit.sha,
|
||||
# )
|
||||
if isinstance(target, list):
|
||||
raise RuntimeError("Cannot handle multiple files.")
|
||||
|
||||
committer, author = None, None
|
||||
# if wk_i.committer_name != "NOT_SET" and wk_i.committer_email != "NOT_SET":
|
||||
# committer = InputGitAuthor(name=wk_i.committer_name, email=wk_i.committer_email)
|
||||
# if wk_i.author_name != "NOT_SET" and wk_i.author_email != "NOT_SET":
|
||||
# author = InputGitAuthor(name=wk_i.author_name, email=wk_i.author_email)
|
||||
sha = ""
|
||||
|
||||
return TargetRepository(
|
||||
this=target,
|
||||
path="README.md",
|
||||
commit_message=wk_i.commit_message,
|
||||
sha=sha,
|
||||
branch=gitea_branch if isinstance(gitea_branch, str) else gitea_branch.name,
|
||||
committer=committer,
|
||||
author=author,
|
||||
)
|
||||
|
||||
|
||||
def genesis():
|
||||
"""Run Program."""
|
||||
logger.debug("Connecting to Gitea")
|
||||
gitea_connect = gitea.Gitea(wk_i.gitea_url, wk_i.gitea_token)
|
||||
logger.debug("logged into gitea\n")
|
||||
|
||||
# since a validator is being used earlier, casting
|
||||
# `wk_i.ENV_VARIABLE` to a string here, is okay
|
||||
# gitea_repo = gitea_connect.get_repo(str(wk_i.repository))
|
||||
|
||||
owner = "sangge"
|
||||
repo_name = ".profile"
|
||||
gitea_repo = gitea.Repository.request(gitea_connect, owner, repo_name)
|
||||
if len(sys.argv) == 2 and sys.argv[1] == "--dev":
|
||||
logger.debug("Detected run in `dev` mode.,fetched repo \n")
|
||||
target = qualify_target(gitea_repo, gitea_connect)
|
||||
logger.debug("Decoding readme contents\n")
|
||||
|
||||
readme_contents = str(b64decode(target.this), encoding="utf-8")
|
||||
if not (new_content := churn(readme_contents)):
|
||||
logger.info("WakaReadme was not updated")
|
||||
return
|
||||
|
||||
logger.debug("WakaReadme stats has changed")
|
||||
# update_metric = partial(
|
||||
# gitea_repo.update_file,
|
||||
# path=target.path,
|
||||
# message=target.commit_message,
|
||||
# content=new_content,
|
||||
# sha=target.sha,
|
||||
# branch=target.branch,
|
||||
# )
|
||||
# if target.committer:
|
||||
# update_metric = partial(update_metric, committer=target.committer)
|
||||
# if target.author:
|
||||
# update_metric = partial(update_metric, author=target.author)
|
||||
# update_metric()
|
||||
b64_new_content = b64encode(bytes(new_content, "utf-8"))
|
||||
repo_content = gitea_repo.get_git_content()
|
||||
readmes = [c for c in repo_content if c.name == "README.md"]
|
||||
str_new_content = b64_new_content.decode("utf-8")
|
||||
gitea_repo.change_file(readmes[0].name, readmes[0].sha, str_new_content)
|
||||
logger.info("Stats updated successfully")
|
||||
return
|
||||
|
||||
|
||||
################### driver ###################
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# faker data preparation
|
||||
fake = Faker()
|
||||
Faker.seed(0)
|
||||
cryptogenic = SystemRandom()
|
||||
|
||||
# initial waka-readme setup
|
||||
logger.debug("Initialize WakaReadme")
|
||||
wk_i = WakaInput()
|
||||
if not wk_i.validate_input():
|
||||
logger.error("Environment variables are misconfigured\n")
|
||||
sys.exit(1)
|
||||
|
||||
# run
|
||||
try:
|
||||
genesis()
|
||||
except KeyboardInterrupt:
|
||||
print()
|
||||
logger.error('Interrupt signal received')
|
||||
print("\r", end=" ")
|
||||
logger.error("Interrupt signal received\n")
|
||||
sys.exit(1)
|
||||
except GithubException as gh_exp:
|
||||
logger.critical(gh_exp)
|
||||
except RuntimeError as err:
|
||||
logger.error(f"{type(err).__name__}: {err}\n")
|
||||
sys.exit(1)
|
||||
print('\nThanks for using WakaReadme!')
|
||||
# except (GithubException, RequestException) as rq_exp:
|
||||
# logger.critical(f"{rq_exp}\n")
|
||||
# sys.exit(1)
|
||||
print("\nThanks for using WakaReadme!\n")
|
||||
|
606
poetry.lock
generated
606
poetry.lock
generated
@ -1,606 +0,0 @@
|
||||
[[package]]
|
||||
name = "astroid"
|
||||
version = "2.11.7"
|
||||
description = "An abstract syntax tree for Python with inference support."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6.2"
|
||||
|
||||
[package.dependencies]
|
||||
lazy-object-proxy = ">=1.4.0"
|
||||
wrapt = ">=1.11,<2"
|
||||
|
||||
[[package]]
|
||||
name = "autopep8"
|
||||
version = "1.6.0"
|
||||
description = "A tool that automatically formats Python code to conform to the PEP 8 style guide"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
pycodestyle = ">=2.8.0"
|
||||
toml = "*"
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
version = "2022.6.15"
|
||||
description = "Python package for providing Mozilla's CA Bundle."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[[package]]
|
||||
name = "cffi"
|
||||
version = "1.15.1"
|
||||
description = "Foreign Function Interface for Python calling C code."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
pycparser = "*"
|
||||
|
||||
[[package]]
|
||||
name = "charset-normalizer"
|
||||
version = "2.1.0"
|
||||
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6.0"
|
||||
|
||||
[package.extras]
|
||||
unicode_backport = ["unicodedata2"]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.5"
|
||||
description = "Cross-platform colored terminal text."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
|
||||
[[package]]
|
||||
name = "deprecated"
|
||||
version = "1.2.13"
|
||||
description = "Python @deprecated decorator to deprecate old python classes, functions or methods."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
|
||||
[package.dependencies]
|
||||
wrapt = ">=1.10,<2"
|
||||
|
||||
[package.extras]
|
||||
dev = ["tox", "bump2version (<1)", "sphinx (<2)", "importlib-metadata (<3)", "importlib-resources (<4)", "configparser (<5)", "sphinxcontrib-websupport (<2)", "zipp (<2)", "PyTest (<5)", "PyTest-Cov (<2.6)", "pytest", "pytest-cov"]
|
||||
|
||||
[[package]]
|
||||
name = "dill"
|
||||
version = "0.3.5.1"
|
||||
description = "serialize all of python"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*"
|
||||
|
||||
[package.extras]
|
||||
graph = ["objgraph (>=1.7.2)"]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.3"
|
||||
description = "Internationalized Domain Names in Applications (IDNA)"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[[package]]
|
||||
name = "isort"
|
||||
version = "5.10.1"
|
||||
description = "A Python utility / library to sort Python imports."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6.1,<4.0"
|
||||
|
||||
[package.extras]
|
||||
pipfile_deprecated_finder = ["pipreqs", "requirementslib"]
|
||||
requirements_deprecated_finder = ["pipreqs", "pip-api"]
|
||||
colors = ["colorama (>=0.4.3,<0.5.0)"]
|
||||
plugins = ["setuptools"]
|
||||
|
||||
[[package]]
|
||||
name = "lazy-object-proxy"
|
||||
version = "1.7.1"
|
||||
description = "A fast and thorough lazy object proxy."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[[package]]
|
||||
name = "loguru"
|
||||
version = "0.6.0"
|
||||
description = "Python logging made (stupidly) simple"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[package.dependencies]
|
||||
colorama = {version = ">=0.3.4", markers = "sys_platform == \"win32\""}
|
||||
win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""}
|
||||
|
||||
[package.extras]
|
||||
dev = ["sphinx-rtd-theme (>=0.4.3)", "sphinx-autobuild (>=0.7.1)", "Sphinx (>=4.1.1)", "isort (>=5.1.1)", "black (>=19.10b0)", "pytest-cov (>=2.7.1)", "pytest (>=4.6.2)", "tox (>=3.9.0)", "flake8 (>=3.7.7)", "docutils (==0.16)", "colorama (>=0.3.4)"]
|
||||
|
||||
[[package]]
|
||||
name = "mccabe"
|
||||
version = "0.7.0"
|
||||
description = "McCabe checker, plugin for flake8"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "2.5.2"
|
||||
description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)", "sphinx (>=4)"]
|
||||
test = ["appdirs (==1.4.4)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)", "pytest (>=6)"]
|
||||
|
||||
[[package]]
|
||||
name = "pycodestyle"
|
||||
version = "2.9.1"
|
||||
description = "Python style guide checker"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[[package]]
|
||||
name = "pycparser"
|
||||
version = "2.21"
|
||||
description = "C parser in Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
|
||||
[[package]]
|
||||
name = "pygithub"
|
||||
version = "1.55"
|
||||
description = "Use the full Github API v3"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
deprecated = "*"
|
||||
pyjwt = ">=2.0"
|
||||
pynacl = ">=1.4.0"
|
||||
requests = ">=2.14.0"
|
||||
|
||||
[package.extras]
|
||||
integrations = ["cryptography"]
|
||||
|
||||
[[package]]
|
||||
name = "pyjwt"
|
||||
version = "2.4.0"
|
||||
description = "JSON Web Token implementation in Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.extras]
|
||||
tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"]
|
||||
docs = ["zope.interface", "sphinx-rtd-theme", "sphinx"]
|
||||
dev = ["pre-commit", "mypy", "coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)", "cryptography (>=3.3.1)", "zope.interface", "sphinx-rtd-theme", "sphinx"]
|
||||
crypto = ["cryptography (>=3.3.1)"]
|
||||
|
||||
[[package]]
|
||||
name = "pylint"
|
||||
version = "2.14.5"
|
||||
description = "python code static checker"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7.2"
|
||||
|
||||
[package.dependencies]
|
||||
astroid = ">=2.11.6,<=2.12.0-dev0"
|
||||
colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""}
|
||||
dill = ">=0.2"
|
||||
isort = ">=4.2.5,<6"
|
||||
mccabe = ">=0.6,<0.8"
|
||||
platformdirs = ">=2.2.0"
|
||||
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
|
||||
tomlkit = ">=0.10.1"
|
||||
|
||||
[package.extras]
|
||||
spelling = ["pyenchant (>=3.2,<4.0)"]
|
||||
testutils = ["gitpython (>3)"]
|
||||
|
||||
[[package]]
|
||||
name = "pynacl"
|
||||
version = "1.5.0"
|
||||
description = "Python binding to the Networking and Cryptography (NaCl) library"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
cffi = ">=1.4.1"
|
||||
|
||||
[package.extras]
|
||||
docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"]
|
||||
tests = ["pytest (>=3.2.1,!=3.3.0)", "hypothesis (>=3.27.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "python-dotenv"
|
||||
version = "0.20.0"
|
||||
description = "Read key-value pairs from a .env file and set them as environment variables"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[package.extras]
|
||||
cli = ["click (>=5.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "requests"
|
||||
version = "2.28.1"
|
||||
description = "Python HTTP for Humans."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7, <4"
|
||||
|
||||
[package.dependencies]
|
||||
certifi = ">=2017.4.17"
|
||||
charset-normalizer = ">=2,<3"
|
||||
idna = ">=2.5,<4"
|
||||
urllib3 = ">=1.21.1,<1.27"
|
||||
|
||||
[package.extras]
|
||||
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
|
||||
use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.10.2"
|
||||
description = "Python Library for Tom's Obvious, Minimal Language"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
|
||||
[[package]]
|
||||
name = "tomli"
|
||||
version = "2.0.1"
|
||||
description = "A lil' TOML parser"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[[package]]
|
||||
name = "tomlkit"
|
||||
version = "0.11.1"
|
||||
description = "Style preserving TOML library"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6,<4.0"
|
||||
|
||||
[[package]]
|
||||
name = "urllib3"
|
||||
version = "1.26.11"
|
||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4"
|
||||
|
||||
[package.extras]
|
||||
brotli = ["brotlicffi (>=0.8.0)", "brotli (>=1.0.9)", "brotlipy (>=0.6.0)"]
|
||||
secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"]
|
||||
socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "win32-setctime"
|
||||
version = "1.1.0"
|
||||
description = "A small Python utility to set file creation time on Windows"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[package.extras]
|
||||
dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"]
|
||||
|
||||
[[package]]
|
||||
name = "wrapt"
|
||||
version = "1.14.1"
|
||||
description = "Module for decorators, wrappers and monkey patching."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
|
||||
|
||||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = "^3.10"
|
||||
content-hash = "011c2ef182a014ac84fb31db07c086d08b55308b82e842f8f66b2302c040a986"
|
||||
|
||||
[metadata.files]
|
||||
astroid = [
|
||||
{file = "astroid-2.11.7-py3-none-any.whl", hash = "sha256:86b0a340a512c65abf4368b80252754cda17c02cdbbd3f587dddf98112233e7b"},
|
||||
{file = "astroid-2.11.7.tar.gz", hash = "sha256:bb24615c77f4837c707669d16907331374ae8a964650a66999da3f5ca68dc946"},
|
||||
]
|
||||
autopep8 = [
|
||||
{file = "autopep8-1.6.0-py2.py3-none-any.whl", hash = "sha256:ed77137193bbac52d029a52c59bec1b0629b5a186c495f1eb21b126ac466083f"},
|
||||
{file = "autopep8-1.6.0.tar.gz", hash = "sha256:44f0932855039d2c15c4510d6df665e4730f2b8582704fa48f9c55bd3e17d979"},
|
||||
]
|
||||
certifi = [
|
||||
{file = "certifi-2022.6.15-py3-none-any.whl", hash = "sha256:fe86415d55e84719d75f8b69414f6438ac3547d2078ab91b67e779ef69378412"},
|
||||
{file = "certifi-2022.6.15.tar.gz", hash = "sha256:84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d"},
|
||||
]
|
||||
cffi = [
|
||||
{file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"},
|
||||
{file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"},
|
||||
{file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"},
|
||||
{file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"},
|
||||
{file = "cffi-1.15.1-cp27-cp27m-win_amd64.whl", hash = "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e"},
|
||||
{file = "cffi-1.15.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162"},
|
||||
{file = "cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-win32.whl", hash = "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-win32.whl", hash = "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-win32.whl", hash = "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-win_amd64.whl", hash = "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-win32.whl", hash = "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-win32.whl", hash = "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-win32.whl", hash = "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"},
|
||||
{file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"},
|
||||
]
|
||||
charset-normalizer = [
|
||||
{file = "charset-normalizer-2.1.0.tar.gz", hash = "sha256:575e708016ff3a5e3681541cb9d79312c416835686d054a23accb873b254f413"},
|
||||
{file = "charset_normalizer-2.1.0-py3-none-any.whl", hash = "sha256:5189b6f22b01957427f35b6a08d9a0bc45b46d3788ef5a92e978433c7a35f8a5"},
|
||||
]
|
||||
colorama = [
|
||||
{file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"},
|
||||
{file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"},
|
||||
]
|
||||
deprecated = [
|
||||
{file = "Deprecated-1.2.13-py2.py3-none-any.whl", hash = "sha256:64756e3e14c8c5eea9795d93c524551432a0be75629f8f29e67ab8caf076c76d"},
|
||||
{file = "Deprecated-1.2.13.tar.gz", hash = "sha256:43ac5335da90c31c24ba028af536a91d41d53f9e6901ddb021bcc572ce44e38d"},
|
||||
]
|
||||
dill = [
|
||||
{file = "dill-0.3.5.1-py2.py3-none-any.whl", hash = "sha256:33501d03270bbe410c72639b350e941882a8b0fd55357580fbc873fba0c59302"},
|
||||
{file = "dill-0.3.5.1.tar.gz", hash = "sha256:d75e41f3eff1eee599d738e76ba8f4ad98ea229db8b085318aa2b3333a208c86"},
|
||||
]
|
||||
idna = [
|
||||
{file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"},
|
||||
{file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"},
|
||||
]
|
||||
isort = [
|
||||
{file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"},
|
||||
{file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"},
|
||||
]
|
||||
lazy-object-proxy = [
|
||||
{file = "lazy-object-proxy-1.7.1.tar.gz", hash = "sha256:d609c75b986def706743cdebe5e47553f4a5a1da9c5ff66d76013ef396b5a8a4"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bb8c5fd1684d60a9902c60ebe276da1f2281a318ca16c1d0a96db28f62e9166b"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a57d51ed2997e97f3b8e3500c984db50a554bb5db56c50b5dab1b41339b37e36"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd45683c3caddf83abbb1249b653a266e7069a09f486daa8863fb0e7496a9fdb"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:8561da8b3dd22d696244d6d0d5330618c993a215070f473b699e00cf1f3f6443"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fccdf7c2c5821a8cbd0a9440a456f5050492f2270bd54e94360cac663398739b"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp310-cp310-win32.whl", hash = "sha256:898322f8d078f2654d275124a8dd19b079080ae977033b713f677afcfc88e2b9"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp310-cp310-win_amd64.whl", hash = "sha256:85b232e791f2229a4f55840ed54706110c80c0a210d076eee093f2b2e33e1bfd"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:46ff647e76f106bb444b4533bb4153c7370cdf52efc62ccfc1a28bdb3cc95442"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:12f3bb77efe1367b2515f8cb4790a11cffae889148ad33adad07b9b55e0ab22c"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c19814163728941bb871240d45c4c30d33b8a2e85972c44d4e63dd7107faba44"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:e40f2013d96d30217a51eeb1db28c9ac41e9d0ee915ef9d00da639c5b63f01a1"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:2052837718516a94940867e16b1bb10edb069ab475c3ad84fd1e1a6dd2c0fcfc"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp36-cp36m-win32.whl", hash = "sha256:6a24357267aa976abab660b1d47a34aaf07259a0c3859a34e536f1ee6e76b5bb"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp36-cp36m-win_amd64.whl", hash = "sha256:6aff3fe5de0831867092e017cf67e2750c6a1c7d88d84d2481bd84a2e019ec35"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6a6e94c7b02641d1311228a102607ecd576f70734dc3d5e22610111aeacba8a0"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4ce15276a1a14549d7e81c243b887293904ad2d94ad767f42df91e75fd7b5b6"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e368b7f7eac182a59ff1f81d5f3802161932a41dc1b1cc45c1f757dc876b5d2c"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:6ecbb350991d6434e1388bee761ece3260e5228952b1f0c46ffc800eb313ff42"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:553b0f0d8dbf21890dd66edd771f9b1b5f51bd912fa5f26de4449bfc5af5e029"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp37-cp37m-win32.whl", hash = "sha256:c7a683c37a8a24f6428c28c561c80d5f4fd316ddcf0c7cab999b15ab3f5c5c69"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp37-cp37m-win_amd64.whl", hash = "sha256:df2631f9d67259dc9620d831384ed7732a198eb434eadf69aea95ad18c587a28"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:07fa44286cda977bd4803b656ffc1c9b7e3bc7dff7d34263446aec8f8c96f88a"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4dca6244e4121c74cc20542c2ca39e5c4a5027c81d112bfb893cf0790f96f57e"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91ba172fc5b03978764d1df5144b4ba4ab13290d7bab7a50f12d8117f8630c38"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:043651b6cb706eee4f91854da4a089816a6606c1428fd391573ef8cb642ae4f7"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b9e89b87c707dd769c4ea91f7a31538888aad05c116a59820f28d59b3ebfe25a"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp38-cp38-win32.whl", hash = "sha256:9d166602b525bf54ac994cf833c385bfcc341b364e3ee71e3bf5a1336e677b55"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp38-cp38-win_amd64.whl", hash = "sha256:8f3953eb575b45480db6568306893f0bd9d8dfeeebd46812aa09ca9579595148"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dd7ed7429dbb6c494aa9bc4e09d94b778a3579be699f9d67da7e6804c422d3de"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70ed0c2b380eb6248abdef3cd425fc52f0abd92d2b07ce26359fcbc399f636ad"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7096a5e0c1115ec82641afbdd70451a144558ea5cf564a896294e346eb611be1"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f769457a639403073968d118bc70110e7dce294688009f5c24ab78800ae56dc8"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:39b0e26725c5023757fc1ab2a89ef9d7ab23b84f9251e28f9cc114d5b59c1b09"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp39-cp39-win32.whl", hash = "sha256:2130db8ed69a48a3440103d4a520b89d8a9405f1b06e2cc81640509e8bf6548f"},
|
||||
{file = "lazy_object_proxy-1.7.1-cp39-cp39-win_amd64.whl", hash = "sha256:677ea950bef409b47e51e733283544ac3d660b709cfce7b187f5ace137960d61"},
|
||||
{file = "lazy_object_proxy-1.7.1-pp37.pp38-none-any.whl", hash = "sha256:d66906d5785da8e0be7360912e99c9188b70f52c422f9fc18223347235691a84"},
|
||||
]
|
||||
loguru = [
|
||||
{file = "loguru-0.6.0-py3-none-any.whl", hash = "sha256:4e2414d534a2ab57573365b3e6d0234dfb1d84b68b7f3b948e6fb743860a77c3"},
|
||||
{file = "loguru-0.6.0.tar.gz", hash = "sha256:066bd06758d0a513e9836fd9c6b5a75bfb3fd36841f4b996bc60b547a309d41c"},
|
||||
]
|
||||
mccabe = [
|
||||
{file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"},
|
||||
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
|
||||
]
|
||||
platformdirs = [
|
||||
{file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"},
|
||||
{file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"},
|
||||
]
|
||||
pycodestyle = [
|
||||
{file = "pycodestyle-2.9.1-py2.py3-none-any.whl", hash = "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"},
|
||||
{file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"},
|
||||
]
|
||||
pycparser = [
|
||||
{file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"},
|
||||
{file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"},
|
||||
]
|
||||
pygithub = [
|
||||
{file = "PyGithub-1.55-py3-none-any.whl", hash = "sha256:2caf0054ea079b71e539741ae56c5a95e073b81fa472ce222e81667381b9601b"},
|
||||
{file = "PyGithub-1.55.tar.gz", hash = "sha256:1bbfff9372047ff3f21d5cd8e07720f3dbfdaf6462fcaed9d815f528f1ba7283"},
|
||||
]
|
||||
pyjwt = [
|
||||
{file = "PyJWT-2.4.0-py3-none-any.whl", hash = "sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf"},
|
||||
{file = "PyJWT-2.4.0.tar.gz", hash = "sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba"},
|
||||
]
|
||||
pylint = [
|
||||
{file = "pylint-2.14.5-py3-none-any.whl", hash = "sha256:fabe30000de7d07636d2e82c9a518ad5ad7908590fe135ace169b44839c15f90"},
|
||||
{file = "pylint-2.14.5.tar.gz", hash = "sha256:487ce2192eee48211269a0e976421f334cf94de1806ca9d0a99449adcdf0285e"},
|
||||
]
|
||||
pynacl = [
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:401002a4aaa07c9414132aaed7f6836ff98f59277a234704ff66878c2ee4a0d1"},
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:52cb72a79269189d4e0dc537556f4740f7f0a9ec41c1322598799b0bdad4ef92"},
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a36d4a9dda1f19ce6e03c9a784a2921a4b726b02e1c736600ca9c22029474394"},
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:0c84947a22519e013607c9be43706dd42513f9e6ae5d39d3613ca1e142fba44d"},
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06b8f6fa7f5de8d5d2f7573fe8c863c051225a27b61e6860fd047b1775807858"},
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:a422368fc821589c228f4c49438a368831cb5bbc0eab5ebe1d7fac9dded6567b"},
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:61f642bf2378713e2c2e1de73444a3778e5f0a38be6fee0fe532fe30060282ff"},
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-win32.whl", hash = "sha256:e46dae94e34b085175f8abb3b0aaa7da40767865ac82c928eeb9e57e1ea8a543"},
|
||||
{file = "PyNaCl-1.5.0-cp36-abi3-win_amd64.whl", hash = "sha256:20f42270d27e1b6a29f54032090b972d97f0a1b0948cc52392041ef7831fee93"},
|
||||
{file = "PyNaCl-1.5.0.tar.gz", hash = "sha256:8ac7448f09ab85811607bdd21ec2464495ac8b7c66d146bf545b0f08fb9220ba"},
|
||||
]
|
||||
python-dotenv = [
|
||||
{file = "python-dotenv-0.20.0.tar.gz", hash = "sha256:b7e3b04a59693c42c36f9ab1cc2acc46fa5df8c78e178fc33a8d4cd05c8d498f"},
|
||||
{file = "python_dotenv-0.20.0-py3-none-any.whl", hash = "sha256:d92a187be61fe482e4fd675b6d52200e7be63a12b724abbf931a40ce4fa92938"},
|
||||
]
|
||||
requests = [
|
||||
{file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"},
|
||||
{file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"},
|
||||
]
|
||||
toml = [
|
||||
{file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"},
|
||||
{file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
|
||||
]
|
||||
tomli = [
|
||||
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
|
||||
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
|
||||
]
|
||||
tomlkit = [
|
||||
{file = "tomlkit-0.11.1-py3-none-any.whl", hash = "sha256:1c5bebdf19d5051e2e1de6cf70adfc5948d47221f097fcff7a3ffc91e953eaf5"},
|
||||
{file = "tomlkit-0.11.1.tar.gz", hash = "sha256:61901f81ff4017951119cd0d1ed9b7af31c821d6845c8c477587bbdcd5e5854e"},
|
||||
]
|
||||
urllib3 = [
|
||||
{file = "urllib3-1.26.11-py2.py3-none-any.whl", hash = "sha256:c33ccba33c819596124764c23a97d25f32b28433ba0dedeb77d873a38722c9bc"},
|
||||
{file = "urllib3-1.26.11.tar.gz", hash = "sha256:ea6e8fb210b19d950fab93b60c9009226c63a28808bc8386e05301e25883ac0a"},
|
||||
]
|
||||
win32-setctime = [
|
||||
{file = "win32_setctime-1.1.0-py3-none-any.whl", hash = "sha256:231db239e959c2fe7eb1d7dc129f11172354f98361c4fa2d6d2d7e278baa8aad"},
|
||||
{file = "win32_setctime-1.1.0.tar.gz", hash = "sha256:15cf5750465118d6929ae4de4eb46e8edae9a5634350c01ba582df868e932cb2"},
|
||||
]
|
||||
wrapt = [
|
||||
{file = "wrapt-1.14.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:1b376b3f4896e7930f1f772ac4b064ac12598d1c38d04907e696cc4d794b43d3"},
|
||||
{file = "wrapt-1.14.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:903500616422a40a98a5a3c4ff4ed9d0066f3b4c951fa286018ecdf0750194ef"},
|
||||
{file = "wrapt-1.14.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5a9a0d155deafd9448baff28c08e150d9b24ff010e899311ddd63c45c2445e28"},
|
||||
{file = "wrapt-1.14.1-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:ddaea91abf8b0d13443f6dac52e89051a5063c7d014710dcb4d4abb2ff811a59"},
|
||||
{file = "wrapt-1.14.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:36f582d0c6bc99d5f39cd3ac2a9062e57f3cf606ade29a0a0d6b323462f4dd87"},
|
||||
{file = "wrapt-1.14.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:7ef58fb89674095bfc57c4069e95d7a31cfdc0939e2a579882ac7d55aadfd2a1"},
|
||||
{file = "wrapt-1.14.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:e2f83e18fe2f4c9e7db597e988f72712c0c3676d337d8b101f6758107c42425b"},
|
||||
{file = "wrapt-1.14.1-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:ee2b1b1769f6707a8a445162ea16dddf74285c3964f605877a20e38545c3c462"},
|
||||
{file = "wrapt-1.14.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:833b58d5d0b7e5b9832869f039203389ac7cbf01765639c7309fd50ef619e0b1"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:80bb5c256f1415f747011dc3604b59bc1f91c6e7150bd7db03b19170ee06b320"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:07f7a7d0f388028b2df1d916e94bbb40624c59b48ecc6cbc232546706fac74c2"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02b41b633c6261feff8ddd8d11c711df6842aba629fdd3da10249a53211a72c4"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2fe803deacd09a233e4762a1adcea5db5d31e6be577a43352936179d14d90069"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:257fd78c513e0fb5cdbe058c27a0624c9884e735bbd131935fd49e9fe719d310"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4fcc4649dc762cddacd193e6b55bc02edca674067f5f98166d7713b193932b7f"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:11871514607b15cfeb87c547a49bca19fde402f32e2b1c24a632506c0a756656"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8ad85f7f4e20964db4daadcab70b47ab05c7c1cf2a7c1e51087bfaa83831854c"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-win32.whl", hash = "sha256:a9a52172be0b5aae932bef82a79ec0a0ce87288c7d132946d645eba03f0ad8a8"},
|
||||
{file = "wrapt-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:6d323e1554b3d22cfc03cd3243b5bb815a51f5249fdcbb86fda4bf62bab9e164"},
|
||||
{file = "wrapt-1.14.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:43ca3bbbe97af00f49efb06e352eae40434ca9d915906f77def219b88e85d907"},
|
||||
{file = "wrapt-1.14.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:6b1a564e6cb69922c7fe3a678b9f9a3c54e72b469875aa8018f18b4d1dd1adf3"},
|
||||
{file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:00b6d4ea20a906c0ca56d84f93065b398ab74b927a7a3dbd470f6fc503f95dc3"},
|
||||
{file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:a85d2b46be66a71bedde836d9e41859879cc54a2a04fad1191eb50c2066f6e9d"},
|
||||
{file = "wrapt-1.14.1-cp35-cp35m-win32.whl", hash = "sha256:dbcda74c67263139358f4d188ae5faae95c30929281bc6866d00573783c422b7"},
|
||||
{file = "wrapt-1.14.1-cp35-cp35m-win_amd64.whl", hash = "sha256:b21bb4c09ffabfa0e85e3a6b623e19b80e7acd709b9f91452b8297ace2a8ab00"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:9e0fd32e0148dd5dea6af5fee42beb949098564cc23211a88d799e434255a1f4"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9736af4641846491aedb3c3f56b9bc5568d92b0692303b5a305301a95dfd38b1"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5b02d65b9ccf0ef6c34cba6cf5bf2aab1bb2f49c6090bafeecc9cd81ad4ea1c1"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21ac0156c4b089b330b7666db40feee30a5d52634cc4560e1905d6529a3897ff"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:9f3e6f9e05148ff90002b884fbc2a86bd303ae847e472f44ecc06c2cd2fcdb2d"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:6e743de5e9c3d1b7185870f480587b75b1cb604832e380d64f9504a0535912d1"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:d79d7d5dc8a32b7093e81e97dad755127ff77bcc899e845f41bf71747af0c569"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-win32.whl", hash = "sha256:81b19725065dcb43df02b37e03278c011a09e49757287dca60c5aecdd5a0b8ed"},
|
||||
{file = "wrapt-1.14.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b014c23646a467558be7da3d6b9fa409b2c567d2110599b7cf9a0c5992b3b471"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:88bd7b6bd70a5b6803c1abf6bca012f7ed963e58c68d76ee20b9d751c74a3248"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b5901a312f4d14c59918c221323068fad0540e34324925c8475263841dbdfe68"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d77c85fedff92cf788face9bfa3ebaa364448ebb1d765302e9af11bf449ca36d"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d649d616e5c6a678b26d15ece345354f7c2286acd6db868e65fcc5ff7c24a77"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7d2872609603cb35ca513d7404a94d6d608fc13211563571117046c9d2bcc3d7"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ee6acae74a2b91865910eef5e7de37dc6895ad96fa23603d1d27ea69df545015"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2b39d38039a1fdad98c87279b48bc5dce2c0ca0d73483b12cb72aa9609278e8a"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-win32.whl", hash = "sha256:60db23fa423575eeb65ea430cee741acb7c26a1365d103f7b0f6ec412b893853"},
|
||||
{file = "wrapt-1.14.1-cp37-cp37m-win_amd64.whl", hash = "sha256:709fe01086a55cf79d20f741f39325018f4df051ef39fe921b1ebe780a66184c"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8c0ce1e99116d5ab21355d8ebe53d9460366704ea38ae4d9f6933188f327b456"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e3fb1677c720409d5f671e39bac6c9e0e422584e5f518bfd50aa4cbbea02433f"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:642c2e7a804fcf18c222e1060df25fc210b9c58db7c91416fb055897fc27e8cc"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b7c050ae976e286906dd3f26009e117eb000fb2cf3533398c5ad9ccc86867b1"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef3f72c9666bba2bab70d2a8b79f2c6d2c1a42a7f7e2b0ec83bb2f9e383950af"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:01c205616a89d09827986bc4e859bcabd64f5a0662a7fe95e0d359424e0e071b"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5a0f54ce2c092aaf439813735584b9537cad479575a09892b8352fea5e988dc0"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2cf71233a0ed05ccdabe209c606fe0bac7379fdcf687f39b944420d2a09fdb57"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-win32.whl", hash = "sha256:aa31fdcc33fef9eb2552cbcbfee7773d5a6792c137b359e82879c101e98584c5"},
|
||||
{file = "wrapt-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:d1967f46ea8f2db647c786e78d8cc7e4313dbd1b0aca360592d8027b8508e24d"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3232822c7d98d23895ccc443bbdf57c7412c5a65996c30442ebe6ed3df335383"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:988635d122aaf2bdcef9e795435662bcd65b02f4f4c1ae37fbee7401c440b3a7"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cca3c2cdadb362116235fdbd411735de4328c61425b0aa9f872fd76d02c4e86"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d52a25136894c63de15a35bc0bdc5adb4b0e173b9c0d07a2be9d3ca64a332735"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40e7bc81c9e2b2734ea4bc1aceb8a8f0ceaac7c5299bc5d69e37c44d9081d43b"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b9b7a708dd92306328117d8c4b62e2194d00c365f18eff11a9b53c6f923b01e3"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6a9a25751acb379b466ff6be78a315e2b439d4c94c1e99cb7266d40a537995d3"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:34aa51c45f28ba7f12accd624225e2b1e5a3a45206aa191f6f9aac931d9d56fe"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-win32.whl", hash = "sha256:dee0ce50c6a2dd9056c20db781e9c1cfd33e77d2d569f5d1d9321c641bb903d5"},
|
||||
{file = "wrapt-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:dee60e1de1898bde3b238f18340eec6148986da0455d8ba7848d50470a7a32fb"},
|
||||
{file = "wrapt-1.14.1.tar.gz", hash = "sha256:380a85cf89e0e69b7cfbe2ea9f765f004ff419f34194018a6827ac0e3edfed4d"},
|
||||
]
|
@ -1,21 +1,86 @@
|
||||
[tool.poetry]
|
||||
####################
|
||||
# Metadata #
|
||||
####################
|
||||
|
||||
[project]
|
||||
name = "waka-readme"
|
||||
version = "0.1.6"
|
||||
version = "0.3.0"
|
||||
description = "Wakatime Weekly Metrics on your Profile Readme."
|
||||
authors = ["Athul Cyriac Ajay <athul8720@gmail.com>"]
|
||||
license = "MIT"
|
||||
authors = [{ name = "Athul Cyriac Ajay", email = "athul8720@gmail.com" }]
|
||||
license = { text = "MIT" }
|
||||
readme = "README.md"
|
||||
keywords = ["readme", "profile-page", "wakatime"]
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Programming Language :: Python",
|
||||
"Typing :: Typed",
|
||||
]
|
||||
requires-python = ">=3.12"
|
||||
dependencies = ["faker>=21.0.0", "pygithub>=2.1.1", "requests>=2.31.0", "py-gitea>=0.2.6"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.10"
|
||||
requests = "^2.28.1"
|
||||
PyGithub = "^1.55"
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/athul/waka-readme"
|
||||
Documentation = "https://github.com/athul/waka-readme#readme"
|
||||
Repository = "https://github.com/athul/waka-readme"
|
||||
Changelog = "https://github.com/athul/waka-readme/commits/master"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
autopep8 = "^1.6.0"
|
||||
pylint = "^2.14.5"
|
||||
python-dotenv = "^0.20.0"
|
||||
loguru = "^0.6.0"
|
||||
#############################
|
||||
# Optional Dependencies #
|
||||
#############################
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
[project.optional-dependencies]
|
||||
extra = ["loguru>=0.7.2", "python-dotenv>=1.0.0"]
|
||||
|
||||
#############################
|
||||
# Development Dependencies #
|
||||
#############################
|
||||
|
||||
[tool.pdm.dev-dependencies]
|
||||
tooling = ["bandit>=1.7.6", "black>=23.12.1", "ruff>=0.1.9", "pyright>=1.1.342"]
|
||||
|
||||
####################
|
||||
# Configurations #
|
||||
####################
|
||||
|
||||
[tool.bandit]
|
||||
exclude_dirs = [".github", "tests", ".venv", ".vscode"]
|
||||
|
||||
[tool.black]
|
||||
line-length = 100
|
||||
target-version = ["py312"]
|
||||
|
||||
[tool.pyright]
|
||||
exclude = ["**/__pycache__", ".venv/"]
|
||||
pythonVersion = "3.12"
|
||||
pythonPlatform = "All"
|
||||
typeCheckingMode = "strict"
|
||||
|
||||
[tool.ruff]
|
||||
select = [
|
||||
# Pyflakes
|
||||
"F",
|
||||
# pycodestyle
|
||||
"W",
|
||||
"E",
|
||||
# mccabe
|
||||
# C90
|
||||
# isort
|
||||
"I",
|
||||
# pep8-naming
|
||||
"N",
|
||||
# pydocstyle
|
||||
"D",
|
||||
]
|
||||
line-length = 100
|
||||
target-version = "py312"
|
||||
extend-exclude = ["**/__pycache__"]
|
||||
|
||||
[tool.ruff.isort]
|
||||
# case-sensitive = true
|
||||
combine-as-imports = true
|
||||
force-sort-within-sections = true
|
||||
force-wrap-aliases = true
|
||||
relative-imports-order = "closest-to-furthest"
|
||||
|
||||
[tool.ruff.pydocstyle]
|
||||
convention = "google"
|
||||
|
@ -1,6 +1,4 @@
|
||||
"""
|
||||
Initialize test module
|
||||
"""
|
||||
"""Initialize test module."""
|
||||
|
||||
# standard
|
||||
import logging
|
||||
|
@ -1,18 +1,20 @@
|
||||
'''
|
||||
Tests for the main.py
|
||||
'''
|
||||
"""Unit Tests."""
|
||||
|
||||
# standard
|
||||
from dataclasses import dataclass # , field
|
||||
from importlib import import_module
|
||||
from dataclasses import dataclass
|
||||
from itertools import product
|
||||
# from inspect import cleandoc
|
||||
# from json import loads
|
||||
import unittest
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
# from pathlib import Path
|
||||
# from inspect import cleandoc
|
||||
# from typing import Any
|
||||
# from json import load
|
||||
|
||||
try:
|
||||
prime = import_module('main')
|
||||
prime = import_module("main")
|
||||
# works when running as
|
||||
# python -m unittest discover
|
||||
except ImportError as err:
|
||||
@ -22,68 +24,75 @@ except ImportError as err:
|
||||
|
||||
@dataclass
|
||||
class TestData:
|
||||
"""Test Data"""
|
||||
"""Test Data."""
|
||||
|
||||
# for future tests
|
||||
# waka_json: dict | None = None
|
||||
bar_percent: tuple[float] | None = None
|
||||
graph_blocks: tuple[str] | None = None
|
||||
waka_graphs: tuple[list[str]] | None = None
|
||||
dummy_readme: str = ''
|
||||
# waka_json: dict[str, dict[str, Any]] = field(
|
||||
# default_factory=lambda: {}
|
||||
# )
|
||||
bar_percent: tuple[int | float, ...] | None = None
|
||||
graph_blocks: tuple[str, ...] | None = None
|
||||
waka_graphs: tuple[list[str], ...] | None = None
|
||||
dummy_readme: str = ""
|
||||
|
||||
def populate(self) -> None:
|
||||
"""Populate Test Data"""
|
||||
"""Populate Test Data."""
|
||||
# for future tests
|
||||
# with open(file='tests/sample_data.json', mode='rt', encoding='utf-8') as wkf:
|
||||
# self.waka_json = loads(wkf.read())
|
||||
# with open(
|
||||
# file=Path(__file__).parent / "sample_data.json",
|
||||
# encoding="utf-8",
|
||||
# mode="rt",
|
||||
# ) as wkf:
|
||||
# self.waka_json = load(wkf)
|
||||
|
||||
self.bar_percent = (
|
||||
0, 100, 49.999, 50, 25, 75, 3.14, 9.901, 87.334, 87.333, 4.666, 4.667
|
||||
)
|
||||
self.bar_percent = (0, 100, 49.999, 50, 25, 75, 3.14, 9.901, 87.334, 87.333, 4.666, 4.667)
|
||||
|
||||
self.graph_blocks = ("░▒▓█", "⚪⚫", "⓪①②③④⑤⑥⑦⑧⑨⑩")
|
||||
|
||||
self.waka_graphs = ([
|
||||
"░░░░░░░░░░░░░░░░░░░░░░░░░",
|
||||
"█████████████████████████",
|
||||
"████████████▒░░░░░░░░░░░░",
|
||||
"████████████▓░░░░░░░░░░░░",
|
||||
"██████▒░░░░░░░░░░░░░░░░░░",
|
||||
"██████████████████▓░░░░░░",
|
||||
"▓░░░░░░░░░░░░░░░░░░░░░░░░",
|
||||
"██▒░░░░░░░░░░░░░░░░░░░░░░",
|
||||
"██████████████████████░░░",
|
||||
"█████████████████████▓░░░",
|
||||
"█░░░░░░░░░░░░░░░░░░░░░░░░",
|
||||
"█▒░░░░░░░░░░░░░░░░░░░░░░░"
|
||||
],
|
||||
self.waka_graphs = (
|
||||
[
|
||||
"⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪",
|
||||
"⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪"
|
||||
],
|
||||
"░░░░░░░░░░░░░░░░░░░░░░░░░",
|
||||
"█████████████████████████",
|
||||
"████████████▒░░░░░░░░░░░░",
|
||||
"████████████▓░░░░░░░░░░░░",
|
||||
"██████▒░░░░░░░░░░░░░░░░░░",
|
||||
"██████████████████▓░░░░░░",
|
||||
"▓░░░░░░░░░░░░░░░░░░░░░░░░",
|
||||
"██▒░░░░░░░░░░░░░░░░░░░░░░",
|
||||
"██████████████████████░░░",
|
||||
"█████████████████████▓░░░",
|
||||
"█░░░░░░░░░░░░░░░░░░░░░░░░",
|
||||
"█▒░░░░░░░░░░░░░░░░░░░░░░░",
|
||||
],
|
||||
[
|
||||
"⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑤⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑤⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩③⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑧⓪⓪⓪⓪⓪⓪",
|
||||
"⑧⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑤⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑧⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑧⓪⓪⓪",
|
||||
"⑩②⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩②⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪"
|
||||
])
|
||||
"⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪",
|
||||
"⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪",
|
||||
"⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
"⚫⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪",
|
||||
],
|
||||
[
|
||||
"⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑤⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑤⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩③⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑧⓪⓪⓪⓪⓪⓪",
|
||||
"⑧⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑤⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑧⓪⓪⓪",
|
||||
"⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑩⑧⓪⓪⓪",
|
||||
"⑩②⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
"⑩②⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪",
|
||||
],
|
||||
)
|
||||
|
||||
# self.dummy_readme = cleandoc("""
|
||||
# My Test Readme Start
|
||||
@ -94,41 +103,43 @@ class TestData:
|
||||
|
||||
|
||||
class TestMain(unittest.TestCase):
|
||||
"""Testing Main Module"""
|
||||
"""Testing Main Module."""
|
||||
|
||||
def test_make_graph(self) -> None:
|
||||
"""Test graph maker"""
|
||||
"""Test graph maker."""
|
||||
if not tds.graph_blocks or not tds.waka_graphs or not tds.bar_percent:
|
||||
raise AssertionError("Data population failed")
|
||||
|
||||
for (idx, grb), (jdy, bpc) in product(
|
||||
enumerate(tds.graph_blocks), enumerate(tds.bar_percent)
|
||||
):
|
||||
self.assertEqual(
|
||||
prime.make_graph(grb, bpc, 25),
|
||||
tds.waka_graphs[idx][jdy]
|
||||
)
|
||||
self.assertEqual(prime.make_graph(grb, bpc, 25), tds.waka_graphs[idx][jdy])
|
||||
|
||||
def test_make_title(self) -> None:
|
||||
"""Test title maker"""
|
||||
"""Test title maker."""
|
||||
self.assertRegex(
|
||||
prime.make_title('2022-01-11T23:18:19Z', '2021-12-09T10:22:06Z'),
|
||||
r'From: \d{2} \w{3,9} \d{4} - To: \d{2} \w{3,9} \d{4}'
|
||||
prime.make_title("2022-01-11T23:18:19Z", "2021-12-09T10:22:06Z"),
|
||||
r"From: \d{2} \w{3,9} \d{4} - To: \d{2} \w{3,9} \d{4}",
|
||||
)
|
||||
|
||||
# Known test limits
|
||||
# # prep_content() and churn():
|
||||
# requires additional modifications such as changing
|
||||
# globally passed values to parametrically passing them
|
||||
# # fetch_stats(): would required HTTP Authentication
|
||||
def test_strtobool(self) -> None:
|
||||
"""Test string to bool."""
|
||||
self.assertTrue(prime.strtobool("Yes"))
|
||||
self.assertFalse(prime.strtobool("nO"))
|
||||
self.assertTrue(prime.strtobool(True))
|
||||
self.assertRaises(AttributeError, prime.strtobool, None)
|
||||
self.assertRaises(ValueError, prime.strtobool, "yo!")
|
||||
self.assertRaises(AttributeError, prime.strtobool, 20.5)
|
||||
|
||||
|
||||
tds = TestData()
|
||||
tds.populate()
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
sys.path.insert(0, os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), '..')
|
||||
))
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
import main as prime
|
||||
|
||||
# works when running as
|
||||
# python tests/test_main.py
|
||||
except ImportError as im_er:
|
||||
|
Loading…
x
Reference in New Issue
Block a user