Skip to main content

A ZoomRx - Ferma Congress package for internal usage

Project description

FermaCongress: https://pypi.org/project/FermaCongress/

FermaCongress is a Python package for automating congress-level data extraction, management, and analysis at ZoomRx - Ferma Congress.

📦 Installation

pip install FermaCongress
pip install --upgrade FermaCongress

🔑 Setup

Create a .env file with your Ferma credentials:

FERMA_USERNAME=your_username
FERMA_PASSWORD=your_password

📚 Modules Overview

Module Purpose Authentication
auth Login to Admin/Support portals N/A
extractferma Extract congress data Admin Portal
postferma Post tweets, trigger buzz scores Admin Portal
planner Generate planning files Admin Portal
annotate AI keyword annotation Support Portal
trials Extract clinical trial data None (Public APIs)
formatexcel Professional Excel formatting None

🔐 auth - Authentication

A lightweight utility that handles login for both the Ferma Admin and Support portals, returning ready-to-use headers or sessions.

from FermaCongress.auth import adminlogin, supportlogin

# Admin Portal Authentication
adminclient = adminlogin(".env")

# Support Portal Authentication
supportclient = supportlogin(".env")

# With Encoded credentials for Admin Portal
adminclient = adminlogin(".env", format="ENCODED")

📥 extractferma - Data Extraction

Extract various types of congress data from the Admin Portal.

from FermaCongress.auth import adminlogin
from FermaCongress.extractferma import (
    get_all_sessions,    # Session metadata
    get_skg,             # Session keywords
    get_fullabstracts,   # Full abstract texts
    get_summary,         # AI-generated summaries
    get_tweets,          # Tweet data with buzz scores
    get_priority         # Priority data from all planners
)

adminclient = adminlogin(".env")
CONGRESS_ID = "221"

# Extract data
sessions = get_all_sessions(adminclient, CONGRESS_ID)
keywords = get_skg(adminclient, CONGRESS_ID)
tweets = get_tweets(adminclient, CONGRESS_ID)
abstracts = get_fullabstracts(adminclient, CONGRESS_ID)
summaries = get_summary(adminclient, CONGRESS_ID)

# Get priorities with filtering
priority = get_priority(adminclient, CONGRESS_ID, include=["ClientA"], exclude=["ClientB"])

Note: include and exclude accept Tenant Names only (not Team Names).


🔄 postferma - Post Data

Upload tweets and trigger buzz score calculations.

from FermaCongress.auth import adminlogin
from FermaCongress.postferma import addtweets, modifytweets, populatebuzz

adminclient = adminlogin(".env")
CONGRESS_ID = "221"

# Add new tweets
addtweets(adminclient, tweets_add_df, CONGRESS_ID)

# Modify existing tweets
modifytweets(adminclient, tweets_modify_df, CONGRESS_ID)

# Recalculate buzz scores
populatebuzz(adminclient, CONGRESS_ID)

🗂️ planner - Generate Planner Files

Create enriched planning files with session data, keywords, and priorities.

from FermaCongress.auth import adminlogin
from FermaCongress.planner import baseplanner

adminclient = adminlogin(".env")

# With priorities
planner_df = baseplanner(adminclient, "221", PLANNER_ID="4")

# Without priorities
planner_df = baseplanner(adminclient, "221")

Returns: DataFrame with session details, keywords, drugs, priorities, dates, locations


🧠 annotate - Knowledge Base Annotation

Annotate data using Ferma's AI knowledge base.

Input Requirements:

  • DataFrame must contain an id column
from FermaCongress.auth import supportlogin
from FermaCongress.annotate import annotate
import pandas as pd

supportclient = supportlogin(".env")

# Prepare input data
input_df = pd.read_excel("input.xlsx") / pd.read_csv("input.csv")

# Annotate
result = annotate(
    client=supportclient,
    input_df=input_df,
    needles=[1, 1],        # [kb_status, nct_status]: 1=enabled, 0=disabled
    long_table=True        # True=long format, False=pivot format
)

Parameters:

  • needles: [kb_status, nct_status] - Enable/disable knowledge base and NCT annotation
  • long_table: Output format (long or pivot)
  • custom_needles_df: Optional custom keywords DataFrame

🏥 trials - Clinical Trials

Extract trial data from ClinicalTrials.gov, EU CTIS, and EudraCT.

from FermaCongress.trials import extracttrials

df_wide, df_long = extracttrials(df, column='nct_ids', delimiter=';;')

Supported Formats:

  • NCT: NCT12345678
  • EU CTIS: 2022-500000-11-00
  • EudraCT: 2022-500000-11

Returns: Study ID, Phase, Enrollment, Lead Sponsor, Collaborators


⚙️ formatexcel - Excel Formatting

Apply Ferma-branded styling to Excel files.

from FermaCongress.formatexcel import format

# From DataFrame
format(dataframe=df, output_path="output.xlsx")

# From Excel file
format(input_path="raw.xlsx", output_path="formatted.xlsx", input_sheet="Sheet1")

# From CSV file
format(input_path="data.csv", output_path="output.xlsx", output_sheet="Sheet1")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fermacongress-1.2.5.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fermacongress-1.2.5-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file fermacongress-1.2.5.tar.gz.

File metadata

  • Download URL: fermacongress-1.2.5.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for fermacongress-1.2.5.tar.gz
Algorithm Hash digest
SHA256 654fa469744ada2e79982737f4e109c08ba0dd07892b9267fbec98c9de8bb65d
MD5 fe809ce5e314d4b51b102a8810e73c9d
BLAKE2b-256 9cb48b78efbcce1248626e0e882b34eefbe4f0ab514d7844ccf4e78d370acfa2

See more details on using hashes here.

File details

Details for the file fermacongress-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: fermacongress-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for fermacongress-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a565f94994f9d1d886b8d30a3cd0a17e7afee5723d493e538e3e2326957f8242
MD5 363e826d8d58d754bf75ccbe5788a514
BLAKE2b-256 5b4a27679d5c38a338c940cb517d3fed9ea627aec3c71282a4cbfcf8f258246f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page