Skip to content

Commit

Permalink
Sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Nov 22, 2024
1 parent 537b922 commit cf91207
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 76 deletions.
8 changes: 4 additions & 4 deletions src/pystow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
from .utils import ensure_readme

__all__ = [
"ConfigError",
"Module",
"VersionHint",
"dump_df",
"dump_json",
"dump_pickle",
Expand Down Expand Up @@ -80,6 +83,7 @@
"ensure_xml",
"ensure_zip_df",
"ensure_zip_np",
"get_config",
"join",
"joinpath_sqlite",
"load_df",
Expand All @@ -91,11 +95,7 @@
"module",
"open",
"open_gz",
"ConfigError",
"get_config",
"write_config",
"Module",
"VersionHint",
]

ensure_readme()
Expand Down
51 changes: 22 additions & 29 deletions src/pystow/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,55 +27,48 @@
import rdflib

__all__ = [
"module",
"join",
"joinpath_sqlite",
# Opener functions
"open",
"open_gz",
# Loader functions
"load_df",
"load_json",
"load_pickle",
"load_pickle_gz",
"load_rdf",
"load_xml",
# Dump functions
"dump_df",
"dump_json",
"dump_pickle",
"dump_rdf",
"dump_xml",
# Downloader functions
"ensure",
"ensure_from_s3",
"ensure_csv",
"ensure_custom",
"ensure_excel",
"ensure_from_google",
# Downloader functions with postprocessing
"ensure_untar",
"ensure_from_s3",
"ensure_gunzip",
# Downloader + opener functions
"ensure_json",
"ensure_json_bz2",
"ensure_open",
"ensure_open_gz",
"ensure_open_bz2",
"ensure_open_gz",
"ensure_open_lzma",
"ensure_open_tarfile",
"ensure_open_zip",
"ensure_open_sqlite",
"ensure_open_sqlite_gz",
# Processors
"ensure_csv",
"ensure_custom",
"ensure_json",
"ensure_json_bz2",
"ensure_open_tarfile",
"ensure_open_zip",
"ensure_pickle",
"ensure_pickle_gz",
"ensure_excel",
"ensure_xml",
"ensure_rdf",
"ensure_tar_df",
"ensure_tar_xml",
"ensure_untar",
"ensure_xml",
"ensure_zip_df",
"ensure_zip_np",
"join",
"joinpath_sqlite",
"load_df",
"load_json",
"load_pickle",
"load_pickle_gz",
"load_rdf",
"load_xml",
"module",
"open",
"open_gz",
]


Expand Down
4 changes: 2 additions & 2 deletions src/pystow/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
__all__ = [
# Classes
"Cached",
"CachedPickle",
"CachedJSON",
"CachedCollection",
"CachedDataFrame",
"CachedJSON",
"CachedPickle",
# Types
"Getter",
]
Expand Down
6 changes: 3 additions & 3 deletions src/pystow/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
from typing import IO, Any, Callable

__all__ = [
"PYSTOW_NAME_ENVVAR",
"JSON",
"PYSTOW_HOME_ENVVAR",
"PYSTOW_USE_APPDIRS",
"PYSTOW_NAME_DEFAULT",
"PYSTOW_NAME_ENVVAR",
"PYSTOW_USE_APPDIRS",
"README_TEXT",
"Opener",
"JSON",
"Provider",
]

Expand Down
65 changes: 27 additions & 38 deletions src/pystow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,58 +50,47 @@
import rdflib

__all__ = [
# Data Structures and type annotations
"HexDigestMismatch",
"DownloadBackend",
"Hash",
# Exceptions
"HexDigestError",
"HexDigestMismatch",
"UnexpectedDirectory",
"UnexpectedDirectoryError",
# Functions
"get_offending_hexdigests",
"download",
"download_from_google",
"download_from_s3",
"get_base",
"get_commit",
"get_df_io",
"get_hashes",
"raise_on_digest_mismatch",
"get_hexdigests_remote",
"download",
"name_from_url",
"name_from_s3_key",
"get_home",
"get_name",
"get_np_io",
"get_offending_hexdigests",
"getenv_path",
"gunzip",
"mkdir",
"mock_envvar",
"mock_home",
"getenv_path",
"n",
# Bytes generators
"get_df_io",
"get_np_io",
# LZMA utilities
"write_lzma_csv",
"gunzip",
# Zipfile utilities
"write_zipfile_csv",
"read_zipfile_csv",
"write_zipfile_xml",
"read_zipfile_xml",
"write_zipfile_np",
"read_zip_np",
"read_zipfile_rdf",
# Tarfile utilities
"write_tarfile_csv",
"name_from_s3_key",
"name_from_url",
"path_to_sqlite",
"raise_on_digest_mismatch",
"read_rdf",
"read_tarfile_csv",
"read_tarfile_xml",
# GZ utilities
"read_zip_np",
"read_zipfile_csv",
"read_zipfile_rdf",
"read_zipfile_xml",
"write_lzma_csv",
"write_pickle_gz",
# Standard readers
"read_rdf",
# Downloaders
"download_from_google",
"download_from_s3",
# Misc
"get_commit",
"get_home",
"get_name",
"get_base",
"path_to_sqlite",
"write_tarfile_csv",
"write_zipfile_csv",
"write_zipfile_np",
"write_zipfile_xml",
]

logger = logging.getLogger(__name__)
Expand Down

0 comments on commit cf91207

Please sign in to comment.