Skip to main content

wikivoyage

Consume Wikivoyage into pure (elegant) Markdown. Probably.

$ pip install wikivoyage

Usage

Just do what you want.

import wikivoyage

# Learn about the States
res = wikivoyage.get("https://en.wikivoyage.org/wiki/United_States_of_America")
print(res)
WikivoyageSections(
    url='https://en.wikivoyag…',
    sections=[
        Section(
            title='United States of America', 
            content='The **United States of America** spans a continent…'
        ), 
        Section(
            title='Regions', 
            content="Wikivoyage organizes the 50 states and the nation'…"
        ), 
        Section(
            title='Cities', 
            content='The following is a list of nine of the most notabl…'
        ),
        ...
    ]
)

Super simple.

Why?

I'm initially an "i-aint-reading-allat" person, thus I made this project so I can better categorize all the sections from a Wikivoyage page, feed it to an LLM and summarize it for me.

Check out where-next, a Next.JS project created by me to learn more.

API Reference

The juicy API reference. Press CTRL + F to search for what you need or type directly in the search bar if you're on mobile.

def get()

get(url: str, **requests_kwargs) -> WikivoyageSections

Fetches a Wikivoyage page and parses it into Markdown.

Args:

  • url (str): The URL.
  • **requests_kwargs: Keyword-only arguments to pass into requests.get.

Returns:
WikivoyageSections: Wikivoyage sections.

dataclass WikivoyageSections

Represents all the Wikivoyage sections. (manually-created)

class WikivoyageSections:
    url: str  # The request URL
    sections: List[Section]  # Sections

dataclass Section

Repersents a Wikivoyage section. (manually-created)

class Section:
    title: str  # The title. Alias: `section`
    content: str  # The content. Alias: `markdown`

Contributing

Contributions are welcome! And yes, I'm not really familiar with GitHub so please help me.

License

MIT License.

Metadata

Release files for wikivoyage 0.2

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

Source distribution (sdist)

Source distribution for wikivoyage 0.2
File Size Uploaded Provenance
wikivoyage-0.2.tar.gz 5.2 kB Without provenance Details

Release files / wikivoyage-0.2.tar.gz

Download URL wikivoyage-0.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2e64f8ce74a61a9f61b8ad01d564357985eb066a4a21e65aa28588abe81a2a0c
BLAKE2b-256 checksum
How to use checksums
12971f1c2fa19fd3f5edaa72a1356da563037017d61649357c5bed6e6bba44a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for wikivoyage 0.2

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

0.2 This release

1 release file 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