Skip to main content

A tool for cleaning SEC EDGAR HTML files

Project description

EDGARDSRS: Tool for SEC 10-k files

License License
Dependencies PyPI - Version
Meta

Description:

EDGARDSRS is a Python library designed to clean and process SEC EDGAR 10-K filing HTML files. It removes unnecessary HTML elements, various types of noise/gibberish text, and extract tables with high numeric content to produce clean, readable text output suitable for analysis.

Features

  • HTML cleaning and text extraction
  • Removal of financial tables and numeric-heavy content
  • Extract financial tables
  • Elimination of noisy text and gibberish
  • Unicode normalization
  • Special character handling
  • Multiple HTML parser support (html.parser, lxml, html5lib)

Installation

pip install edgardsrs

Required dependencies:

  • beautifulsoup4
  • lxml
  • html5lib
  • unicodedata

Usage

Basic usage to clean a 10-K HTML file:

from edgardsrs import EdgarDSRS

analyzer = EdgarDSRS()

# Cleaning the file
input_file = "your_10k_file.html"
cleaned_file = analyzer.process_html_file(input_file)

Cleaning Process

The tool performs the following cleaning operations:

  1. HTML Parsing: Attempts to parse HTML using multiple parsers (html.parser, lxml, html5lib)
  2. Tag Removal: Strips all HTML tags while preserving text content
  3. Unicode Normalization: Normalizes Unicode characters
  4. Noise Removal:
    • Removes sequences with high special character density
    • Eliminates base64 encoded patterns
    • Cleans up lines with excessive non-alphanumeric characters
  5. Text Cleaning:
    • Removes noisy words (mixed case with numbers, excessive length)
    • Normalizes whitespace

Functions

clean_html_content(html_content)

Main function to clean HTML content and extract text.

text = EdgarDSRS.clean_html_content(html_content)

extract_and_format_tables

Function to extract tables.

soup = BeautifulSoup(html_content, "html.parser")
tables = extract_and_format_tables(soup)

Contributing

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

License

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

Author

Pratik Relekar | Xinyao Qian

Background

This library was developed at Data Science Research Services(University of Illinois at Urbana-Champaign) in 2024 and has been under active development since then.

Getting help

For general questions and discussions, visit DSRS mailing list.

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

edgardsrs-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

edgardsrs-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file edgardsrs-0.1.0.tar.gz.

File metadata

  • Download URL: edgardsrs-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for edgardsrs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe3f0069bef25fc839687ecb79406f540c2352564151824b7492b40440b45e8c
MD5 ad3182874e55a465726620a12fb26b4a
BLAKE2b-256 45e5deb1059366f6416dfe0013949c769dfc4b371f18f8d4a208577103186c23

See more details on using hashes here.

File details

Details for the file edgardsrs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: edgardsrs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for edgardsrs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e2b3ab36136f50daa91a9ddac78ac48ca732bd6e7aef817d768c6a3eab5678c
MD5 eb53eadb80d7599159228bd71a05e3ea
BLAKE2b-256 5d07c6e6599556e3aa60f7eddad0bd68503b19e8efb61d47c8090638e20dd7c4

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