santiment / sanpy

Santiment API Python Client
MIT License
94 stars 29 forks source link

Artur interview q1 #174

Closed darthur11 closed 10 months ago

darthur11 commented 1 year ago
  1. graphql.py
    • created __execute_gql__ to remove repetetive part of the code
    • implemented __handle_response__ function to handle response and return data and headers
    • added input/output data types
    • f strings instead of .format
    • docstrings
    • black formatter
    • removed json import
  2. available_metrics.py
    • f strings instead of .format
    • added input/output data types
    • docstrings
    • black formatter
  3. sanbase_graphql_helper.py
    • transform_query_args using .get for dictionaries, improves readability
    • refactor _format_to_date function to raise an exception in case of incorrect format + return correct datatype
    • f strings instead of .format
    • added input/output data types
    • docstrings
    • black formatter
    • move QUERY_MAPPING from sanbase_graphql_helper.py to query_constants.py
  4. query_constants.py
    • move QUERY_PATH_MAP from transform.py to query_constants.py
    • move QUERY_MAPPING from sanbase_graphql_helper.py to query_constants.py
  5. async_batch.py, batch.py, get.py, get_many.py, transform.py
    • optimize imports due to refactoring of constants
    • black formatter
  6. tests/utils.py
    • added headers method into TestResponse class to handle response.headers