Skip to main content

krogoco-calendar

PyPI version PyPI pyversions PyPI license

A Python library that scrapes Krog&Co calendar pages and converts them to iCalendar (ICS) files.

Full documentation: https://jonnybergdahl.github.io/krogoco-calendar/

Installation

pip install krogoco-calendar

Python 3.10 or newer is required.

For development, clone the repository and install locally:

git clone https://github.com/jonnybergdahl/Python-krogoco-calendar.git
cd Python-krogoco-calendar
pip install -e ".[dev]"

Usage

from krogoco_calendar import KrogocoIcs

scraper = KrogocoIcs(
    url="https://krogoco.se/jonkoping/kalender/",
    months=2,
)

# Get ICS as a string
ics_data = scraper.get_ics()

# Or write directly to a file
scraper.write_ics("krogoco.ics")

Blacklist

You can filter out events by providing a blacklist of keywords. Events whose title contains any of the keywords (case-insensitive) will be excluded:

scraper = KrogocoIcs(
    url="https://krogoco.se/jonkoping/kalender/",
    months=2,
    blacklist=["HV71", "SHL", "match"],
)

Supported locations

The library works with any Krog & Co location that uses the same calendar page structure:

  • https://krogoco.se/jonkoping/kalender/
  • https://krogoco.se/halmstad/kalender/

Time format handling

Event times are extracted automatically from Swedish title formats:

Format Example Parsed as
Full range 12.00-16.00 12:00 - 16:00
Short range Kl.12-17 12:00 - 17:00
Bare hour range Sliver nattklubb 22-03 22:00 - 03:00 (next day)
Single time Kl.17.00 or Från 21:00 17:00 / 21:00
Time with hint Kl.22.00, 23+ 22:00 - 23:00
No time Studentfest All-day event

Running tests

pytest

Publishing

build.sh runs the tests, builds the docs and pushes them to jonnybergdahl.github.io, then builds the package and uploads it to PyPI. Bump __version__ in src/krogoco_calendar/__init__.py first.

License

MIT

Metadata

Release files for krogoco-calendar 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for krogoco-calendar 1.0.0
File Size Uploaded Provenance Actions
krogoco_calendar-1.0.0.tar.gz 10.9 kB Without provenance Details for krogoco_calendar-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for krogoco-calendar 1.0.0
File Interpreter ABI Platform Actions
krogoco_calendar-1.0.0-py3-none-any.whl Python 3 none any Details for krogoco_calendar-1.0.0-py3-none-any.whl

Total release size: 18.8 kB

Release files / krogoco_calendar-1.0.0.tar.gz

Download URL krogoco_calendar-1.0.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8137368e572472d51babaaca154616bda5603374e88f9cef23c828ba3f26f11e
BLAKE2b-256 checksum
How to use checksums
812433e608f783dcb4abc854e84228cdab0728bbfd292d4146cf2fa2f1ba28b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / krogoco_calendar-1.0.0-py3-none-any.whl

Download URL krogoco_calendar-1.0.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b11c855052742ec648fbb3f14c49e6c909ecfee41862b74a56dd3a60d86dea53
BLAKE2b-256 checksum
How to use checksums
d63a77a0ebf15e60c6bd7970bec45e655694ce3e8c2dc30c2d9cad714b9c44c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Security for krogoco-calendar 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page