A ZoomRx - Ferma Congress package for internal usage
Project description
Ferma Congress
FermaCongress is a private Python package used internally by the Planners team at ZoomRx - Ferma Congress to automate extraction and management of congress-level data. The package provides utilities for Authentication, Session & Tweet Management, Annotation & Social Workflows
Installation
pip install FermaCongress
# upgrade to the latest version
pip install --upgrade FermaCongress
🔐 FermaCongress.auth
To access Ferma, you must provide a .env file containing your authorized Ferma credentials.
| Function | Description |
|---|---|
adminlogin() |
Authenticates with the Ferma Admin Portal and enables access to its APIs |
supportlogin() |
Authenticates with the Ferma Support Portal and maintains an active session |
Both functions expect the following variables in your .env file:
FERMA_USERNAME=<your-username>
FERMA_PASSWORD=<your-password>
Quick Start
from FermaCongress.auth import adminlogin, supportlogin
# Authenticate to the Admin portal
admin_client = adminlogin(".env")
# Authenticate to the Support portal
support_client = supportlogin(".env")
Environment Variables (.env)
FERMA_USERNAME=your_username
FERMA_PASSWORD=your_password
Encoded credentials: If your .env file contains Base64-encoded values, simply add the format="ENCODED" argument:
admin_client = adminlogin(".env", format="ENCODED")
🧠 FermaCongress.annotate
The annotate() function allows you to send a DataFrame to the Ferma Support Portal for keyword annotation and download the processed results.
Requires an authenticated Ferma Support Portal session (via
supportlogin()fromFermaCongress.auth)
Function
| Parameter | Description |
|---|---|
client |
Authenticated Session instance from supportlogin() |
input_df |
Pandas DataFrame with an id column |
custom_needles_df |
Optional DataFrame of user-defined needles |
needles |
List of two ints: [kb_status, nct_status] |
entities |
Optional entity configuration (dict) |
long_table |
Use long table format (True) or pivot table format (False) |
Quick Example
from FermaCongress.auth import supportlogin
from FermaCongress.annotate import annotate
# Authenticate to the Support portal
support_client = supportlogin(".env")
# Annotate
annotated_df = annotate(support_client, input_df=input_df, needles=[1, 1], long_table=True)
📥 FermaCongress.extractferma
This module provides a set of helper functions to extract congress-level data from the Ferma Admin Portal.
All functions require an authenticated Admin client (via adminlogin() from FermaCongress.auth).
Functions
| Function | Description |
|---|---|
get_all_sessions() |
Download all session-level metadata for a given congress ID |
get_skg() |
Download grouped session keyword data |
get_fullabstracts() |
Download full abstracts for all sessions |
get_summary() |
Download session summaries |
get_tweets() |
Download tweet-level data and merge with session metadata and priorities |
get_priority() |
Download and merge planner priority files into a consolidated DataFrame |
Example
from FermaCongress.auth import adminlogin
from FermaCongress.extractferma import (
get_all_sessions, get_skg, get_fullabstracts,
get_summary, get_tweets, get_priority
)
# 1) Authenticate to the Admin portal
admin_client = adminlogin(".env")
# 2) Fetch Sessions / Keywords / Tweets
CONGRESS_ID = "221"
sessions_df = get_all_sessions(admin_client, CONGRESS_ID)
skg_df = get_skg(admin_client, CONGRESS_ID)
abstracts_df = get_fullabstracts(admin_client, CONGRESS_ID)
summary_df = get_summary(admin_client, CONGRESS_ID)
tweets_df = get_tweets(admin_client, CONGRESS_ID)
priority_df = get_priority(admin_client, CONGRESS_ID)
🔄 FermaCongress.postferma
This module contains helper functions for posting tweet-level updates back to the Ferma Admin Portal and for triggering server-side buzz score recalculation.
Functions
| Function | Description |
|---|---|
addtweets() |
Uploads new tweets for a specific congress ID |
modifytweets() |
Modifies existing tweets for a specific congress ID |
populatebuzz() |
Triggers the server to populate or update buzz scores for all sessions |
All functions require an authenticated Admin client (adminlogin() from FermaCongress.auth).
Example
from FermaCongress.auth import adminlogin
from FermaCongress.postferma import addtweets, modifytweets, populatebuzz
client = adminlogin(".env")
CONGRESS_ID = "221"
# Add new tweets
addtweets(client, df, CONGRESS_ID)
# Modify tweets (if needed)
modifytweets(client, df, CONGRESS_ID)
# Recalculate buzz scores
populatebuzz(client, CONGRESS_ID)
🗂️ FermaCongress.planner
The FermaCongress.planner module provides utilities for generating congress planning files by combining session metadata, keyword information, and planner-level priorities.
Functions
| Function | Description |
|---|---|
baseplanner() |
Builds a fully enriched planning DataFrame for a given Congress and Planner ID |
Example
from FermaCongress.auth import adminlogin
from FermaCongress.planner import baseplanner
# 1) Authenticate to the Admin portal
client = adminlogin(".env")
# 2) Build a planner file
CONGRESS_ID = "221"
PLANNER_ID = "4"
planner_df = baseplanner(client, CONGRESS_ID, PLANNER_ID)
print(planner_df.head())
⚙️ FermaCongress.formatexcel
The FormatExcel utility is used to apply styling and export your Ferma data (from a DataFrame or input file) into a clean, Ferma-styled Excel format.
from FermaCongress.formatexcel import format
format(dataframe=df, output_path="priority_report.xlsx") # Format from a DataFrame
format(input_path="raw_sessions.xlsx", output_path="formatted_sessions.xlsx") # Format from Excel file
format(input_path="raw_data.csv", output_path="formatted_output.xlsx") # Format from CSV file
| Parameter | Type | Description |
|---|---|---|
input_path |
str |
Path to an input Excel or CSV file. |
dataframe |
pandas.DataFrame |
DataFrame to format. |
output_path |
str |
File path to save the formatted Excel output. |
headers |
bool |
True to convert headers to proper casing (e.g., buzz_score → Buzz Score). |
input_sheet |
str |
Name of the sheet to read from (Excel only). Optional if only one sheet. |
output_sheet |
str |
Name of the sheet to write into in the output Excel file. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fermacongress-1.2.0.tar.gz.
File metadata
- Download URL: fermacongress-1.2.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f58f4d707be59ece04a822279c93a9105194a52693a8caa378479a61c89d22ee
|
|
| MD5 |
60a6d70e022257fbe0dbe7384132e8d1
|
|
| BLAKE2b-256 |
f3299385323b0e77f6f54761382600d4c62e3a57ffb5eec21711bc3f55627c9a
|
File details
Details for the file fermacongress-1.2.0-py3-none-any.whl.
File metadata
- Download URL: fermacongress-1.2.0-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
251f8a27a60f97c8b6de74745d0f017cc17a466bd2411373c8b614abedb04b31
|
|
| MD5 |
1eb1be5152ac4adcb1f2d25501fd8fbf
|
|
| BLAKE2b-256 |
6a44bdec2a4ff755dcc6f2772548acae7948a5665d86a057c254686b5fad7f83
|