category__and
[tpg_get_posts category__and="flowers, purple flowers"]

By category__in
[tpg_get_posts category__in="flowers, purple flowers"]

By category__not_in
[tpg_get_posts numberposts=1 category__not_in="flowers, purple flowers"]
At this moment in time April, 2025, the preferred way to authorize publishing a Python package to PYPI.org is to use tokens, twine and a trusted publisher. For my simple project and my limited skills at setting up a git workflow that will publish when a tag is created, the preferred workflow is a bit much.
For my small projects, I have been using twine and a .pypirc file.
the .pypirc file looks like:
#
# Test: py -m twine upload --repository testpypi dist/*
# Prod: py -m twine upload --repository pypi dist/*
#
[distutils]
index-servers =
pypi
testpypi
[pypi]
repository = https://upload.pypi.org/legacy/
[testpypi]
repository = https://test.pypi.org/legacy/
And the command to publish the package (using uv) is :
uv run twine upload --repository testpypi dist/*
All works well, but the .pypirc file is being deprecated because it requires storing tokens in plain text. The new recommended way is to use the credential manager built into the OS – Linux, Windows and Mac.
Using a Windows OS, open the credential manager from the control panel, select the Windows Credentials tab and scroll down to the Generic Credentials. and click on Add a generic credential. This will prompt for:
Internet or network address: (put your website address here)
User name: (enter __token__ )
Password: (enter the token value)
Save this and it should work. Twine will check the credential manager using the website url and the username __token__. The website url is based on the –repository option: pypi or testpypi and seems to be built into the twine package.
This works in the case where you just have one token for all your python projects. But if you need a scoped token that is tied to a single project, then you need a mechanism that will map to the project specific token.
At this point, the solution I have found is to use the .pypirc file to map a custom –repository option to the unique url for the project.
Assuming you have a package mycoolpackage.
The .pypirc file, which is in the user root directory:
[distutils]
index-servers =
pypi
testpypi
testpypi-mycoolpackage
pypi-mycoolpackage
[pypi]
repository = https://upload.pypi.org/legacy/
[testpypi]
repository = https://test.pypi.org/legacy/
[testpypi-mycoolpackage]
repository = https://test.pypi.org/project/mycoolpackage
[pypi-mycoolpackage]
repository = https://upload.pypi.org/project/mycoolpackage
The upload to test: uv run twine upload --repository testpypi-mycoolpackage dist/*
Thee upload to production: uv run twine upload --repository pypi-mycoolpackage dist/*
It all feels a bit clunky to me, but it is working for now.
By tag and sticky post
[tpg_get_posts tag="flowers" ignore_sticky_posts="false" ]
