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

Select namespaces by name as well as number for dumpgenerator.py #393

Open
jrbray1 opened this issue Aug 9, 2020 · 2 comments
Open

Select namespaces by name as well as number for dumpgenerator.py #393

jrbray1 opened this issue Aug 9, 2020 · 2 comments

Comments

@jrbray1
Copy link

jrbray1 commented Aug 9, 2020

I was hoping to do a backup of a wiki with content, Category and Template namespaces only, to reduce size, and select the namespaces by keyword, something like

dumpgenerator.py --api=https://hornblower.fandom.com/api.php --xml --curonly --namespaces 0,Template,Category

But it expects numbers not names. I could hack something together by parsing the results of https://hornblower.fandom.com/api.php?action=query&meta=siteinfo&siprop=namespaces&formatversion=2, but it would seem easier if dumpgenerator did this for you. Have you considered doing this?

@nemobis
Copy link
Member

nemobis commented Aug 9, 2020 via email

@jrbray1
Copy link
Author

jrbray1 commented Aug 9, 2020

Not sure why the variety of namespace names is a problem, as https://www.mediawiki.org/wiki/Help:Namespaces talks about canonical namespaces in English and their foreign mappings. You could just support those canonical names and allow requests for 'Template' and 'Category'. This seems more robust that the user providing 10,14 and expecting that mapping is in place, but it would be just as easy with api parsing to allow a Frenchman to request --namespaces 0,Utilisateur, and not have to burrow into the api output to check what number that was.

Mediawiki documentation is all about names, not numbers.

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

No branches or pull requests

2 participants