Skip to content

Commit

Permalink
Refactor and cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
dgunning committed Aug 13, 2024
1 parent d2454f4 commit 4a96079
Show file tree
Hide file tree
Showing 32 changed files with 40 additions and 93 deletions.
4 changes: 2 additions & 2 deletions edgar/_filings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

from edgar._markdown import html_to_markdown, text_to_markdown
from edgar._party import Address
from edgar._rich import df_to_rich_table, repr_rich
from edgar._xml import child_text
from edgar.richtools import df_to_rich_table, repr_rich
from edgar.xmltools import child_text
from edgar.attachments import FilingHomepage, Attachment, Attachments, AttachmentServer
from edgar.core import (log, display_size, sec_edgar,
filter_by_date,
Expand Down
53 changes: 0 additions & 53 deletions edgar/_gaap.py

This file was deleted.

2 changes: 1 addition & 1 deletion edgar/_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from rich.panel import Panel
from rich.table import Table

from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar.documents import HtmlDocument

__all__ = [
Expand Down
4 changes: 2 additions & 2 deletions edgar/_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from rich.text import Text
from rich.columns import Columns
from pydantic import BaseModel
from edgar._rich import repr_rich
from edgar._xml import child_text, child_value
from edgar.richtools import repr_rich
from edgar.xmltools import child_text, child_value
from edgar.core import IntString

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion edgar/attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from rich.table import Table, Column
from rich.text import Text

from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar.core import sec_dot_gov, display_size, binary_extensions, text_extensions
from edgar.httprequests import get_with_retry, download_file, download_file_async

Expand Down
2 changes: 1 addition & 1 deletion edgar/company_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from edgar._filings import Attachments, Attachment
from edgar._markdown import MarkdownContent
from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar.documents import HtmlDocument
from edgar.financials import Financials
from edgar.htmltools import ChunkedDocument, chunks2df, detect_decimal_items, adjust_for_empty_items
Expand Down
2 changes: 1 addition & 1 deletion edgar/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich import box
from rich.table import Table

from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar.datatools import table_html_to_dataframe, clean_column_text

warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning)
Expand Down
4 changes: 2 additions & 2 deletions edgar/effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from rich.console import Group, Text

from edgar._party import Filer
from edgar._rich import repr_rich, df_to_rich_table
from edgar._xml import child_text
from edgar.richtools import repr_rich, df_to_rich_table
from edgar.xmltools import child_text

__all__ = [
'EffectiveData',
Expand Down
2 changes: 1 addition & 1 deletion edgar/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from rich.text import Text

from edgar._filings import Filing, Filings, FilingsState
from edgar._rich import df_to_rich_table, repr_rich
from edgar.richtools import df_to_rich_table, repr_rich
from edgar.core import (log, Result, display_size,
filter_by_date, IntString, InvalidDateException, reverse_name, get_edgar_data_directory)
from edgar.httprequests import download_json, download_text, download_bulk_data
Expand Down
2 changes: 1 addition & 1 deletion edgar/filingheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich import box
from rich.console import Group
from edgar.reference import describe_form, states
from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar._party import Address, get_addresses_as_columns
from edgar.core import datefmt, reverse_name
from datetime import datetime
Expand Down
2 changes: 1 addition & 1 deletion edgar/financials.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from rich.table import Table, Column
from rich.text import Text

from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar.xbrl.presentation import FinancialStatementMapper, XBRLPresentation
from edgar.xbrl.xbrldata import XBRLData, Statement

Expand Down
4 changes: 2 additions & 2 deletions edgar/form144.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from edgar.entities import Company
from edgar._party import Address
from edgar._party import Filer, Contact
from edgar._rich import repr_rich
from edgar._xml import child_text, child_texts
from edgar.richtools import repr_rich
from edgar.xmltools import child_text, child_texts

__all__ = ['Form144',
'concat_securities_information',
Expand Down
2 changes: 1 addition & 1 deletion edgar/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rich.console import Group, Text
from rich.markdown import Markdown

from edgar._rich import df_to_rich_table, repr_rich
from edgar.richtools import df_to_rich_table, repr_rich
from edgar.core import sec_dot_gov
from edgar.httprequests import download_file

Expand Down
4 changes: 2 additions & 2 deletions edgar/fundreports.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from rich.table import Table

from edgar.reference import cusip_ticker_mapping
from edgar._rich import repr_rich, df_to_rich_table
from edgar._xml import find_element, child_text, optional_decimal
from edgar.richtools import repr_rich, df_to_rich_table
from edgar.xmltools import find_element, child_text, optional_decimal
from edgar.core import moneyfmt, get_bool
from edgar.funds import get_fund_information, FundSeriesAndContracts, Fund, get_fund

Expand Down
2 changes: 1 addition & 1 deletion edgar/funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from edgar.entities import Company
from edgar._filings import FilingHeader, Filings
from edgar._rich import repr_rich, df_to_rich_table
from edgar.richtools import repr_rich, df_to_rich_table
from edgar.core import log
from edgar.httprequests import download_text

Expand Down
2 changes: 1 addition & 1 deletion edgar/headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from rich.text import Text

from edgar._party import Address, get_addresses_as_columns
from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar.core import sec_dot_gov, display_size
from edgar.httprequests import download_file
from edgar.reference import describe_form
Expand Down
2 changes: 1 addition & 1 deletion edgar/htmltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from rich.panel import Panel
from rich.table import Table

from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar.datatools import compress_dataframe
from edgar.datatools import table_html_to_dataframe, dataframe_to_text
from edgar.documents import HtmlDocument, Block, TableBlock
Expand Down
4 changes: 2 additions & 2 deletions edgar/legacy/_xbrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from rich.panel import Panel
from rich.text import Text

from edgar._rich import repr_rich, df_to_rich_table
from edgar._xml import child_text
from edgar.richtools import repr_rich, df_to_rich_table
from edgar.xmltools import child_text
from edgar.core import log

"""
Expand Down
4 changes: 2 additions & 2 deletions edgar/muniadvisors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

from edgar import Filing
from edgar._party import Name, Address
from edgar._rich import repr_rich
from edgar._xml import child_text, child_texts, child_value
from edgar.richtools import repr_rich
from edgar.xmltools import child_text, child_texts, child_value

__all__ = [
'MunicipalAdvisorForm'
Expand Down
4 changes: 2 additions & 2 deletions edgar/offerings/formc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from rich.table import Table, Column

from edgar._party import Address
from edgar._rich import repr_rich
from edgar._xml import child_text
from edgar.richtools import repr_rich
from edgar.xmltools import child_text
from edgar.core import get_bool, yes_no
from edgar.entities import Company
from edgar.reference import states
Expand Down
4 changes: 2 additions & 2 deletions edgar/offerings/formd.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from rich.table import Table

from edgar._party import Issuer, Person, Address
from edgar._rich import repr_rich
from edgar._xml import child_text, child_value
from edgar.richtools import repr_rich
from edgar.xmltools import child_text, child_value

__all__ = [
'FormD',
Expand Down
4 changes: 2 additions & 2 deletions edgar/ownership/ownershipforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from rich.table import Table, Column

from edgar._party import Address
from edgar._rich import repr_rich, df_to_rich_table
from edgar._xml import (child_text, child_value)
from edgar.richtools import repr_rich, df_to_rich_table
from edgar.xmltools import (child_text, child_value)
from edgar.core import IntString, get_bool, reverse_name, yes_no
from edgar.datatools import convert_to_numeric
from edgar.entities import Entity
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion edgar/search/textsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich.panel import Panel

from edgar._markdown import convert_table
from edgar._rich import repr_rich
from edgar.richtools import repr_rich

PUNCTUATION = re.compile('[%s]' % re.escape(r"""!"#&'()*+,-/:;<=>?@[\]^`{|}~"""))

Expand Down
4 changes: 2 additions & 2 deletions edgar/thirteenf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from rich.table import Table, Column

from edgar._party import Address
from edgar._rich import repr_rich
from edgar._xml import find_element, child_text
from edgar.richtools import repr_rich
from edgar.xmltools import find_element, child_text
from edgar.core import log
from edgar.reference import cusip_ticker_mapping
from edgar.sgml import stream_documents
Expand Down
2 changes: 1 addition & 1 deletion edgar/xbrl/dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pandas as pd
from rich.table import Table

from edgar._rich import repr_rich
from edgar.richtools import repr_rich

__all__ = ['DimensionValue', 'Dimension', 'Dimensions', 'DimensionMetadata', 'DimensionAccessor']

Expand Down
2 changes: 1 addition & 1 deletion edgar/xbrl/facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from rich.table import Table, Column
import hashlib

from edgar._rich import repr_rich
from edgar.richtools import repr_rich
from edgar.xbrl.concepts import DEI_CONCEPTS
from edgar.xbrl.dimensions import Dimensions
from functools import lru_cache
Expand Down
2 changes: 1 addition & 1 deletion edgar/xbrl/presentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rich import print as rprint
from rich.tree import Tree

from edgar._rich import repr_rich
from edgar.richtools import repr_rich

__all__ = ['XBRLPresentation', 'PresentationElement']

Expand Down
2 changes: 1 addition & 1 deletion edgar/xbrl/xbrldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from rich.text import Text
from rich.tree import Tree

from edgar._rich import repr_rich, colorize_words
from edgar.richtools import repr_rich, colorize_words
from edgar.attachments import Attachments
from edgar.core import log, split_camel_case, run_async_or_sync
from edgar.httprequests import download_file_async
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich.table import Table

import edgar
from edgar._rich import *
from edgar.richtools import *
from edgar.core import (decode_content,
get_identity,
set_identity,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_xml.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from bs4 import BeautifulSoup
from pathlib import Path
from edgar._xml import child_value, child_text, value_or_footnote, get_footnote_ids, value_with_footnotes, find_element, \
from edgar.xmltools import child_value, child_text, value_or_footnote, get_footnote_ids, value_with_footnotes, find_element, \
optional_decimal
from decimal import Decimal

Expand Down

0 comments on commit 4a96079

Please sign in to comment.