Skip to main content

CLI to find an optimal, personal schedule for the 38c3 congress.

Project description

Optimal Congress

Python PyPI Pytest pre-commit

Command Line Interface to find an optimal, personal schedule for the 38c3 congress.

Optimization logic

The optimization relies on a simple 2-fold logic:

  1. Find a personal schedule that maximizes the sum of 'rating scores' assigned to scheduled events.
  2. The schedule must be feasible, i.e. the times of scheduled events must not overlap.

Installation

pip install optimal-congress

With nix, you can run this application directly (contact kaesaecracker if this does not work):

nix run github:top-on/optimal-congress

Available commands

optimal-congress provides the following commands:

$ optimal-congress -h

 Usage: optimal-congress [OPTIONS] COMMAND [ARGS]...

 Optimize your personal schedule for the 38c3.

╭─ Options ────────────────────────────────────────────────────────────────────────────╮
│ --verbose  -v        Include debug messages in output.                               │
│ --help     -h        Show this message and exit.                                     │
╰──────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────╮
│ fetch                  Fetch events and rooms from API, and update local cache.      │
│ rate                   Interactively rate those events that have not been rated yet. │
│ ratings                List all latest ratings.                                      │
│ optimize               Optimize the schedule based on ratings.                       │
│ next                   List next upcoming events, filtered by minimum rating.        │
│ dump                   Export all latest ratings to CSV, for bulk editing.           │
│ load                   Bulk import ratings from CSV.                                 │
│ version                Print version and exit.                                       │
╰──────────────────────────────────────────────────────────────────────────────────────╯

Example Workflow

  1. Fetch events and rooms from congress API:
$ optimal-congress fetch

Fetching events and rooms from API...
Fetched 49 events and 58 rooms from API.

Comparing API with cache...
Found 0 new events, and 0 removed events.

Updating cache...
Done.
  1. Interactively rate events, if not already rated:
$ optimal-congress rate

Unrated event (1/65):

2023-12-28 20:15 - 20:55

Lützerath Lebt! Einblicke in den Widerstand

You can't evict a movement! Der Energiekonzern RWE wird noch Jahre brauchen, die Kohle unter Lützi abzubaggern: Der Kampf gegen die Kohle und für Klimagerechtigkeit geht weiter!

https://events.ccc.de/congress/2023/hub/en/event/lutzerath_lebt_einblicke_in_den_widerstand

Rate from 0 to 10 (Enter to exit):
  1. Review you current ratings:
$ optimal-congress ratings

loading events and ratings from cache...

Latest ratings:
- Rating: 8.0 - Amateurfunk als Hilfe in Not- und Katastrophenfäll..https://events.ccc.de/congress/2023/hub/en/event/amateurfunk-als-hilfe-in-not-und-katastrophenfalle
- Rating: 8.0 - InfraNodus: Reveal Non-Obvious and Find the Gaps w..https://events.ccc.de/congress/2023/hub/en/event/infranodus-reveal-non-obvious-and-find-the-gaps-wi
  1. Optimize your personal schedule:
$ optimal-congress optimize

loading events, ratings, and rooms from cache...

Scheduled events:
- Wed 27 10:30-11:00 Saal 1..........37C3: Feierliche Eröffnung................https://events.ccc.de/congress/2023/hub/en/event/37c3_feierliche_eroffnung
- Wed 27 11:00-11:40 Saal Granville..The Trouble with Green Electricity Certi..https://events.ccc.de/congress/2023/hub/en/event/the_trouble_with_green_electricity_certificates
...

Testing

Testing of this library relies on pytest. Tests are split into unit tests (tests/unit) and integration tests (tests/integration).

To run all tests, use: poetry run pytest

Note that the unit tests are executed automatically in the CI pipeline (see .github/workflows/pytest.yml).

Long-term Roadmap

  • add latest UI examples to README
  • use rich table for next view
  • output more/all information with associated events (see feature request and example for more compact hyperlinks with rich)
  • change rating scheme, to minimize effort and maximize flexibility (see feature request),
    e.g. by first marking favorites, and only requiring relative ratings for conflicting favorites
  • test export of schedule to iOS app via QR code (same format as halfnarp)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optimal_congress-1.2.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optimal_congress-1.2.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file optimal_congress-1.2.0.tar.gz.

File metadata

  • Download URL: optimal_congress-1.2.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.2.0

File hashes

Hashes for optimal_congress-1.2.0.tar.gz
Algorithm Hash digest
SHA256 ef6904c29be5d5fc0557206b8856b88a1f350c14f550bc7e72f5c7229624c418
MD5 5d10cc8e85c81a9801ca95ad1ebac89e
BLAKE2b-256 a13dac001ed5b26bb55c287d682afae6e2506cf8909e0a70c5fc9a8683751ce1

See more details on using hashes here.

File details

Details for the file optimal_congress-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: optimal_congress-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.2.0

File hashes

Hashes for optimal_congress-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 434e3207f9b5ca80d6f9cb35ebe5a7710833b7374a9adc9d35d5f484693d8462
MD5 f035308c1823f446f29f09c8f5bb4c87
BLAKE2b-256 a5fd2ff1b31e345cdda564fb7bad3da410fa2ffa3436f37a0d8abdff49e14da1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page