semvec/pypi-packages huggingface dataset:
yfantasy-api 0.0.6
Python package to access the Yahoo! Fantasy APIs
Requires Python: >=3.6

# Yahoo Fantasy API
> A simply Python client that can be used to make calls to the Yahoo! Fantasy Sports API.

![Python package](https://github.com/hkyplyr/yfantasy-api/workflows/Python%20package/badge.svg)

This library provides a fluent API to build and make calls to the Yahoo! Fantasy Sports API. It was developed specifically for NHL use initially, but should be generic enough to support MLB, NBA, and NFL as well.

## Installation
``` sh
pip install yfantasy_api
```

## Usage examples
### Obtain team information, including the roster with player stats for March 31st 2021
``` python
# The request url created is: /team/nhl.l.12345.t.1/roster/players/stats;type=date;date=2021-03-31
from yfantasy_api import YahooFantasyApi

league_id = 12345  # This should be the id of the league you are querying
game_id = 'nhl'    # This should be the id of the game you are querying
team_id = 1        # This should be the id of the team you are querying

api = YahooFantasyApi(league_id, game_id)
team = api \
    .team(team_id) \
    .roster() \
    .stats(date='2021-03-31') \
    .get()

for player in team.players:
    print(player.full_name, player.points)

# Output:
# Brock Nelson 0.00
# Joel Eriksson Ek 0.05
# Nazem Kadri 4.00
# Alex Ovechkin 0.00
# Jake Guentzel 0.00
# ...truncated for brevity...
```

### Obtain draft_results, including player information for each pick.
``` python
# The request url created is: /league/nhl.l.12345/draft_results/players
from yfantasy_api import YahooFantasyApi

league_id = 12345  # This should be the id of the league you are querying
game_id = 'nhl'    # This should be the id of the game you are querying
team_id = 1        # This should be the id of the team you are querying

api = YahooFantasyApi(league_id, game_id)
league = api \
    .league() \
    .draft_results() \
    .players() \
    .get()

for draft_result in league.draft_results:
    print(f'{draft_result.round} - {draft_result.pick} - {draft_result.player.full_name}')

# Output:
# 1 - 1 - Connor McDavid
# 1 - 2 - Alex Ovechkin
# 1 - 3 - Patrick Kane
# 1 - 4 - Steven Stamkos
# 1 - 5 - Sidney Crosby
# ...truncated for brevity...
```
For working examples of the above scenarios, see [examples.py](examples.py)

## Development setup
I suggest you use some form of virtual environment to avoid clashing dependencies, but that is obviously your call. My suggested virtual environment is [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/).
``` sh
git clone git@github.com:hkyplyr/yfantasy-api.git
...
cd yfantasy_api
...
pip install -r requirements.txt
```

## Release History
TODO

## Meta
Travis Paquette - [@hkyplyr](https://twitter.com/hkyplyr) - tpaqu15@gmail.com  
Distributed under the MIT license. See [`LICENSE`](LICENSE) for more information.
## How to Contribute
1. Clone repo and create a new branch: $ git checkout -b short_feature_name.
2. Make changes and test
3. Submit a Pull Request
mdbook-pdf-summary 0.1.1
Generate outline for pdf generated by `mdbook-pdf`.

## Introduction
Generate outline for pdf files generated using mdbook-pdf

## Motivation
### `mdbook-pdf` is good, but...
In [example](./example), I create a simple book, and I use `mdbook-pdf` as renderer to export `pdf` with outline.
```bash
cd example/a_book
docker run --rm -v $PWD:/book hollowman6/mdbook-pdf
```
You can see the generated `pdf` in `./example/a_book/book/pdf-outline/output.pdf`.

Also, you can see the generated `HTML` in `./example/a_book/book/html`

### Different outline

The sidebar of `HTML` is like: [html_outline](./data/html_outline.png), which is what I want.

The outline of pdf is like: [pdf_outline](./data/pdf_outline.png), a little bit different with html. Every heading in markdown file is shown in the outline, without any order.

### The reason
The pdf outline is generated by [mdbook_pdf_outline](https://github.com/HollowMan6/mdbook-pdf/blob/main/mdbook_pdf_outline/mdbook_pdf_outline.py). It base on the `print.html` rendered by HTML engine, and the outline is generated by `HTML Headings`, not `SUMMARY.md`. Therefore, if there are any headings in your markdown file, they will appear in the outline.

## Quick Start
### Install
```bash
pip3 install mdbook_pdf_summary
```
### Run
#### 1. Generate pdf 
```bash
pushd example/a_book
docker run --rm -v $PWD:/book hollowman6/mdbook-pdf
popd
```
#### 2. Generate outline based on  `SUMMARY.md`
```bash
mdbook-pdf-summary --html_path ./example/a_book/book/html/print.html --pdf_path ./example/a_book/book/pdf/output.pdf      --summary_path ./example/a_book/src/SUMMARY.md --output_path ./output_with_outline.pdf 
```

Or, use docker image:
```bash
docker run --rm -v $PWD:/book cmq2525/mdbook_pdf_summary --entrypoint mdbook-pdf-summary
```

The above command will generate `output_with_outline.pdf` in your `$WORKDIR`, the outline is like: [summary_outline](./data/summary_outline.png), same as `SUMMARY.md`