Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
.. image:: https://github.com/bennylope/pydiscourse/workflows/Tests/badge.svg :alt: Build Status :target: https://github.com/bennylope/pydiscourse/actions
.. image:: https://img.shields.io/badge/Check%20out%20the-Docs-blue.svg :alt: Check out the Docs :target: https://discourse.readthedocs.io/en/latest/
A Python library for working with Discourse.
This is a fork of the original Tindie version. It was forked to include fixes, additional functionality, and to distribute a package on PyPI.
The order here is important. The Discourse API is itself poorly documented so the level of documentation in the Python client is critical.
::
pip install pydiscourse
Create a client connection to a Discourse server::
from pydiscourse import DiscourseClient
client = DiscourseClient(
'http://example.com',
api_username='username',
api_key='areallylongstringfromdiscourse')
Get info about a user::
user = client.user('eviltrout')
print user
user_topics = client.topics_by('johnsmith')
print user_topics
Create a new user::
user = client.create_user('The Black Knight', 'blacknight', 'knight@python.org', 'justafleshwound')
Implement SSO for Discourse with your Python server::
@login_required
def discourse_sso_view(request):
payload = request.GET.get('sso')
signature = request.GET.get('sig')
nonce = sso_validate(payload, signature, SECRET)
url = sso_redirect_url(nonce, SECRET, request.user.email, request.user.id, request.user.username)
return redirect('http://discuss.example.com' + url)
To help experiment with the Discourse API, pydiscourse provides a simple command line client::
export DISCOURSE_API_KEY=your_master_key
pydiscoursecli --host-http://yourhost --api-user-system latest_topics
pydiscoursecli --host-http://yourhost --api-user-system topics_by johnsmith
pydiscoursecli --host-http://yourhost --api-user-system user eviltrout
.. :changelog:
search()
term paramater from term
to q
,
fixes search. Thanks @weber-sposts_by_number
endpoint from @Dettorertoggle_gravatar
, pick_avatar
, create_group
now require
keyword arguments where keyword arguments were used. This may break existing
code if you have not referenced these by keyword!ruff
and black
into pre-commit hooklint
job to GitHub Actions, tests will run if and only if lint job
passes.URI Too Large
error.All pre-PyPI development
FAQs
"A Python library for the Discourse API"
We found that pydiscourse demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.