Skip to main content

🏥 ProbableDoctor

PyPI version License: MIT

Enhanced Medical Professional Name Parser with advanced multi-credential support.

ProbableDoctor is an enhanced Python library for parsing medical professional names with proper handling of multiple comma-separated credentials and titles. Built on top of the robust probablepeople library, it provides specialized parsing for healthcare professionals.

✨ Key Features

  • 🎓 Multi-Credential Parsing: Properly handles multiple credentials like "MD, PhD, FACP"
  • 👨‍⚕️ Medical Titles: Recognizes medical prefixes and professional titles
  • 📋 Structured Output: Returns parsed components as dictionaries for easy processing
  • 🔄 Backwards Compatible: Works with existing probablepeople code
  • 🎯 High Accuracy: Uses advanced NLP and machine learning

🚀 Quick Start

Installation

pip install probabledoctor

Basic Usage

import probabledoctor

# Parse a medical professional's name
result, name_type = probabledoctor.tag("Dr. Sarah Johnson MD, PhD, FACP")

print(result)
# Output: {
#     'PrefixOther': 'Dr.',
#     'GivenName': 'Sarah', 
#     'Surname': 'Johnson',
#     'SuffixOther': 'MD, PhD, FACP'
# }

print(f"Name type: {name_type}")
# Output: Name type: Person

CLI Usage

# Parse and tag a name
probabledoctor "Dr. Jane Doe MD" --tag

# Parse without tagging
probabledoctor "Dr. Jane Doe MD"

# Use specific model type
probabledoctor "Smith Medical Corp" --type company --tag

📊 Examples

Multiple Credentials

import probabledoctor

names = [
    "Taylor Anne Jordan ATC, LAT",
    "Dr. Sarah Johnson MD, PhD, FACP", 
    "Michael Smith RN, BSN, CEN",
    "David Wilson PhD, MD"
]

for name in names:
    result, name_type = probabledoctor.tag(name)
    credentials = result.get('SuffixOther', '')
    full_name = f"{result.get('GivenName', '')} {result.get('Surname', '')}"
    
    print(f"👤 {full_name}")
    print(f"🎓 Credentials: {credentials}")
    print(f"📋 Type: {name_type}")
    print()

Output:

👤 Taylor Jordan
🎓 Credentials: ATC, LAT
📋 Type: Person

👤 Sarah Johnson  
🎓 Credentials: MD, PhD, FACP
📋 Type: Person

👤 Michael Smith
🎓 Credentials: RN, BSN, CEN
📋 Type: Person

👤 David Wilson
🎓 Credentials: PhD, MD
📋 Type: Person

Backwards Compatibility

ProbableDoctor maintains full compatibility with probablepeople:

import probabledoctor as pp

# Use standard probablepeople functions
result = pp.parse("John Smith")
tagged = pp.tag("Dr. Jane Doe MD")

🏗️ What's Enhanced?

Feature probablepeople probabledoctor
Basic name parsing ✅ ✅
Single credentials ✅ ✅
Multiple credentials ❌ Returns as string ✅ Returns as string
Medical titles ⚠️ Limited ✅ Enhanced
Complex credentials ❌ "MD, PhD, FACP" ✅ "MD, PhD, FACP"

⚠️ Known Limitations

  • Parsing of trailing initials: In some cases, names with a trailing initial (e.g., "John Doe A") might have the initial misclassified. For example, running probabledoctor "Kashani Jamshid A" --tag may currently identify "A" as SuffixOther instead of a MiddleInitial or as part of the main name components. This is related to the intricacies of the statistical model used for parsing. Efforts to improve accuracy for these patterns are ongoing.

🎯 Use Cases

  • Healthcare Systems: Parse doctor names from databases
  • Medical Records: Extract credentials from patient records
  • Research: Analyze medical professional credentials
  • HR Systems: Process healthcare worker information
  • Compliance: Verify medical professional credentials

📚 Advanced Usage

Custom Model Types

# Use different parsing models
result = probabledoctor.tag("Dr. Smith", type="person")
result = probabledoctor.tag("Smith Medical Corp", type="company")

Integration with Existing Code

# Drop-in replacement for probablepeople
import probabledoctor as pp

# Your existing probablepeople code works unchanged
names = ["John Smith", "Dr. Jane Doe MD"]
for name in names:
    parsed = pp.parse(name)
    tagged = pp.tag(name)

Requirements

  • Python 3.9+
  • python-crfsuite>=0.7
  • probableparsing
  • doublemetaphone

Installation from Source

git clone https://github.com/atk81-candor/probabledoctor
cd probabledoctor
pip install -e .

Running Tests

pytest tests/

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

🆘 Support

🙏 Acknowledgments

Built on top of the excellent probablepeople library by DataMade.


Made with ❤️ for the healthcare community

Metadata

Release files for probabledoctor 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for probabledoctor 0.1.0
File Size Uploaded Provenance Actions
probabledoctor-0.1.0.tar.gz 1.3 MB With provenance Details for probabledoctor-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for probabledoctor 0.1.0
File Interpreter ABI Platform Actions
probabledoctor-0.1.0-py3-none-any.whl Python 3 none any Details for probabledoctor-0.1.0-py3-none-any.whl

Total release size: 2.2 MB

Release files / probabledoctor-0.1.0.tar.gz

Download URL probabledoctor-0.1.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
76c6d023aa4cda2bfbf4920dd454d1f0c341cb4477cb84cdee84880722db3446
BLAKE2b-256 checksum
How to use checksums
a01774c311a28a21696e6ab144be4de803d2dcb173d6832cbef1f74a54ba3563
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 9, 2025.

Transparency log

Release files / probabledoctor-0.1.0-py3-none-any.whl

Download URL probabledoctor-0.1.0-py3-none-any.whl
Size 904.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a228db54461fde8c2865e9b3f4a76d262e0a171b4bf7f93d86d681b0538b3e34
BLAKE2b-256 checksum
How to use checksums
5f7931e81abe6addff7b134f9ac8fe5268bae67aeba5c6d962d532ec5cb8663a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 9, 2025.

Transparency log

Security for probabledoctor 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for probabledoctor-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 9, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page