Re: [pywikibot] Getting started with pywikibot

2020-10-24 Thread masti

Hi Larry,
ad 2.
yes. use -cat:categoryName or -catr:categoryName as generator.

look in pagegenarators.py script. It gives all generators you can use 
when starting script.


masti

On 19.08.2020 01:39, Larry Martell wrote:

On Mon, Aug 17, 2020 at 11:43 PM  wrote:

Hi Larry,

there are two way to use Pywikibot as a side package:
1. add a user-config.py in your /variant folder. A minimal sample can be found 
at 
https://gerrit.wikimedia.org/r/plugins/gitiles/pywikibot/core/+/88f22977fd186d888c4d9e8cbac11d76e87bd607/user-config.py.sample
2. or set a PYWIKIBOT_NO_USER_CONFIG environment variable to 1 or 2 to ignore 
user-config settings

The pwb.py script wrapper (as well as the generate_... scripts are available in 
directory mode only. You can get it including predefined scripts from nightly 
https://pywikibot.toolforge.org/ or as git repository from gerrit or from 
github clone https://github.com/wikimedia/pywikibot

Adding pwb.py and generate_user_files.py/generate_family_file.py to side 
oackage is still under development 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/560057

Seem our documentation is insufficient, sorry for that. If you have further 
questions do not hesitate to ask.


Thanks for the reply - this was very helpful. A couple more questions:

1. Is there any way to login with MFA? Our wiki requires either
choosing a number from an authenticator app or using a userid and
password and then entering a code which was texted.

2. Is there a way to get all pages within a category?

Thanks!
Larry


Am 17.08.2020 um 21:41 schrieb Larry Martell :

We have an internal wiki and I want to use pywikibot to get some data
from it. Installed it from pip but when I import it I get:

import pywikibot

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.7/site-packages/pywikibot/__init__.py",
line 25, in 
from pywikibot.bot import (
  File "/usr/local/lib/python3.7/site-packages/pywikibot/bot.py", line
105, in 
from pywikibot import config2 as config
  File "/usr/local/lib/python3.7/site-packages/pywikibot/config2.py",
line 373, in 
base_dir = get_base_dir()
  File "/usr/local/lib/python3.7/site-packages/pywikibot/config2.py",
line 367, in get_base_dir
raise RuntimeError(exc_text)
RuntimeError: No user-config.py found in directory '/vagrant'.

Looking here 
https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation#Configure_Pywikibot

I see a reference to pwb.py, but that does not exist in
/usr/local/lib/python3.7/site-packages/pywikibot.

What am I missing here?

Thanks!

___
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot

___
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot

___
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot



___
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot


[pywikibot] Getting started with pywikibot

2020-08-25 Thread Arshdeep Singh
Hello, I am Arshdeep Singh, I am new to open source and I want to
contribute to pywikibot. I've good experience with python. I've done
automation with selenium as well. Kindly help me to get started with
pywikibot.

-- 
Arshdeep Singh
https://github.com/arsh9806
https://www.hackerrank.com/arshdeep55singh
https://www.hackerearth.com/@arshdeep69

___
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot


Re: [pywikibot] Getting started with pywikibot

2020-08-18 Thread Larry Martell
On Mon, Aug 17, 2020 at 11:43 PM  wrote:
>
> Hi Larry,
>
> there are two way to use Pywikibot as a side package:
> 1. add a user-config.py in your /variant folder. A minimal sample can be 
> found at 
> https://gerrit.wikimedia.org/r/plugins/gitiles/pywikibot/core/+/88f22977fd186d888c4d9e8cbac11d76e87bd607/user-config.py.sample
> 2. or set a PYWIKIBOT_NO_USER_CONFIG environment variable to 1 or 2 to ignore 
> user-config settings
>
> The pwb.py script wrapper (as well as the generate_... scripts are available 
> in directory mode only. You can get it including predefined scripts from 
> nightly https://pywikibot.toolforge.org/ or as git repository from gerrit or 
> from github clone https://github.com/wikimedia/pywikibot
>
> Adding pwb.py and generate_user_files.py/generate_family_file.py to side 
> oackage is still under development 
> https://gerrit.wikimedia.org/r/c/pywikibot/core/+/560057
>
> Seem our documentation is insufficient, sorry for that. If you have further 
> questions do not hesitate to ask.


Thanks for the reply - this was very helpful. A couple more questions:

1. Is there any way to login with MFA? Our wiki requires either
choosing a number from an authenticator app or using a userid and
password and then entering a code which was texted.

2. Is there a way to get all pages within a category?

Thanks!
Larry

>
> Am 17.08.2020 um 21:41 schrieb Larry Martell :
>
> We have an internal wiki and I want to use pywikibot to get some data
> from it. Installed it from pip but when I import it I get:
>
> import pywikibot
>
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/usr/local/lib/python3.7/site-packages/pywikibot/__init__.py",
> line 25, in 
>from pywikibot.bot import (
>  File "/usr/local/lib/python3.7/site-packages/pywikibot/bot.py", line
> 105, in 
>from pywikibot import config2 as config
>  File "/usr/local/lib/python3.7/site-packages/pywikibot/config2.py",
> line 373, in 
>base_dir = get_base_dir()
>  File "/usr/local/lib/python3.7/site-packages/pywikibot/config2.py",
> line 367, in get_base_dir
>raise RuntimeError(exc_text)
> RuntimeError: No user-config.py found in directory '/vagrant'.
>
> Looking here 
> https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation#Configure_Pywikibot
>
> I see a reference to pwb.py, but that does not exist in
> /usr/local/lib/python3.7/site-packages/pywikibot.
>
> What am I missing here?
>
> Thanks!
>
> ___
> pywikibot mailing list
> pywikibot@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikibot
>
> ___
> pywikibot mailing list
> pywikibot@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikibot

___
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot


Re: [pywikibot] Getting started with pywikibot

2020-08-17 Thread info
Hi Larry,

there are two way to use Pywikibot as a side package:
1. add a user-config.py in your /variant folder. A minimal sample can be found 
at 
https://gerrit.wikimedia.org/r/plugins/gitiles/pywikibot/core/+/88f22977fd186d888c4d9e8cbac11d76e87bd607/user-config.py.sample
2. or set a PYWIKIBOT_NO_USER_CONFIG environment variable to 1 or 2 to ignore 
user-config settings

The pwb.py script wrapper (as well as the generate_... scripts are available in 
directory mode only. You can get it including predefined scripts from nightly 
https://pywikibot.toolforge.org/ or as git repository from gerrit or from 
github clone https://github.com/wikimedia/pywikibot

Adding pwb.py and generate_user_files.py/generate_family_file.py to side 
oackage is still under development 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/560057

Seem our documentation is insufficient, sorry for that. If you have further 
questions do not hesitate to ask.

Best

xqt
> Am 17.08.2020 um 21:41 schrieb Larry Martell :
> 
> We have an internal wiki and I want to use pywikibot to get some data
> from it. Installed it from pip but when I import it I get:
> 
 import pywikibot
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/usr/local/lib/python3.7/site-packages/pywikibot/__init__.py",
> line 25, in 
>from pywikibot.bot import (
>  File "/usr/local/lib/python3.7/site-packages/pywikibot/bot.py", line
> 105, in 
>from pywikibot import config2 as config
>  File "/usr/local/lib/python3.7/site-packages/pywikibot/config2.py",
> line 373, in 
>base_dir = get_base_dir()
>  File "/usr/local/lib/python3.7/site-packages/pywikibot/config2.py",
> line 367, in get_base_dir
>raise RuntimeError(exc_text)
> RuntimeError: No user-config.py found in directory '/vagrant'.
> 
> Looking here 
> https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation#Configure_Pywikibot
> 
> I see a reference to pwb.py, but that does not exist in
> /usr/local/lib/python3.7/site-packages/pywikibot.
> 
> What am I missing here?
> 
> Thanks!
> 
> ___
> pywikibot mailing list
> pywikibot@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikibot
___
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot


[pywikibot] Getting started with pywikibot

2020-08-17 Thread Larry Martell
We have an internal wiki and I want to use pywikibot to get some data
from it. Installed it from pip but when I import it I get:

>>> import pywikibot
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.7/site-packages/pywikibot/__init__.py",
line 25, in 
from pywikibot.bot import (
  File "/usr/local/lib/python3.7/site-packages/pywikibot/bot.py", line
105, in 
from pywikibot import config2 as config
  File "/usr/local/lib/python3.7/site-packages/pywikibot/config2.py",
line 373, in 
base_dir = get_base_dir()
  File "/usr/local/lib/python3.7/site-packages/pywikibot/config2.py",
line 367, in get_base_dir
raise RuntimeError(exc_text)
RuntimeError: No user-config.py found in directory '/vagrant'.

Looking here 
https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation#Configure_Pywikibot

I see a reference to pwb.py, but that does not exist in
/usr/local/lib/python3.7/site-packages/pywikibot.

What am I missing here?

Thanks!

___
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot