magnusmanske / mediawiki_rust

Rust API interface for MediaWiki sites.
Apache License 2.0
34 stars 16 forks source link

Future direction? #39

Open legoktm opened 3 years ago

legoktm commented 3 years ago

Hi Magnus,

First, thanks for working on this crate - it is a great foundation and all of my tools so far use it.

I started writing some more advanced bots last week using this crate as the base and felt like I was missing stuff that I've come to expect from using Pywikibot for so many years. IMO, right now the crate takes care of the basics for login, token handling, and simple objects for titles, getting page text and other properties like links, external links, coordinates, editing, etc. But there's no high level error types, credential storage/handling, automatic retries, logging, other actions like page moving, deletion, protection and so on. And then there's stuff like {{nobots}} handling which is solely for bots and not other MW API consumers.

What do you see the scope of this crate as being? Are more bot-like functions and high-level types welcome contributions? Or would you see those go in a higher level "wikibot" crate that builds on top of this one? Something in the middle?

I don't want to step on any toes nor duplicate any work, but this is something I'd like to work on to make adopting Rust even easier.

Thanks!

P.S. I (along with @enterprisey) am starting a Wikimedia Rust developers user group, which you are definitely invited to join, that we hope will work on issues like this.

magnusmanske commented 3 years ago

Hi @legoktm,

thanks! I haven't actually worked a lot with PyWikiBot, but I heard very good things about it. I think there is definitely room for a bot "part" in this crate, though if we want to cover the wikibase one as well, maybe a separate crate would avoid circular "references" (not really an issue but somehow cleaner?).

I need to fix the conflicts in your PR.

Someone suggested building Rust code for API replies based on the API man pages at api.php but I couldn't find the data source these are generated from.

Please feel free to put PRs! I think Rust is ideal for mid/large-level bot operations on MediaWiki.

I have joined the user group, and look forward to the first meetup!

magnusmanske commented 1 year ago

TO keep a record, I found some API definitions as JSON: https://en.wikipedia.org/w/api.php?format=json&action=paraminfo&modules=query

See also: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&generator=categories&titles=Albert%20Einstein&prop=info