Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for variant #249

Merged
merged 8 commits into from
Jan 18, 2025

Conversation

martin-majlis
Copy link
Owner

@martin-majlis martin-majlis commented Jan 12, 2025

This PR is introducing support for language variants. You can now construct client as:

wiki_zh_tw = wikipediaapi.Wikipedia(user_agent, "zh", "zh-tw")
zh_page_tw = wiki_zh_tw.page("Python")
print(zh_page_tw.title + ": " + zh_page_tw.fullurl)
print(repr(zh_page_tw.varianttitles))

and fetch content in taiwanese mandarin.

Fixes #209

Copy link

codecov bot commented Jan 12, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.99%. Comparing base (1534c79) to head (b8ca892).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
wikipediaapi/__init__.py 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
+ Coverage   93.49%   93.99%   +0.50%     
==========================================
  Files           1        1              
  Lines         415      433      +18     
==========================================
+ Hits          388      407      +19     
+ Misses         27       26       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@XapaJIaMnu-at-meta
Copy link

XapaJIaMnu-at-meta commented Jan 13, 2025

Yes, Thank you! This is exactly what i wanted! It is true not all languages have variants (In fact, I think it's only Serbian and Chinese). Could you also add the example in the readme, pretty please (:

@martin-majlis martin-majlis merged commit b776ec1 into master Jan 18, 2025
37 of 38 checks passed
@martin-majlis martin-majlis deleted the 2025-01-05-add-support-for-variant branch January 18, 2025 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow specifying language variant
2 participants