Name | wikivoyage JSON |
Version |
0.2
JSON |
| download |
home_page | None |
Summary | Consume Wikivoyage pages into pure (elegant) Markdown. Probably. |
upload_time | 2024-05-11 13:00:12 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2024-PRESENT AWeirdDev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
wikivoyage
wikipedia
wiki
requests
info
markdown
selectolax
parser
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# wikivoyage
Consume [Wikivoyage](https://en.wikivoyage.org) into pure (elegant) Markdown. Probably.
```
$ pip install wikivoyage
```
## Usage
Just do what you want.
```python
import wikivoyage
# Learn about the States
res = wikivoyage.get("https://en.wikivoyage.org/wiki/United_States_of_America")
print(res)
```
```python
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](https://github.com/AWeirdDev/where-next), a Next.JS project created by me to learn more.
## API Reference
The juicy API reference. Press <kbd>CTRL + F</kbd> to search for what you need or type directly in the search bar if you're on mobile.
### <kbd>def</kbd> get()
```python
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**:<br />
WikivoyageSections: Wikivoyage sections.
### <kbd>dataclass</kbd> WikivoyageSections
Represents all the Wikivoyage sections. *(manually-created)*
```python
class WikivoyageSections:
url: str # The request URL
sections: List[Section] # Sections
```
### <kbd>dataclass</kbd> Section
Repersents a Wikivoyage section. *(manually-created)*
```python
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "wikivoyage",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "wikivoyage, wikipedia, wiki, requests, info, markdown, selectolax, parser",
"author": null,
"author_email": "AWeirdDev <aweirdscratcher@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/12/97/1f1c2fa19fd3f5edaa72a1356da563037017d61649357c5bed6e6bba44a8/wikivoyage-0.2.tar.gz",
"platform": null,
"description": "# wikivoyage\r\n\r\nConsume [Wikivoyage](https://en.wikivoyage.org) into pure (elegant) Markdown. Probably.\r\n\r\n```\r\n$ pip install wikivoyage\r\n```\r\n\r\n## Usage\r\n\r\nJust do what you want.\r\n\r\n```python\r\nimport wikivoyage\r\n\r\n# Learn about the States\r\nres = wikivoyage.get(\"https://en.wikivoyage.org/wiki/United_States_of_America\")\r\nprint(res)\r\n```\r\n\r\n```python\r\nWikivoyageSections(\r\n url='https://en.wikivoyag\u2026',\r\n sections=[\r\n Section(\r\n title='United States of America', \r\n content='The **United States of America** spans a continent\u2026'\r\n ), \r\n Section(\r\n title='Regions', \r\n content=\"Wikivoyage organizes the 50 states and the nation'\u2026\"\r\n ), \r\n Section(\r\n title='Cities', \r\n content='The following is a list of nine of the most notabl\u2026'\r\n ),\r\n ...\r\n ]\r\n)\r\n```\r\n\r\nSuper simple.\r\n\r\n## Why?\r\n\r\nI'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.\r\n\r\nCheck out [where-next](https://github.com/AWeirdDev/where-next), a Next.JS project created by me to learn more.\r\n\r\n## API Reference\r\n\r\nThe juicy API reference. Press <kbd>CTRL + F</kbd> to search for what you need or type directly in the search bar if you're on mobile.\r\n\r\n### <kbd>def</kbd> get()\r\n\r\n```python\r\nget(url: str, **requests_kwargs) -> WikivoyageSections\r\n```\r\n\r\nFetches a Wikivoyage page and parses it into Markdown.\r\n\r\n**Args**:\r\n- url (str): The URL.\r\n- \\*\\*requests_kwargs: Keyword-only arguments to pass into `requests.get`.\r\n\r\n**Returns**:<br />\r\nWikivoyageSections: Wikivoyage sections.\r\n\r\n### <kbd>dataclass</kbd> WikivoyageSections\r\n\r\nRepresents all the Wikivoyage sections. *(manually-created)*\r\n\r\n```python\r\nclass WikivoyageSections:\r\n url: str # The request URL\r\n sections: List[Section] # Sections\r\n```\r\n\r\n### <kbd>dataclass</kbd> Section\r\n\r\nRepersents a Wikivoyage section. *(manually-created)*\r\n\r\n```python\r\nclass Section:\r\n title: str # The title. Alias: `section`\r\n content: str # The content. Alias: `markdown`\r\n```\r\n\r\n## Contributing\r\n\r\nContributions are welcome! And yes, I'm not really familiar with GitHub so please help me.\r\n\r\n## License\r\n\r\nMIT License.\r\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024-PRESENT AWeirdDev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Consume Wikivoyage pages into pure (elegant) Markdown. Probably.",
"version": "0.2",
"project_urls": {
"Bug Tracker": "https://github.com/AWeirdScratcher/wikivoyage/issues",
"Source": "https://github.com/AWeirdScratcher/wikivoyage"
},
"split_keywords": [
"wikivoyage",
" wikipedia",
" wiki",
" requests",
" info",
" markdown",
" selectolax",
" parser"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "12971f1c2fa19fd3f5edaa72a1356da563037017d61649357c5bed6e6bba44a8",
"md5": "8d0c25c10d7b61dd49ac24dba466c3b0",
"sha256": "2e64f8ce74a61a9f61b8ad01d564357985eb066a4a21e65aa28588abe81a2a0c"
},
"downloads": -1,
"filename": "wikivoyage-0.2.tar.gz",
"has_sig": false,
"md5_digest": "8d0c25c10d7b61dd49ac24dba466c3b0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5209,
"upload_time": "2024-05-11T13:00:12",
"upload_time_iso_8601": "2024-05-11T13:00:12.364441Z",
"url": "https://files.pythonhosted.org/packages/12/97/1f1c2fa19fd3f5edaa72a1356da563037017d61649357c5bed6e6bba44a8/wikivoyage-0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-11 13:00:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AWeirdScratcher",
"github_project": "wikivoyage",
"github_not_found": true,
"lcname": "wikivoyage"
}