Skip to main content

EventScraper

A project dedicated to scrapping events and posting them on different platforms for searching. Unbinding posted events from any single platform to help illuminate what is locally happening.

Can be imported as a library in a python script or used directly through a docker container.

Docker Image

Env Variables

Mobilizon Related Variables:

  • MOBILIZON_ENDPOINT: Graphql endpoint for your mobilizon instance

  • MOBILIZON_EMAIL: User email

  • MOBILIZON_PASSWORD: User password

OS Related Variables:

  • USER_ID: User process ID for running the application

  • GROUP_ID: Group process ID for running the application

Misc:

  • RUNNER_SUBMISSION_JSON_PATH: Remote submission file that tells where to publish and what group packages to use for sources.

  • SLACK_WEBHOOK: Slack token to give notifications on how the scraping process is going and whether any maintenance is required.


Docker Volumes

/app/config:[HOST DIR] -- The files needed within this config folder are "token.json" if you happen to use the Google Calendar scraper. Please follow instructions on the wiki page to create this "token.json" file.


Library: publishing to several sites

start_event_engine can publish to more than one destination, picking one per event. For example, two Mobilizon instances: a family-friendly site and a nightlife site.

  1. Tag each source in its group package JSON. Any key of a groupKernels entry that the engine doesn't use itself is kept on the kernel as kernel.source_info:
"groupKernels": {
  "Sea Tea Improv": {
    "family_friendly": false,
    "calendarType": "ICAL",
    "calendarIDs": ["https://example.com/calendar.ics"],
    "...": "..."
  }
}
  1. Create one publisher per site, and a function that returns the name of the publisher each event goes to (or None to skip it):
from calendar_event_engine.Runner import start_event_engine
from calendar_event_engine.db.db_cache import SQLiteDB
from calendar_event_engine.publishers.mobilizon.uploader import MobilizonUploader

with SQLiteDB() as cache_db:
    publishers = {
        "ctgrassroots": MobilizonUploader(
            False,
            cache_db,
            endpoint="https://ctgrassroots.org/api",
            email="...",
            password="...",
        ),
        "underground": MobilizonUploader(
            False,
            cache_db,
            endpoint="https://underground.example/api",
            email="...",
            password="...",
        ),
    }
    route_event = lambda event, kernel: (
        "ctgrassroots" if kernel.source_info.get("family_friendly") else "underground"
    )
    start_event_engine(
        "https://example.com/submission.json",
        cache_db,
        publishers=publishers,
        route_event=route_event,
        custom_scrapers=[...],  # optional: a plain list of CustomScraperJob
    )

How it behaves:

  • publishers replaces the publisher built from the submission JSON's key; the submission still lists the group packages to scrape.
  • MobilizonUploader uses endpoint, email and password when given, and falls back to MOBILIZON_ENDPOINT, MOBILIZON_EMAIL/MOBILIZON_PASSWORD or MOBILIZON_LOGIN_FILE for any that are None.
  • Events routed to None, or to a name that isn't in publishers, are logged and skipped. Skipped events aren't cached, so they are tried again next run.
  • Every publisher is connected and closed once per scrape cycle. If one can't connect, its events are skipped for that cycle and the others still publish.
  • With a single publisher, route_event is optional. With several, it is required (the engine raises ValueError at startup otherwise).
  • Without publishers or route_event, everything works as before.

Metadata

Release files for calendar_event_engine 0.5.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 calendar_event_engine 0.5.0
File Size Uploaded Provenance Actions
calendar_event_engine-0.5.0.tar.gz 538.0 kB Without provenance Details for calendar_event_engine-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for calendar_event_engine 0.5.0
File Interpreter ABI Platform Actions
calendar_event_engine-0.5.0-py3-none-any.whl Python 3 none any Details for calendar_event_engine-0.5.0-py3-none-any.whl

Total release size: 587.0 kB

Release files / calendar_event_engine-0.5.0.tar.gz

Download URL calendar_event_engine-0.5.0.tar.gz
Size 538.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e47362a974dd3ca9539799b637c9fb17c8ac1401e4c18fbf8b5e0e5d168cfd53
BLAKE2b-256 checksum
How to use checksums
017b6607e2ac9c324fa59a094ed5b2623794691dd8e60f38aace2e738072864c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / calendar_event_engine-0.5.0-py3-none-any.whl

Download URL calendar_event_engine-0.5.0-py3-none-any.whl
Size 48.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc12c500e36563bc386b51a55471349452b863e4c9854c6c801249022b35799b
BLAKE2b-256 checksum
How to use checksums
0916f846057589e23b971701480b25794a497e97c86bf5ec96b5c5ef87ef87ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for calendar_event_engine 0.5.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.

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