Most times, I can quickly jump on LDS.org and get the exact information
I need. However, there are those repeated tasks I don't really want to
to run time and time again. Hmm... sounds like a job for a computer.
In my current role as Clerk, reports and information are my life. I
want to make it easier to get that information.
For install you can use pip:
pip install lds-org
Using the command line, see the available endpoints and your current ID.
python -m lds-org --ask
python -m lds-org --ask -e current-user-id
Now lets get the same in python.
lds = lds_org.LDSOrg()
rv = lds.get('current-user-id')
print(sorted(k for k, v in lds.endpoints.items()
if isinstance(v, basestring) and v.startswith('http')))
### Working endpoints
There are some endpoints, while published, don't appear to be working. Here is a list of working endpoint providing JSON. See <https://tech.lds.org/wiki/LDS_Tools_Web_Services> for more information.
Calendar requests appear to be working but the descriptions at <https://tech.lds.org/wiki/LDS_Tools_Web_Services> appear to be out of date. For an example see the testing suite.
### Secure your username and password
You need to keep your username and password secret. However, you also
want to automate the process of getting and processing information
from LDS.org. You could put your username and password in your code,
but the possibility of sharing your information is very possible when
you show or share your code.
This module can use environment variables containing your username and
password. In \*nix based systems, you can add the following to your
.bashrc or its equivelent.
LDSORG_USERNAME=username; export LDSORG_USERNAME
LDSORG_PASSWORD="password"; export LDSORG_PASSWORD
Personally, I create a seperate file to fix the command line environment.
I take the above and put it in a file 'ldsorg-password.txt'. From the
command line, type the following and you should see your LDS.org username.
Once this is done, you no longer need to either use the '--ask' parameter
or specify a username/password in your code.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.