Metadata-Version: 2.4
Name: consumo
Version: 0.1.0
Summary: Content consumption analyzer CLI
Author: Gabriel Santos de Souza
Author-email: Gabriel Santos de Souza <gabriel.santosdesouza@dcomp.ufs.br>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Requires-Dist: av>=16.1.0
Requires-Dist: brotli>=1.2.0
Requires-Dist: bs4>=0.0.2
Requires-Dist: pydantic>=2.12.5
Requires-Dist: pymupdf>=1.27.1
Requires-Dist: trafilatura>=2.0.0
Requires-Dist: typer>=0.24.0
Requires-Dist: yt-dlp>=2026.2.21
Requires-Dist: zstandard>=0.25.0
Requires-Python: >=3.12
Project-URL: Bug Tracker, https://github.com/gs-101/consumo/issues
Project-URL: Source Code, https://github.com/gbr-ufs/consumo
Description-Content-Type: text/markdown

# consumo

***Content consumption analyzer CLI***

# Summary

`consumo` is a CLI built with [Typer](https://typer.tiangolo.com/) that calculates the time to consume some form of content using the [Medium formula](https://mediumcourse.com/how-is-medium-article-read-time-calculated/).

# Supported Arguments

`consumo` is meant to primarily be used with a text file full of URLs, through the `list` subcommand. Basically, files that look like this:

```text
https://github.com/gbr-ufs/pf
https://github.com/gbr-ufs/cses
https://github.com/gbr-ufs/notes
https://github.com/gbr-ufs/ies
https://github.com/gbr-ufs/hack-ia-mockup
https://github.com/gbr-ufs/probabilidade-detran-se
https://github.com/gbr-ufs/hello-r-markdown
```

## File Types

- [audio](https://www.iana.org/assignments/media-types/media-types.xhtml#audio).
- [text](https://www.iana.org/assignments/media-types/media-types.xhtml#text).

## URLs

`consumo` supports any kind of URL. [YouTube](https://www.youtube.com/) links are treated differently: passing a YouTube link to `consumo` returns its length.

# Usage

```sh
consumo file FILE --output FILE --sort
```

```sh
consumo list FILE --output FILE --sort
```

```sh
consumo url TEXT --output FILE --sort
```

# Skills

By developing this project, I demonstrate that I know:

- [Git](https://git-scm.com).
- [GitHub](https://github.com).
- [Markdown](https://daringfireball.net/projects/markdown).
- [Python](https://www.python.org/).

## Python

- [av](https://pyav.org/docs/stable/).
- [bs4](https://beautiful-soup-4.readthedocs.io/en/latest/).
- [pre-commit](https://pre-commit.com/).
- [pydantic](https://docs.pydantic.dev/latest/).
- [pyinstaller](https://pyinstaller.org/en/stable/).
- [pymupdf](https://pymupdf.io/).
- [pytest](https://docs.pytest.org/en/stable/).
- [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/index.html).
- [rich](https://rich.readthedocs.io/en/stable/introduction.html).
- [ruff](https://docs.astral.sh/ruff/).
- [trafilatura](https://trafilatura.readthedocs.io/en/latest/index.html).
  - [brotli](https://github.com/google/brotli).
  - [faust-cchardet](https://github.com/PyYoshi/cChardet).
  - [python-zstandard](https://github.com/indygreg/python-zstandard).
- [ty](https://docs.astral.sh/ty/).
- [typer](https://typer.tiangolo.com/).
- [uv](https://docs.astral.sh/uv/).
- [yt-dlp](https://github.com/yt-dlp/yt-dlp).
- [zensical](https://zensical.org/).

## Additional Skills

- [commitizen](https://commitizen-tools.github.io/commitizen/).
- [Development Containers](https://containers.dev/).
- [direnv](https://direnv.net/).
- [EditorConfig](https://editorconfig.org/).
- [GitHub Actions](https://docs.github.com/en/actions).
- [MIME Types](https://www.iana.org/assignments/media-types/media-types.xhtml).
- [Nix](https://nixos.org/).

## Philosophies

- Dependency Injection.[^1]
- [Parse, don't validate](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/).
- Test Driven Development.[^1]

[^1]: Used for the HTML variant of `calculate_consumption_time` so the URL variant can reuse it. This is done in the `video_duration_resolver` parameter.
[^2]: Beck, K. (2003) Test-driven development: By example. Boston: Addison-Wesley (The Addison-Wesley signature series).
