Skip to content

fix: use new server URL for ctx - #5

Open
christinehc wants to merge 1 commit into
USEPA:mainfrom
christinehc:main
Open

fix: use new server URL for ctx#5
christinehc wants to merge 1 commit into
USEPA:mainfrom
christinehc:main

Conversation

@christinehc

Copy link
Copy Markdown

This updates the host URL for the CompTox API to the new server at https://comptox.epa.gov/ctx-api/

The following code has been tested to not work with the old server host and works now with the changes:

import ctxpy as ctx
CTX_API_KEY = "api-key-goes-here"
chem = ctx.Chemical(x_api_key=CTX_API_KEY)
chem.search(by="equals", word="290352-28-2")

Returns:

[{'dtxsid': 'DTXSID7047306',
  'dtxcid': 'DTXCID5027306',
  'casrn': '290352-28-2',
  'preferredName': 'CP-634384',
  'hasStructureImage': 1,
  'smiles': 'CC1=CC(NC(=O)C(O)=O)=CC(C)=C1OC1=CC=C(O)C2=C1CCC2',
  'isMarkush': False,
  'searchName': 'CAS-RN',
  'searchValue': '290352-28-2',
  'rank': 5}]

--
Changes:

  • fix: Updated server URL in base.CTXConnection
  • format: Applied formatting/linting using ruff and isort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant