Skip to main content

A ZoomRx - Ferma Congress package for internal usage

Project description

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.3.tar.gz (22.3 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.3-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fermacongress-1.2.3.tar.gz
  • Upload date:
  • Size: 22.3 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.3.tar.gz
Algorithm Hash digest
SHA256 8ab58a2fb71f508d144e30118b73fec88ff3ac8e2f1d9bb34db32d71ee60fcab
MD5 abbdf39afa1ac194073ad270f7d5ef5b
BLAKE2b-256 8835ddaff18d4e641012a07539f46ffc17dde4bae6053fbccea4f1c3dc1f2a64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fermacongress-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 25.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8086a961b9cdf9291de8198eacc0a99ee71f3530f36203214275f6cbef651f6f
MD5 977fb469e9a0693a6359d5421d815380
BLAKE2b-256 79bb31d4eb0835bb8933f312d841f97765806a964045567675a74835d0556527

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