Pytanis
๐ฑ Python client for Pretalx
Install / Use
/learn @PioneersHub/PytanisREADME
Pytanis includes a [Pretalx] client and all the tooling you need for conferences using [Pretalx], from handling the initial call for papers to creating the final program. <br/>
| | |
|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| CI/CD |
|
| Package |
|
| Details |
|
Trivia: The name Pytanis is a reference to [Prytanis] using the typical py prefix of [Python] tools. [Prytanis] was the name given to the leading members of the government of a city (polis) in ancient Greece. Offices that used this title usually had responsibility for presiding over councils of some kind, which met in the [Prytaneion]. Romani ite domum!
Features
- [x] simple configuration management with a config folder in your home directory, just like many other tools do
- [x] easily access [Google Sheets], potentially filled by some [Google Forms], and download sheets as data frames
- [x] easy to use [Pretalx] client that returns proper Python objects thanks to the power of [pydantic]
- [x] simple e-mail clients for batch mails, e.g. to your reviewers, via [Mailgun] and [HelpDesk]
- [x] awesome [documentation] with best practices for the program committee of any community-based conference
- [x] tools to assign proposals to reviewers based on constraints like preferences
- [x] tools to support the final selection process of proposals
- [x] tools to support the creation of the final program schedule
- [x] tools to support the update of the final program schedule to [Pretalx]
Getting started
To install Pytanis simple run:
pip install pytanis
or to install all recommended additional dependencies:
pip install 'pytanis[all]'
Then create a configuration file and directory in your user's home directory. For Linux/MacOS/Unix use
~/.pytanis/config.toml and for Windows $HOME\.pytanis\config.toml, where $HOME is e.g. C:\Users\yourusername\.
Use your favourite editor to open config.toml within the .pytanis directory and add the following content:
[Pretalx]
api_token = "932ndsf9uk32nf9sdkn3454532nj32jn"
[Google]
client_secret_json = "client_secret.json"
token_json = "token.json"
service_user_authentication = false
[HelpDesk]
account = "934jcjkdf-39df-9df-93kf-934jfhuuij39fd"
entity_id = "email@host.com"
token = "dal:Sx4id934C3Y-X934jldjdfjk"
[Mailgun]
token = "gguzdgshbdhjsb87239njsa"
from_address = "PyCon DE & PyData Program Committee <program25@mg.pycon.de>"
reply_to = "program25@pycon.de"
where you need to replace the dummy values in the sections [Pretalx] and [HelpDesk] accordingly. Note that service_user_authentication is not required to be set if authentication via a service user is not necessary (see [GSpread using Service Account] for more details).
Retrieving the Credentials and Tokens
-
Google:
- For end users: Follow the [Python Quickstart for the Google API] to generate and download the file
client_secret.json. Move it to the~/.pytanisfolder asclient_secret.json. The filetoken.jsonwill be automatically generated later. Note thatconfig.tomlreferences those two files relative to its own location. - For any automation project: Follow [GSpread using Service Account] to generate and download the file
client_secret.json. Move it to the~/.pytanisfolder asclient_secret.json. Also make sure to setservice_user_authentication = truein your~/.pytanis/config.toml.
- For end users: Follow the [Python Quickstart for the Google API] to generate and download the file
-
Pretalx: The API token can be found in the [Pretalx user settings].
-
HelpDesk: Login to the [LiveChat Developer Console] then go to <kbd>Tools</kbd> ยป <kbd>Personal Access Tokens</kbd>. Choose <kbd>Create new token +</kbd>, enter a the name
Pytanis, select all scopes and confirm. In the following screen copy theAccount ID,Entity IDandTokenand paste them intoconfig.toml. In case there is any trouble with livechat, contact a helpdesk admin. Also note that theAccount IDfrom your token is theAgent IDneeded when you create a ticket. TheTeam IDyou get from [HelpDesk] then <kbd>Agents</kbd> ยป <kbd>Name of your agent</kbd> and the final part of the URL shown now.When setting up your agent the first time, you also need to go to [LiveChat] then log in with your Helpdesk team credentials and click <kbd>Request</kbd> to get an invitation. An admin of [LiveChat] needs to confirm this and add you as role
admin. Then, check [HelpDesk] to receive the invitation and accept.
Development
This section is only relevant if you want to contribute to Pytanis itself. Your help is highly appreciated! There are two options for local development.
Whilst both option are valid, the Devcontainer setup is the most convenient, as all dependencies are preconfigured.
Devcontainer Setup
After having cloned this repository:
- Make sure to have a local installation of [Docker] and [VS Code] running.
- Open [VS Code] and make sure to have the [Dev Containers Extension] from Microsoft installed.
- Open the cloned project in [VS Code] and from the bottom right corner confirm to open the project to be opened within the Devcontainer.
If you miss any dependencies check out the devcontainer.json within the .devcontainer folder. Otherwise, the right python environment with [pipx], [hatch], [pre-commit] and the initialization steps for the Hatch environments, are already included.
For the use of the pytanis libary some credentials and tokens are necessary (see the "Getting Started" section). With the Devcontainer setup the config.yaml is already created. Just navigate to ~/.pytanis/config.toml and update the file with the corresponding tokens.
Conventional Setup
After having cloned this repository:
- install [hatch] globally, e.g.
pipx install hatch, - install [pre-commit] globally, e.g.
pipx install pre-commit, - [only once] run
hatch config set dirs.env.virtual .direnvto let [VS Code] find your virtual environments.
And then you are a
